Merge lp:~3v1n0/unity/gnome-keys-timestamp-api into lp:unity

Proposed by Marco Trevisan (Treviño) on 2015-03-18
Status: Merged
Approved by: Christopher Townsend on 2015-03-18
Approved revision: 3929
Merged at revision: 3930
Proposed branch: lp:~3v1n0/unity/gnome-keys-timestamp-api
Merge into: lp:unity
Diff against target: 61 lines (+6/-6)
2 files modified
unity-shared/GnomeKeyGrabber.cpp (+5/-5)
unity-shared/GnomeKeyGrabberImpl.h (+1/-1)
To merge this branch: bzr merge lp:~3v1n0/unity/gnome-keys-timestamp-api
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve on 2015-03-18
Sebastien Bacher Approve on 2015-03-18
Christopher Townsend 2015-03-18 Approve on 2015-03-18
Review via email: mp+253380@code.launchpad.net

Commit message

GnomeKeyGrabber: add timestamp support to accelerators

Description of the change

To post a comment you must log in.
Christopher Townsend (townsend) wrote :

Compiles fine and runs with no crash. We'll wait on seb128's results with running this with u-s-d before top approving.

review: Approve
Sebastien Bacher (seb128) wrote :

Tested with the corresponding u-s-d changes and it works great

review: Approve
Sebastien Bacher (seb128) wrote :

corresponding u-s-d changes on https://code.launchpad.net/~seb128/unity-settings-daemon/timestamp-for-commands/+merge/253394

we agreed on having the unity version bumped to 7.3.2 in the next release so u-s-d can update its requirement to this version

PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'unity-shared/GnomeKeyGrabber.cpp'
2--- unity-shared/GnomeKeyGrabber.cpp 2014-11-04 18:43:41 +0000
3+++ unity-shared/GnomeKeyGrabber.cpp 2015-03-18 15:06:41 +0000
4@@ -52,6 +52,7 @@
5 <signal name='AcceleratorActivated'>
6 <arg type='u' name='action'/>
7 <arg type='u' name='device'/>
8+ <arg type='u' name='timestamp'/>
9 </signal>
10 </interface>
11 </node>)";
12@@ -216,7 +217,7 @@
13 action.setState(CompAction::StateInitKey);
14 action.setInitiate([this](CompAction* action, CompAction::State state, CompOption::Vector& options) {
15 LOG_DEBUG(logger) << "pressed \"" << action->keyToString() << "\"";
16- activateAction(action, 0);
17+ activateAction(action, 0, options[7].value().i());
18 return true;
19 });
20 }
21@@ -231,7 +232,7 @@
22 if (state & CompAction::StateTermTapped)
23 {
24 LOG_DEBUG(logger) << "tapped \"" << key << "\"";
25- activateAction(action, 0);
26+ activateAction(action, 0, options[7].value().i());
27 return true;
28 }
29
30@@ -242,16 +243,15 @@
31 return addAction(action, false);
32 }
33
34-void GnomeGrabber::Impl::activateAction(CompAction const* action, unsigned int device) const
35+void GnomeGrabber::Impl::activateAction(CompAction const* action, unsigned device, unsigned timestamp) const
36 {
37 ptrdiff_t i = action - &actions_.front();
38
39 if (0 <= i && i < static_cast<ptrdiff_t>(action_ids_.size()))
40 {
41 auto action_id = action_ids_[i];
42-
43 LOG_DEBUG(logger) << "activateAction (" << action_id << " \"" << action->keyToString() << "\")";
44- shell_object_->EmitSignal("AcceleratorActivated", g_variant_new("(uu)", action_id, device));
45+ shell_object_->EmitSignal("AcceleratorActivated", g_variant_new("(uuu)", action_id, device, timestamp));
46 }
47 }
48
49
50=== modified file 'unity-shared/GnomeKeyGrabberImpl.h'
51--- unity-shared/GnomeKeyGrabberImpl.h 2014-02-12 04:04:39 +0000
52+++ unity-shared/GnomeKeyGrabberImpl.h 2015-03-18 15:06:41 +0000
53@@ -53,7 +53,7 @@
54
55 GVariant* onShellMethodCall(std::string const& method, GVariant* parameters);
56 unsigned int grabAccelerator(char const* accelerator, unsigned int flags);
57- void activateAction(CompAction const* action, unsigned int device) const;
58+ void activateAction(CompAction const* action, unsigned device, unsigned timestamp) const;
59
60 bool isActionPostponed(CompAction const& action) const;
61 };