Merge lp:~unity-team/compiz/x-sru1 into lp:compiz/xenial
- x-sru1
- Merge into xenial
Proposed by
Marco Trevisan (Treviño)
Status: | Merged | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | Andrea Azzarone | ||||||||||||||||||||||||||||
Approved revision: | 4017 | ||||||||||||||||||||||||||||
Merged at revision: | 4011 | ||||||||||||||||||||||||||||
Proposed branch: | lp:~unity-team/compiz/x-sru1 | ||||||||||||||||||||||||||||
Merge into: | lp:compiz/xenial | ||||||||||||||||||||||||||||
Diff against target: |
582 lines (+213/-37) 14 files modified
debian/changelog (+27/-0) include/core/screen.h (+3/-0) plugins/expo/expo.xml.in (+6/-0) plugins/expo/src/expo.cpp (+3/-1) plugins/opengl/src/paint.cpp (+1/-1) plugins/scale/include/scale/scale.h (+1/-1) plugins/scale/scale.xml.in (+7/-1) plugins/scale/src/privates.h (+2/-2) plugins/scale/src/scale.cpp (+83/-18) src/event.cpp (+29/-3) src/privatescreen.h (+7/-1) src/privatescreen/tests/test-privatescreen.cpp (+3/-0) src/screen.cpp (+26/-6) src/window.cpp (+15/-3) |
||||||||||||||||||||||||||||
To merge this branch: | bzr merge lp:~unity-team/compiz/x-sru1 | ||||||||||||||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andrea Azzarone | Approve | ||
Review via email: mp+295780@code.launchpad.net |
Commit message
Backported fixes for the first Xenial SRU
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/changelog' | |||
2 | --- debian/changelog 2016-04-15 05:30:50 +0000 | |||
3 | +++ debian/changelog 2016-05-26 00:07:16 +0000 | |||
4 | @@ -1,3 +1,30 @@ | |||
5 | 1 | compiz (1:0.9.12.2+16.04.20160415-0ubuntu2) UNRELEASED; urgency=medium | ||
6 | 2 | |||
7 | 3 | [ Andrea Azzarone ] | ||
8 | 4 | * Add an option to notify that a key press is actually an "auto | ||
9 | 5 | repeat" one. (LP: #1572241) | ||
10 | 6 | |||
11 | 7 | [ Alberts Muktupāvels ] | ||
12 | 8 | * OpenGL: use the number of Opaque windows around to decide whether | ||
13 | 9 | paint the bg or not (LP: #1574866) | ||
14 | 10 | |||
15 | 11 | [ Marco Trevisan (Treviño) ] | ||
16 | 12 | * Scale: use the selectedWindow as starting point when focusing a | ||
17 | 13 | window (LP: #1575168) | ||
18 | 14 | * Scale: allow to iterate through windows using Tab key | ||
19 | 15 | * Window: call stateChangeNotify when compiz state changed but before | ||
20 | 16 | changing the WM state (LP: #1521302) | ||
21 | 17 | |||
22 | 18 | [ Eleni Maria Stea ] | ||
23 | 19 | * Expo, Scale: add support for bottom offsets (LP: #1562346, LP: | ||
24 | 20 | #1573897) | ||
25 | 21 | |||
26 | 22 | [ handsome_feng ] | ||
27 | 23 | * Add a YBottomOffset value when stretch maximized windows。 (LP: | ||
28 | 24 | #1562348) | ||
29 | 25 | |||
30 | 26 | -- Andrea Azzarone <azzaronea@gmail.com> Thu, 26 May 2016 01:56:18 +0200 | ||
31 | 27 | |||
32 | 1 | compiz (1:0.9.12.2+16.04.20160415-0ubuntu1) xenial; urgency=medium | 28 | compiz (1:0.9.12.2+16.04.20160415-0ubuntu1) xenial; urgency=medium |
33 | 2 | 29 | ||
34 | 3 | [ Martin Wimpress ] | 30 | [ Martin Wimpress ] |
35 | 4 | 31 | ||
36 | === modified file 'include/core/screen.h' | |||
37 | --- include/core/screen.h 2015-10-20 22:43:42 +0000 | |||
38 | +++ include/core/screen.h 2016-05-26 00:07:16 +0000 | |||
39 | @@ -169,8 +169,11 @@ | |||
40 | 169 | { | 169 | { |
41 | 170 | public: | 170 | public: |
42 | 171 | virtual void incrementDesktopWindowCount() = 0; | 171 | virtual void incrementDesktopWindowCount() = 0; |
43 | 172 | virtual void incrementOpaqueDesktopWindowCount() = 0; | ||
44 | 172 | virtual void decrementDesktopWindowCount() = 0; | 173 | virtual void decrementDesktopWindowCount() = 0; |
45 | 174 | virtual void decrementOpaqueDesktopWindowCount() = 0; | ||
46 | 173 | virtual int desktopWindowCount() = 0; | 175 | virtual int desktopWindowCount() = 0; |
47 | 176 | virtual int opaqueDesktopWindowCount() = 0; | ||
48 | 174 | protected: | 177 | protected: |
49 | 175 | ~DesktopWindowCount() {} | 178 | ~DesktopWindowCount() {} |
50 | 176 | }; | 179 | }; |
51 | 177 | 180 | ||
52 | === modified file 'plugins/expo/expo.xml.in' | |||
53 | --- plugins/expo/expo.xml.in 2015-10-26 17:15:43 +0000 | |||
54 | +++ plugins/expo/expo.xml.in 2016-05-26 00:07:16 +0000 | |||
55 | @@ -149,6 +149,12 @@ | |||
56 | 149 | <_long>Vertical offset (in pixels).</_long> | 149 | <_long>Vertical offset (in pixels).</_long> |
57 | 150 | <default>24</default> | 150 | <default>24</default> |
58 | 151 | </option> | 151 | </option> |
59 | 152 | <option name="y_bottom_offset" type="int"> | ||
60 | 153 | <_short>Y Bottom Offset</_short> | ||
61 | 154 | <_long>Vertical offset from the bottom (in pixels).</_long> | ||
62 | 155 | <default>0</default> | ||
63 | 156 | <min>0</min> | ||
64 | 157 | </option> | ||
65 | 152 | <option name="distance" type="float"> | 158 | <option name="distance" type="float"> |
66 | 153 | <_short>Camera Distance</_short> | 159 | <_short>Camera Distance</_short> |
67 | 154 | <_long>The distance between the camera and the exposed viewports.</_long> | 160 | <_long>The distance between the camera and the exposed viewports.</_long> |
68 | 155 | 161 | ||
69 | === modified file 'plugins/expo/src/expo.cpp' | |||
70 | --- plugins/expo/src/expo.cpp 2015-10-20 15:12:34 +0000 | |||
71 | +++ plugins/expo/src/expo.cpp 2016-05-26 00:07:16 +0000 | |||
72 | @@ -921,6 +921,8 @@ | |||
73 | 921 | /* translate expo to center */ | 921 | /* translate expo to center */ |
74 | 922 | sTransform.translate (vpSize.x () * sx * -0.5 + offsetInWorldCoordX, | 922 | sTransform.translate (vpSize.x () * sx * -0.5 + offsetInWorldCoordX, |
75 | 923 | vpSize.y () * sy * 0.5 - offsetInWorldCoordY, 0.0f); | 923 | vpSize.y () * sy * 0.5 - offsetInWorldCoordY, 0.0f); |
76 | 924 | |||
77 | 925 | worldScaleFactorY -= (float)optionGetYBottomOffset () / (float)output->height (); | ||
78 | 924 | sTransform.scale (worldScaleFactorX, worldScaleFactorY, 1.0f); | 926 | sTransform.scale (worldScaleFactorX, worldScaleFactorY, 1.0f); |
79 | 925 | 927 | ||
80 | 926 | 928 | ||
81 | @@ -1503,7 +1505,7 @@ | |||
82 | 1503 | float yS = 1.0 + ((o->height () / (float) window->height ()) - 1.0f) * sigmoidProgress (eScreen->expoCam); | 1505 | float yS = 1.0 + ((o->height () / (float) window->height ()) - 1.0f) * sigmoidProgress (eScreen->expoCam); |
83 | 1504 | float xS = 1.0 + ((o->width () / (float) window->width ()) - 1.0f) * sigmoidProgress (eScreen->expoCam); | 1506 | float xS = 1.0 + ((o->width () / (float) window->width ()) - 1.0f) * sigmoidProgress (eScreen->expoCam); |
84 | 1505 | wTransform.translate (window->x () + window->width (), | 1507 | wTransform.translate (window->x () + window->width (), |
86 | 1506 | window->y () + window->height (), | 1508 | window->y () + window->height () + eScreen->optionGetYBottomOffset (), |
87 | 1507 | 0.0f); | 1509 | 0.0f); |
88 | 1508 | wTransform.scale (xS, yS, 1.0f); | 1510 | wTransform.scale (xS, yS, 1.0f); |
89 | 1509 | wTransform.translate (-(window->x () + window->width ()), | 1511 | wTransform.translate (-(window->x () + window->width ()), |
90 | 1510 | 1512 | ||
91 | === modified file 'plugins/opengl/src/paint.cpp' | |||
92 | --- plugins/opengl/src/paint.cpp 2015-04-07 14:20:32 +0000 | |||
93 | +++ plugins/opengl/src/paint.cpp 2016-05-26 00:07:16 +0000 | |||
94 | @@ -86,7 +86,7 @@ | |||
95 | 86 | if (!nBox) | 86 | if (!nBox) |
96 | 87 | return; | 87 | return; |
97 | 88 | 88 | ||
99 | 89 | if (screen->desktopWindowCount ()) | 89 | if (screen->opaqueDesktopWindowCount ()) |
100 | 90 | { | 90 | { |
101 | 91 | if (!backgroundTextures.empty ()) | 91 | if (!backgroundTextures.empty ()) |
102 | 92 | { | 92 | { |
103 | 93 | 93 | ||
104 | === modified file 'plugins/scale/include/scale/scale.h' | |||
105 | --- plugins/scale/include/scale/scale.h 2014-04-15 16:47:09 +0000 | |||
106 | +++ plugins/scale/include/scale/scale.h 2016-05-26 00:07:16 +0000 | |||
107 | @@ -137,7 +137,7 @@ | |||
108 | 137 | public: | 137 | public: |
109 | 138 | ScaleWindow (CompWindow *w); | 138 | ScaleWindow (CompWindow *w); |
110 | 139 | ~ScaleWindow (); | 139 | ~ScaleWindow (); |
112 | 140 | 140 | ||
113 | 141 | CompWindow *window; | 141 | CompWindow *window; |
114 | 142 | 142 | ||
115 | 143 | bool hasSlot () const; | 143 | bool hasSlot () const; |
116 | 144 | 144 | ||
117 | === modified file 'plugins/scale/scale.xml.in' | |||
118 | --- plugins/scale/scale.xml.in 2015-10-26 17:15:43 +0000 | |||
119 | +++ plugins/scale/scale.xml.in 2016-05-26 00:07:16 +0000 | |||
120 | @@ -33,7 +33,13 @@ | |||
121 | 33 | </option> | 33 | </option> |
122 | 34 | <option name="y_offset" type="int"> | 34 | <option name="y_offset" type="int"> |
123 | 35 | <_short>Y Offset</_short> | 35 | <_short>Y Offset</_short> |
125 | 36 | <_long>Vertical offset (in pixels).</_long> | 36 | <_long>Vertical offset from the top (in pixels).</_long> |
126 | 37 | <min>0</min> | ||
127 | 38 | <default>0</default> | ||
128 | 39 | </option> | ||
129 | 40 | <option name="y_bottom_offset" type="int"> | ||
130 | 41 | <_short>Y Bottom Offset</_short> | ||
131 | 42 | <_long>Vertical offset from the bottom (in pixels).</_long>) | ||
132 | 37 | <min>0</min> | 43 | <min>0</min> |
133 | 38 | <default>0</default> | 44 | <default>0</default> |
134 | 39 | </option> | 45 | </option> |
135 | 40 | 46 | ||
136 | === modified file 'plugins/scale/src/privates.h' | |||
137 | --- plugins/scale/src/privates.h 2014-04-17 16:00:05 +0000 | |||
138 | +++ plugins/scale/src/privates.h 2016-05-26 00:07:16 +0000 | |||
139 | @@ -94,7 +94,9 @@ | |||
140 | 94 | bool selectWindowAt (int x, int y, bool moveInputFocus); | 94 | bool selectWindowAt (int x, int y, bool moveInputFocus); |
141 | 95 | bool selectWindowAt (int x, int y); | 95 | bool selectWindowAt (int x, int y); |
142 | 96 | 96 | ||
143 | 97 | void moveFocusWindow (CompWindow *); | ||
144 | 97 | void moveFocusWindow (int dx, int dy); | 98 | void moveFocusWindow (int dx, int dy); |
145 | 99 | void moveFocusWindow (int distance); | ||
146 | 98 | 100 | ||
147 | 99 | void windowRemove (CompWindow *); | 101 | void windowRemove (CompWindow *); |
148 | 100 | 102 | ||
149 | @@ -117,8 +119,6 @@ | |||
150 | 117 | Window hoveredWindow; | 119 | Window hoveredWindow; |
151 | 118 | Window previousActiveWindow; | 120 | Window previousActiveWindow; |
152 | 119 | 121 | ||
153 | 120 | KeyCode leftKeyCode, rightKeyCode, upKeyCode, downKeyCode; | ||
154 | 121 | |||
155 | 122 | bool grab; | 122 | bool grab; |
156 | 123 | CompScreen::GrabHandle grabIndex; | 123 | CompScreen::GrabHandle grabIndex; |
157 | 124 | 124 | ||
158 | 125 | 125 | ||
159 | === modified file 'plugins/scale/src/scale.cpp' | |||
160 | --- plugins/scale/src/scale.cpp 2015-11-16 12:14:14 +0000 | |||
161 | +++ plugins/scale/src/scale.cpp 2016-05-26 00:07:16 +0000 | |||
162 | @@ -509,7 +509,7 @@ | |||
163 | 509 | int nSlots = 0; | 509 | int nSlots = 0; |
164 | 510 | 510 | ||
165 | 511 | y = optionGetYOffset() + workArea.y () + spacing; | 511 | y = optionGetYOffset() + workArea.y () + spacing; |
167 | 512 | height = (workArea.height () - optionGetYOffset() - (lines + 1) * spacing) / lines; | 512 | height = (workArea.height () - optionGetYOffset () - optionGetYBottomOffset () - (lines + 1) * spacing) / lines; |
168 | 513 | 513 | ||
169 | 514 | for (int i = 0; i < lines; i++) | 514 | for (int i = 0; i < lines; i++) |
170 | 515 | { | 515 | { |
171 | @@ -1528,13 +1528,67 @@ | |||
172 | 1528 | } | 1528 | } |
173 | 1529 | 1529 | ||
174 | 1530 | void | 1530 | void |
175 | 1531 | PrivateScaleScreen::moveFocusWindow (int distance) | ||
176 | 1532 | { | ||
177 | 1533 | CompWindow *selected; | ||
178 | 1534 | CompWindow *next; | ||
179 | 1535 | |||
180 | 1536 | next = NULL; | ||
181 | 1537 | selected = screen->findWindow (selectedWindow ? selectedWindow : screen->activeWindow ()); | ||
182 | 1538 | auto scaledWindows = windows; | ||
183 | 1539 | |||
184 | 1540 | /* Sort windows to respect the natural grid view */ | ||
185 | 1541 | scaledWindows.sort ([] (ScaleWindow *sw1, ScaleWindow *sw2) { | ||
186 | 1542 | if (!sw1->priv->slot) | ||
187 | 1543 | return !sw2->priv->slot; | ||
188 | 1544 | if (!sw2->priv->slot) | ||
189 | 1545 | return true; | ||
190 | 1546 | |||
191 | 1547 | int cy1 = (sw1->priv->slot->y1 () + sw1->priv->slot->y2 ()) / 2; | ||
192 | 1548 | int cy2 = (sw2->priv->slot->y1 () + sw2->priv->slot->y2 ()) / 2; | ||
193 | 1549 | |||
194 | 1550 | if (abs (cy1 - cy2) < std::max (sw1->priv->slot->height (), sw2->priv->slot->height ()) / 2) | ||
195 | 1551 | { | ||
196 | 1552 | int cx1 = (sw1->priv->slot->x1 () + sw1->priv->slot->x2 ()) / 2; | ||
197 | 1553 | int cx2 = (sw2->priv->slot->x1 () + sw2->priv->slot->x2 ()) / 2; | ||
198 | 1554 | return cx1 < cx2; | ||
199 | 1555 | } | ||
200 | 1556 | |||
201 | 1557 | return cy1 < cy2; | ||
202 | 1558 | }); | ||
203 | 1559 | |||
204 | 1560 | if (selected && !scaledWindows.empty()) | ||
205 | 1561 | { | ||
206 | 1562 | SCALE_WINDOW (selected); | ||
207 | 1563 | auto selected_it = std::find (scaledWindows.begin (), scaledWindows.end (), sw); | ||
208 | 1564 | |||
209 | 1565 | if (selected_it != scaledWindows.end ()) | ||
210 | 1566 | { | ||
211 | 1567 | std::advance (selected_it, distance); | ||
212 | 1568 | |||
213 | 1569 | if (selected_it == scaledWindows.end ()) | ||
214 | 1570 | { | ||
215 | 1571 | if (distance > 0) | ||
216 | 1572 | selected_it = scaledWindows.begin (); | ||
217 | 1573 | else if (distance < 0) | ||
218 | 1574 | selected_it = std::prev (scaledWindows.end ()); | ||
219 | 1575 | } | ||
220 | 1576 | |||
221 | 1577 | next = (*selected_it)->window; | ||
222 | 1578 | } | ||
223 | 1579 | } | ||
224 | 1580 | |||
225 | 1581 | moveFocusWindow (next); | ||
226 | 1582 | } | ||
227 | 1583 | |||
228 | 1584 | void | ||
229 | 1531 | PrivateScaleScreen::moveFocusWindow (int dx, | 1585 | PrivateScaleScreen::moveFocusWindow (int dx, |
230 | 1532 | int dy) | 1586 | int dy) |
231 | 1533 | { | 1587 | { |
232 | 1534 | CompWindow *active; | 1588 | CompWindow *active; |
233 | 1535 | CompWindow *focus = NULL; | 1589 | CompWindow *focus = NULL; |
234 | 1536 | 1590 | ||
236 | 1537 | active = screen->findWindow (screen->activeWindow ()); | 1591 | active = screen->findWindow (selectedWindow ? selectedWindow : screen->activeWindow ()); |
237 | 1538 | if (active) | 1592 | if (active) |
238 | 1539 | { | 1593 | { |
239 | 1540 | SCALE_WINDOW (active); | 1594 | SCALE_WINDOW (active); |
240 | @@ -1547,9 +1601,9 @@ | |||
241 | 1547 | cx = (sw->priv->slot->x1 () + sw->priv->slot->x2 ()) / 2; | 1601 | cx = (sw->priv->slot->x1 () + sw->priv->slot->x2 ()) / 2; |
242 | 1548 | cy = (sw->priv->slot->y1 () + sw->priv->slot->y2 ()) / 2; | 1602 | cy = (sw->priv->slot->y1 () + sw->priv->slot->y2 ()) / 2; |
243 | 1549 | 1603 | ||
245 | 1550 | foreach (CompWindow *w, screen->windows ()) | 1604 | foreach (ScaleWindow *w, windows) |
246 | 1551 | { | 1605 | { |
248 | 1552 | slot = ScaleWindow::get (w)->priv->slot; | 1606 | slot = w->priv->slot; |
249 | 1553 | if (!slot) | 1607 | if (!slot) |
250 | 1554 | continue; | 1608 | continue; |
251 | 1555 | 1609 | ||
252 | @@ -1566,23 +1620,29 @@ | |||
253 | 1566 | continue; | 1620 | continue; |
254 | 1567 | 1621 | ||
255 | 1568 | min = d; | 1622 | min = d; |
257 | 1569 | focus = w; | 1623 | focus = w->window; |
258 | 1570 | } | 1624 | } |
259 | 1571 | } | 1625 | } |
260 | 1572 | } | 1626 | } |
261 | 1573 | } | 1627 | } |
262 | 1574 | 1628 | ||
263 | 1629 | moveFocusWindow (focus); | ||
264 | 1630 | } | ||
265 | 1631 | |||
266 | 1632 | void | ||
267 | 1633 | PrivateScaleScreen::moveFocusWindow (CompWindow *focus) | ||
268 | 1634 | { | ||
269 | 1575 | /* move focus to the last focused window if no slot window is currently | 1635 | /* move focus to the last focused window if no slot window is currently |
270 | 1576 | focused */ | 1636 | focused */ |
271 | 1577 | if (!focus) | 1637 | if (!focus) |
272 | 1578 | { | 1638 | { |
274 | 1579 | foreach (CompWindow *w, screen->windows ()) | 1639 | foreach (ScaleWindow *sw, windows) |
275 | 1580 | { | 1640 | { |
277 | 1581 | if (!ScaleWindow::get (w)->priv->slot) | 1641 | if (!sw->priv->slot) |
278 | 1582 | continue; | 1642 | continue; |
279 | 1583 | 1643 | ||
282 | 1584 | if (!focus || focus->activeNum () < w->activeNum ()) | 1644 | if (!focus || focus->activeNum () < sw->window->activeNum ()) |
283 | 1585 | focus = w; | 1645 | focus = sw->window; |
284 | 1586 | } | 1646 | } |
285 | 1587 | } | 1647 | } |
286 | 1588 | 1648 | ||
287 | @@ -1719,14 +1779,23 @@ | |||
288 | 1719 | { | 1779 | { |
289 | 1720 | if (grabIndex) | 1780 | if (grabIndex) |
290 | 1721 | { | 1781 | { |
292 | 1722 | if (event->xkey.keycode == leftKeyCode) | 1782 | KeySym keySym = XkbKeycodeToKeysym (event->xany.display, |
293 | 1783 | event->xkey.keycode, 0, 0); | ||
294 | 1784 | if (keySym == XK_Left) | ||
295 | 1723 | moveFocusWindow (-1, 0); | 1785 | moveFocusWindow (-1, 0); |
297 | 1724 | else if (event->xkey.keycode == rightKeyCode) | 1786 | else if (keySym == XK_Right) |
298 | 1725 | moveFocusWindow (1, 0); | 1787 | moveFocusWindow (1, 0); |
300 | 1726 | else if (event->xkey.keycode == upKeyCode) | 1788 | else if (keySym == XK_Up) |
301 | 1727 | moveFocusWindow (0, -1); | 1789 | moveFocusWindow (0, -1); |
303 | 1728 | else if (event->xkey.keycode == downKeyCode) | 1790 | else if (keySym == XK_Down) |
304 | 1729 | moveFocusWindow (0, 1); | 1791 | moveFocusWindow (0, 1); |
305 | 1792 | else if (keySym == XK_Tab) | ||
306 | 1793 | moveFocusWindow (!(event->xkey.state & ShiftMask) ? 1 : -1); | ||
307 | 1794 | else if (keySym == XK_w && (event->xkey.state & ControlMask)) | ||
308 | 1795 | { | ||
309 | 1796 | if (CompWindow *selected = screen->findWindow (selectedWindow)) | ||
310 | 1797 | selected->close (0); | ||
311 | 1798 | } | ||
312 | 1730 | } | 1799 | } |
313 | 1731 | } | 1800 | } |
314 | 1732 | break; | 1801 | break; |
315 | @@ -1752,6 +1821,7 @@ | |||
316 | 1752 | CompRect workArea (screen->currentOutputDev ().workArea ()); | 1821 | CompRect workArea (screen->currentOutputDev ().workArea ()); |
317 | 1753 | workArea.setX (workArea.x() + optionGetXOffset ()); | 1822 | workArea.setX (workArea.x() + optionGetXOffset ()); |
318 | 1754 | workArea.setY (workArea.y() + optionGetYOffset ()); | 1823 | workArea.setY (workArea.y() + optionGetYOffset ()); |
319 | 1824 | workArea.setBottom (workArea.bottom () + optionGetYBottomOffset ()); | ||
320 | 1755 | 1825 | ||
321 | 1756 | if (workArea.contains (pointer)) | 1826 | if (workArea.contains (pointer)) |
322 | 1757 | { | 1827 | { |
323 | @@ -1962,11 +2032,6 @@ | |||
324 | 1962 | moreAdjust (false), | 2032 | moreAdjust (false), |
325 | 1963 | nSlots (0) | 2033 | nSlots (0) |
326 | 1964 | { | 2034 | { |
327 | 1965 | leftKeyCode = XKeysymToKeycode (screen->dpy (), XStringToKeysym ("Left")); | ||
328 | 1966 | rightKeyCode = XKeysymToKeycode (screen->dpy (), XStringToKeysym ("Right")); | ||
329 | 1967 | upKeyCode = XKeysymToKeycode (screen->dpy (), XStringToKeysym ("Up")); | ||
330 | 1968 | downKeyCode = XKeysymToKeycode (screen->dpy (), XStringToKeysym ("Down")); | ||
331 | 1969 | |||
332 | 1970 | opacity = (OPAQUE * optionGetOpacity ()) / 100; | 2035 | opacity = (OPAQUE * optionGetOpacity ()) / 100; |
333 | 1971 | 2036 | ||
334 | 1972 | hover.setCallback (boost::bind (&PrivateScaleScreen::hoverTimeout, this)); | 2037 | hover.setCallback (boost::bind (&PrivateScaleScreen::hoverTimeout, this)); |
335 | 1973 | 2038 | ||
336 | === modified file 'src/event.cpp' | |||
337 | --- src/event.cpp 2015-10-13 11:33:31 +0000 | |||
338 | +++ src/event.cpp 2016-05-26 00:07:16 +0000 | |||
339 | @@ -855,7 +855,7 @@ | |||
340 | 855 | 855 | ||
341 | 856 | if (o.empty ()) | 856 | if (o.empty ()) |
342 | 857 | { | 857 | { |
344 | 858 | o.resize (8); | 858 | o.resize (9); |
345 | 859 | o[0].setName ("event_window", CompOption::TypeInt); | 859 | o[0].setName ("event_window", CompOption::TypeInt); |
346 | 860 | o[1].setName ("window", CompOption::TypeInt); | 860 | o[1].setName ("window", CompOption::TypeInt); |
347 | 861 | o[2].setName ("modifiers", CompOption::TypeInt); | 861 | o[2].setName ("modifiers", CompOption::TypeInt); |
348 | @@ -867,6 +867,7 @@ | |||
349 | 867 | { | 867 | { |
350 | 868 | o[6].reset (); | 868 | o[6].reset (); |
351 | 869 | o[7].reset (); | 869 | o[7].reset (); |
352 | 870 | o[8].reset (); | ||
353 | 870 | } | 871 | } |
354 | 871 | 872 | ||
355 | 872 | switch (event->type) { | 873 | switch (event->type) { |
356 | @@ -936,10 +937,14 @@ | |||
357 | 936 | 937 | ||
358 | 937 | o[6].setName ("keycode", CompOption::TypeInt); | 938 | o[6].setName ("keycode", CompOption::TypeInt); |
359 | 938 | o[7].setName ("time", CompOption::TypeInt); | 939 | o[7].setName ("time", CompOption::TypeInt); |
360 | 940 | o[8].setName ("is_repeated", CompOption::TypeBool); | ||
361 | 939 | 941 | ||
362 | 940 | o[6].value ().set ((int) event->xkey.keycode); | 942 | o[6].value ().set ((int) event->xkey.keycode); |
363 | 941 | o[7].value ().set ((int) event->xkey.time); | 943 | o[7].value ().set ((int) event->xkey.time); |
364 | 942 | 944 | ||
365 | 945 | o[8].value ().set (nextKeyPressIsRepeated_); | ||
366 | 946 | nextKeyPressIsRepeated_ = false; | ||
367 | 947 | |||
368 | 943 | eventManager.resetPossibleTap(); | 948 | eventManager.resetPossibleTap(); |
369 | 944 | foreach (CompPlugin *p, CompPlugin::getPlugins ()) | 949 | foreach (CompPlugin *p, CompPlugin::getPlugins ()) |
370 | 945 | { | 950 | { |
371 | @@ -966,6 +971,19 @@ | |||
372 | 966 | 971 | ||
373 | 967 | bool handled = false; | 972 | bool handled = false; |
374 | 968 | 973 | ||
375 | 974 | nextKeyPressIsRepeated_ = false; | ||
376 | 975 | if (XEventsQueued (dpy, QueuedAfterReading)) | ||
377 | 976 | { | ||
378 | 977 | XEvent nev; | ||
379 | 978 | XPeekEvent (dpy, &nev); | ||
380 | 979 | |||
381 | 980 | if (nev.type == KeyPress && nev.xkey.time == event->xkey.time && | ||
382 | 981 | nev.xkey.keycode == event->xkey.keycode) | ||
383 | 982 | { | ||
384 | 983 | nextKeyPressIsRepeated_ = true; | ||
385 | 984 | } | ||
386 | 985 | } | ||
387 | 986 | |||
388 | 969 | foreach (CompPlugin *p, CompPlugin::getPlugins ()) | 987 | foreach (CompPlugin *p, CompPlugin::getPlugins ()) |
389 | 970 | { | 988 | { |
390 | 971 | CompOption::Vector &options = p->vTable->getOptions (); | 989 | CompOption::Vector &options = p->vTable->getOptions (); |
391 | @@ -1679,9 +1697,17 @@ | |||
392 | 1679 | if (w->isViewable ()) | 1697 | if (w->isViewable ()) |
393 | 1680 | { | 1698 | { |
394 | 1681 | if (w->type () == CompWindowTypeDesktopMask) | 1699 | if (w->type () == CompWindowTypeDesktopMask) |
396 | 1682 | decrementDesktopWindowCount(); | 1700 | { |
397 | 1701 | decrementDesktopWindowCount (); | ||
398 | 1702 | if (!w->alpha ()) | ||
399 | 1703 | decrementOpaqueDesktopWindowCount (); | ||
400 | 1704 | } | ||
401 | 1683 | else if (type == CompWindowTypeDesktopMask) | 1705 | else if (type == CompWindowTypeDesktopMask) |
403 | 1684 | incrementDesktopWindowCount(); | 1706 | { |
404 | 1707 | incrementDesktopWindowCount (); | ||
405 | 1708 | if (!w->alpha ()) | ||
406 | 1709 | incrementOpaqueDesktopWindowCount (); | ||
407 | 1710 | } | ||
408 | 1685 | } | 1711 | } |
409 | 1686 | 1712 | ||
410 | 1687 | w->wmType () = type; | 1713 | w->wmType () = type; |
411 | 1688 | 1714 | ||
412 | === modified file 'src/privatescreen.h' | |||
413 | --- src/privatescreen.h 2015-10-26 17:15:50 +0000 | |||
414 | +++ src/privatescreen.h 2016-05-26 00:07:16 +0000 | |||
415 | @@ -542,10 +542,14 @@ | |||
416 | 542 | DesktopWindowCount(); | 542 | DesktopWindowCount(); |
417 | 543 | virtual ~DesktopWindowCount() {} | 543 | virtual ~DesktopWindowCount() {} |
418 | 544 | virtual void incrementDesktopWindowCount(); | 544 | virtual void incrementDesktopWindowCount(); |
419 | 545 | virtual void incrementOpaqueDesktopWindowCount(); | ||
420 | 545 | virtual void decrementDesktopWindowCount(); | 546 | virtual void decrementDesktopWindowCount(); |
421 | 547 | virtual void decrementOpaqueDesktopWindowCount(); | ||
422 | 546 | virtual int desktopWindowCount(); | 548 | virtual int desktopWindowCount(); |
423 | 549 | virtual int opaqueDesktopWindowCount(); | ||
424 | 547 | private: | 550 | private: |
426 | 548 | int count; | 551 | int countAll; |
427 | 552 | int countOpaque; | ||
428 | 549 | }; | 553 | }; |
429 | 550 | 554 | ||
430 | 551 | class MapNum : | 555 | class MapNum : |
431 | @@ -818,6 +822,8 @@ | |||
432 | 818 | compiz::private_screen::PluginManager pluginManager; | 822 | compiz::private_screen::PluginManager pluginManager; |
433 | 819 | compiz::private_screen::WindowManager& windowManager; | 823 | compiz::private_screen::WindowManager& windowManager; |
434 | 820 | CompOption::Vector resourceManager; | 824 | CompOption::Vector resourceManager; |
435 | 825 | |||
436 | 826 | bool nextKeyPressIsRepeated_; | ||
437 | 821 | }; | 827 | }; |
438 | 822 | 828 | ||
439 | 823 | class CompManager | 829 | class CompManager |
440 | 824 | 830 | ||
441 | === modified file 'src/privatescreen/tests/test-privatescreen.cpp' | |||
442 | --- src/privatescreen/tests/test-privatescreen.cpp 2015-10-26 17:15:50 +0000 | |||
443 | +++ src/privatescreen/tests/test-privatescreen.cpp 2016-05-26 00:07:16 +0000 | |||
444 | @@ -145,6 +145,7 @@ | |||
445 | 145 | CompSize &size, | 145 | CompSize &size, |
446 | 146 | void *&data)); | 146 | void *&data)); |
447 | 147 | MOCK_METHOD0(desktopWindowCount, int ()); | 147 | MOCK_METHOD0(desktopWindowCount, int ()); |
448 | 148 | MOCK_METHOD0(opaqueDesktopWindowCount, int ()); | ||
449 | 148 | MOCK_METHOD0(attrib, XWindowAttributes ()); | 149 | MOCK_METHOD0(attrib, XWindowAttributes ()); |
450 | 149 | MOCK_CONST_METHOD0(defaultIcon, CompIcon *()); | 150 | MOCK_CONST_METHOD0(defaultIcon, CompIcon *()); |
451 | 150 | virtual bool otherGrabExist (const char *, ...) { return false; } // TODO How to mock? | 151 | virtual bool otherGrabExist (const char *, ...) { return false; } // TODO How to mock? |
452 | @@ -183,7 +184,9 @@ | |||
453 | 183 | MOCK_METHOD0(snDisplay, SnDisplay * ()); | 184 | MOCK_METHOD0(snDisplay, SnDisplay * ()); |
454 | 184 | MOCK_CONST_METHOD0(createFailed, bool ()); | 185 | MOCK_CONST_METHOD0(createFailed, bool ()); |
455 | 185 | MOCK_METHOD0(incrementDesktopWindowCount, void ()); | 186 | MOCK_METHOD0(incrementDesktopWindowCount, void ()); |
456 | 187 | MOCK_METHOD0(incrementOpaqueDesktopWindowCount, void ()); | ||
457 | 186 | MOCK_METHOD0(decrementDesktopWindowCount, void ()); | 188 | MOCK_METHOD0(decrementDesktopWindowCount, void ()); |
458 | 189 | MOCK_METHOD0(decrementOpaqueDesktopWindowCount, void ()); | ||
459 | 187 | MOCK_METHOD0(nextMapNum, unsigned int ()); | 190 | MOCK_METHOD0(nextMapNum, unsigned int ()); |
460 | 188 | MOCK_CONST_METHOD0(updatePassiveKeyGrabs, void ()); | 191 | MOCK_CONST_METHOD0(updatePassiveKeyGrabs, void ()); |
461 | 189 | MOCK_METHOD1(updatePassiveButtonGrabs, void (Window serverFrame)); | 192 | MOCK_METHOD1(updatePassiveButtonGrabs, void (Window serverFrame)); |
462 | 190 | 193 | ||
463 | === modified file 'src/screen.cpp' | |||
464 | --- src/screen.cpp 2015-10-26 17:15:50 +0000 | |||
465 | +++ src/screen.cpp 2016-05-26 00:07:16 +0000 | |||
466 | @@ -4565,7 +4565,13 @@ | |||
467 | 4565 | int | 4565 | int |
468 | 4566 | cps::DesktopWindowCount::desktopWindowCount () | 4566 | cps::DesktopWindowCount::desktopWindowCount () |
469 | 4567 | { | 4567 | { |
471 | 4568 | return count; | 4568 | return countAll; |
472 | 4569 | } | ||
473 | 4570 | |||
474 | 4571 | int | ||
475 | 4572 | cps::DesktopWindowCount::opaqueDesktopWindowCount () | ||
476 | 4573 | { | ||
477 | 4574 | return countOpaque; | ||
478 | 4569 | } | 4575 | } |
479 | 4570 | 4576 | ||
480 | 4571 | unsigned int | 4577 | unsigned int |
481 | @@ -4879,19 +4885,32 @@ | |||
482 | 4879 | } | 4885 | } |
483 | 4880 | 4886 | ||
484 | 4881 | cps::DesktopWindowCount::DesktopWindowCount() : | 4887 | cps::DesktopWindowCount::DesktopWindowCount() : |
486 | 4882 | count(0) | 4888 | countAll(0), countOpaque(0) |
487 | 4883 | { | 4889 | { |
488 | 4884 | } | 4890 | } |
489 | 4885 | 4891 | ||
490 | 4886 | void | 4892 | void |
491 | 4887 | cps::DesktopWindowCount::incrementDesktopWindowCount() | 4893 | cps::DesktopWindowCount::incrementDesktopWindowCount() |
492 | 4888 | { | 4894 | { |
495 | 4889 | count++; | 4895 | countAll++; |
496 | 4890 | } | 4896 | } |
497 | 4897 | |||
498 | 4898 | void | ||
499 | 4899 | cps::DesktopWindowCount::incrementOpaqueDesktopWindowCount() | ||
500 | 4900 | { | ||
501 | 4901 | countOpaque++; | ||
502 | 4902 | } | ||
503 | 4903 | |||
504 | 4891 | void | 4904 | void |
505 | 4892 | cps::DesktopWindowCount::decrementDesktopWindowCount() | 4905 | cps::DesktopWindowCount::decrementDesktopWindowCount() |
506 | 4893 | { | 4906 | { |
508 | 4894 | count--; | 4907 | countAll--; |
509 | 4908 | } | ||
510 | 4909 | |||
511 | 4910 | void | ||
512 | 4911 | cps::DesktopWindowCount::decrementOpaqueDesktopWindowCount() | ||
513 | 4912 | { | ||
514 | 4913 | countOpaque--; | ||
515 | 4895 | } | 4914 | } |
516 | 4896 | 4915 | ||
517 | 4897 | cps::MapNum::MapNum() : | 4916 | cps::MapNum::MapNum() : |
518 | @@ -5451,7 +5470,8 @@ | |||
519 | 5451 | edgeWindow (None), | 5470 | edgeWindow (None), |
520 | 5452 | edgeDelayTimer (), | 5471 | edgeDelayTimer (), |
521 | 5453 | xdndWindow (None), | 5472 | xdndWindow (None), |
523 | 5454 | windowManager(windowManager) | 5473 | windowManager(windowManager), |
524 | 5474 | nextKeyPressIsRepeated_(false) | ||
525 | 5455 | { | 5475 | { |
526 | 5456 | for (int i = 0; i < SCREEN_EDGE_NUM; i++) | 5476 | for (int i = 0; i < SCREEN_EDGE_NUM; i++) |
527 | 5457 | { | 5477 | { |
528 | 5458 | 5478 | ||
529 | === modified file 'src/window.cpp' | |||
530 | --- src/window.cpp 2015-08-05 11:26:30 +0000 | |||
531 | +++ src/window.cpp 2016-05-26 00:07:16 +0000 | |||
532 | @@ -543,11 +543,11 @@ | |||
533 | 543 | 543 | ||
534 | 544 | recalcType (); | 544 | recalcType (); |
535 | 545 | recalcActions (); | 545 | recalcActions (); |
536 | 546 | stateChangeNotify (oldState); | ||
537 | 546 | 547 | ||
538 | 547 | if (priv->managed) | 548 | if (priv->managed) |
539 | 548 | screen->setWindowState (priv->state, priv->id); | 549 | screen->setWindowState (priv->state, priv->id); |
540 | 549 | 550 | ||
541 | 550 | stateChangeNotify (oldState); | ||
542 | 551 | screen->matchPropertyChanged (this); | 551 | screen->matchPropertyChanged (this); |
543 | 552 | } | 552 | } |
544 | 553 | 553 | ||
545 | @@ -1372,7 +1372,11 @@ | |||
546 | 1372 | screen->updateClientList (); | 1372 | screen->updateClientList (); |
547 | 1373 | 1373 | ||
548 | 1374 | if (priv->type & CompWindowTypeDesktopMask) | 1374 | if (priv->type & CompWindowTypeDesktopMask) |
550 | 1375 | screen->incrementDesktopWindowCount(); | 1375 | { |
551 | 1376 | screen->incrementDesktopWindowCount (); | ||
552 | 1377 | if (!alpha ()) | ||
553 | 1378 | screen->incrementOpaqueDesktopWindowCount (); | ||
554 | 1379 | } | ||
555 | 1376 | 1380 | ||
556 | 1377 | if (priv->protocols & CompWindowProtocolSyncRequestMask) | 1381 | if (priv->protocols & CompWindowProtocolSyncRequestMask) |
557 | 1378 | { | 1382 | { |
558 | @@ -1456,7 +1460,11 @@ | |||
559 | 1456 | return; | 1460 | return; |
560 | 1457 | 1461 | ||
561 | 1458 | if (priv->type == CompWindowTypeDesktopMask) | 1462 | if (priv->type == CompWindowTypeDesktopMask) |
563 | 1459 | screen->decrementDesktopWindowCount(); | 1463 | { |
564 | 1464 | screen->decrementDesktopWindowCount (); | ||
565 | 1465 | if (!alpha ()) | ||
566 | 1466 | screen->decrementOpaqueDesktopWindowCount (); | ||
567 | 1467 | } | ||
568 | 1460 | 1468 | ||
569 | 1461 | priv->attrib.map_state = IsUnmapped; | 1469 | priv->attrib.map_state = IsUnmapped; |
570 | 1462 | priv->invisible = true; | 1470 | priv->invisible = true; |
571 | @@ -6333,7 +6341,11 @@ | |||
572 | 6333 | if (priv->attrib.map_state == IsViewable) | 6341 | if (priv->attrib.map_state == IsViewable) |
573 | 6334 | { | 6342 | { |
574 | 6335 | if (priv->type == CompWindowTypeDesktopMask) | 6343 | if (priv->type == CompWindowTypeDesktopMask) |
575 | 6344 | { | ||
576 | 6336 | screen->decrementDesktopWindowCount (); | 6345 | screen->decrementDesktopWindowCount (); |
577 | 6346 | if (!alpha ()) | ||
578 | 6347 | screen->decrementOpaqueDesktopWindowCount (); | ||
579 | 6348 | } | ||
580 | 6337 | 6349 | ||
581 | 6338 | if (priv->destroyed && priv->struts) | 6350 | if (priv->destroyed && priv->struts) |
582 | 6339 | screen->updateWorkarea (); | 6351 | screen->updateWorkarea (); |
+1