Merge lp:~azzar1/compiz/is_repeated_key_press into lp:compiz/0.9.12

Proposed by Andrea Azzarone
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: 4011
Merged at revision: 4012
Proposed branch: lp:~azzar1/compiz/is_repeated_key_press
Merge into: lp:compiz/0.9.12
Diff against target: 82 lines (+23/-2)
3 files modified
src/event.cpp (+19/-1)
src/privatescreen.h (+2/-0)
src/screen.cpp (+2/-1)
To merge this branch: bzr merge lp:~azzar1/compiz/is_repeated_key_press
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+292892@code.launchpad.net

Commit message

Add an option to notify that a key press is actually an "auto repeat" one.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

LGTM otherwise.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Fine, check variable name style and it's good to go.

review: Approve
4012. By Andrea Azzarone

Camel case!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/event.cpp'
2--- src/event.cpp 2015-10-13 11:33:31 +0000
3+++ src/event.cpp 2016-04-26 12:38:28 +0000
4@@ -855,7 +855,7 @@
5
6 if (o.empty ())
7 {
8- o.resize (8);
9+ o.resize (9);
10 o[0].setName ("event_window", CompOption::TypeInt);
11 o[1].setName ("window", CompOption::TypeInt);
12 o[2].setName ("modifiers", CompOption::TypeInt);
13@@ -867,6 +867,7 @@
14 {
15 o[6].reset ();
16 o[7].reset ();
17+ o[8].reset ();
18 }
19
20 switch (event->type) {
21@@ -936,10 +937,14 @@
22
23 o[6].setName ("keycode", CompOption::TypeInt);
24 o[7].setName ("time", CompOption::TypeInt);
25+ o[8].setName ("is_repeated", CompOption::TypeBool);
26
27 o[6].value ().set ((int) event->xkey.keycode);
28 o[7].value ().set ((int) event->xkey.time);
29
30+ o[8].value ().set (nextKeyPressIsRepeated_);
31+ nextKeyPressIsRepeated_ = false;
32+
33 eventManager.resetPossibleTap();
34 foreach (CompPlugin *p, CompPlugin::getPlugins ())
35 {
36@@ -966,6 +971,19 @@
37
38 bool handled = false;
39
40+ nextKeyPressIsRepeated_ = false;
41+ if (XEventsQueued (dpy, QueuedAfterReading))
42+ {
43+ XEvent nev;
44+ XPeekEvent (dpy, &nev);
45+
46+ if (nev.type == KeyPress && nev.xkey.time == event->xkey.time &&
47+ nev.xkey.keycode == event->xkey.keycode)
48+ {
49+ nextKeyPressIsRepeated_ = true;
50+ }
51+ }
52+
53 foreach (CompPlugin *p, CompPlugin::getPlugins ())
54 {
55 CompOption::Vector &options = p->vTable->getOptions ();
56
57=== modified file 'src/privatescreen.h'
58--- src/privatescreen.h 2015-10-26 17:15:50 +0000
59+++ src/privatescreen.h 2016-04-26 12:38:28 +0000
60@@ -818,6 +818,8 @@
61 compiz::private_screen::PluginManager pluginManager;
62 compiz::private_screen::WindowManager& windowManager;
63 CompOption::Vector resourceManager;
64+
65+ bool nextKeyPressIsRepeated_;
66 };
67
68 class CompManager
69
70=== modified file 'src/screen.cpp'
71--- src/screen.cpp 2015-10-26 17:15:50 +0000
72+++ src/screen.cpp 2016-04-26 12:38:28 +0000
73@@ -5451,7 +5451,8 @@
74 edgeWindow (None),
75 edgeDelayTimer (),
76 xdndWindow (None),
77- windowManager(windowManager)
78+ windowManager(windowManager),
79+ nextKeyPressIsRepeated_(false)
80 {
81 for (int i = 0; i < SCREEN_EDGE_NUM; i++)
82 {

Subscribers

People subscribed via source and target branches