Merge lp:~3v1n0/compiz/cursors-update-on-theme+size-changes into lp:compiz/0.9.12
- cursors-update-on-theme+size-changes
- Merge into 0.9.12
Status: | Superseded |
---|---|
Proposed branch: | lp:~3v1n0/compiz/cursors-update-on-theme+size-changes |
Merge into: | lp:compiz/0.9.12 |
Prerequisite: | lp:~3v1n0/compiz/resize-selective-grab |
Diff against target: |
1027 lines (+223/-166) 27 files modified
CMakeLists.txt (+1/-0) debian/patches/ubuntu_super_p.patch.OTHER (+0/-27) include/core/abiversion.h (+1/-1) include/core/screen.h (+6/-1) plugins/expo/src/expo.cpp (+1/-8) plugins/expo/src/expo.h (+0/-3) plugins/freewins/src/action.cpp (+1/-5) plugins/freewins/src/events.cpp (+2/-4) plugins/freewins/src/freewins.h (+0/-2) plugins/move/src/move.cpp (+4/-6) plugins/move/src/move.h (+0/-2) plugins/resize/src/logic/include/resize-logic.h (+1/-11) plugins/resize/src/logic/include/screen-interface.h (+1/-0) plugins/resize/src/logic/src/resize-logic.cpp (+23/-12) plugins/resize/src/logic/tests/mock-screen.h (+1/-0) plugins/resize/src/resize.cpp (+0/-37) plugins/resize/src/screen-impl.h (+5/-0) plugins/shelf/src/shelf.cpp (+1/-7) plugins/shelf/src/shelf.h (+0/-1) plugins/shift/src/shift.cpp (+0/-3) plugins/shift/src/shift.h (+0/-2) plugins/widget/src/widget.cpp (+2/-6) plugins/widget/src/widget.h (+0/-1) src/event.cpp (+5/-0) src/privatescreen.h (+10/-3) src/privatescreen/tests/test-privatescreen.cpp (+2/-0) src/screen.cpp (+156/-24) |
To merge this branch: | bzr merge lp:~3v1n0/compiz/cursors-update-on-theme+size-changes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Andrea Azzarone | Approve | ||
Review via email: mp+275057@code.launchpad.net |
This proposal has been superseded by a proposal from 2015-10-22.
Commit message
Screen: monitor root RESOURCE_MANAGER and update cursors when Size or Theme changes
Also add cursorCache and updateCursors notify function
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
Andrea Azzarone (azzar1) wrote : | # |
LGTM. Not sure what happend with that diff still around but should not be a problem.
Andrea Azzarone (azzar1) : | # |
- 3953. By Marco Trevisan (Treviño)
-
Resize: add cursorCache definition to screen-interface
- 3954. By Marco Trevisan (Treviño)
-
CompScreen: add missing declaration for cursorCache method
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3953
http://
Executed test runs:
FAILURE: http://
None: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3954
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3954
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 3955. By Marco Trevisan (Treviño)
-
Screen: no need to update cursors on startup, we have none of them
Unmerged revisions
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2015-07-30 20:12:45 +0000 | |||
3 | +++ CMakeLists.txt 2015-10-20 22:44:20 +0000 | |||
4 | @@ -101,6 +101,7 @@ | |||
5 | 101 | xext | 101 | xext |
6 | 102 | xdamage | 102 | xdamage |
7 | 103 | xcomposite | 103 | xcomposite |
8 | 104 | xcursor | ||
9 | 104 | x11-xcb | 105 | x11-xcb |
10 | 105 | xrandr | 106 | xrandr |
11 | 106 | xinerama | 107 | xinerama |
12 | 107 | 108 | ||
13 | === removed directory 'debian/patches' | |||
14 | === removed file 'debian/patches/ubuntu_super_p.patch.OTHER' | |||
15 | --- debian/patches/ubuntu_super_p.patch.OTHER 2015-10-20 22:44:20 +0000 | |||
16 | +++ debian/patches/ubuntu_super_p.patch.OTHER 1970-01-01 00:00:00 +0000 | |||
17 | @@ -1,27 +0,0 @@ | |||
18 | 1 | Index: compiz/src/screen.cpp | ||
19 | 2 | =================================================================== | ||
20 | 3 | --- compiz.orig/src/screen.cpp 2015-09-18 04:41:44.071761222 +0200 | ||
21 | 4 | +++ compiz/src/screen.cpp 2015-09-18 04:47:21.284758934 +0200 | ||
22 | 5 | @@ -3294,10 +3294,19 @@ | ||
23 | 6 | * This is so that we can detect taps on individual modifier | ||
24 | 7 | * keys, and know to cancel the tap if <modifier>+k is pressed. | ||
25 | 8 | */ | ||
26 | 9 | - if (!(currentState & CompAction::StateIgnoreTap)) | ||
27 | 10 | + int minCode, maxCode; | ||
28 | 11 | + XDisplayKeycodes (screen->dpy(), &minCode, &maxCode); | ||
29 | 12 | + | ||
30 | 13 | + if ((currentState & CompAction::StateIgnoreTap)) | ||
31 | 14 | + { | ||
32 | 15 | + KeyCode code_p = XKeysymToKeycode(screen->dpy(), XK_p); | ||
33 | 16 | + | ||
34 | 17 | + for (k = minCode; k <= maxCode; k++) | ||
35 | 18 | + if (k != code_p) | ||
36 | 19 | + grabUngrabOneKey (modifiers | ignore, k, grab); | ||
37 | 20 | + } | ||
38 | 21 | + else | ||
39 | 22 | { | ||
40 | 23 | - int minCode, maxCode; | ||
41 | 24 | - XDisplayKeycodes (screen->dpy(), &minCode, &maxCode); | ||
42 | 25 | for (k = minCode; k <= maxCode; k++) | ||
43 | 26 | grabUngrabOneKey (modifiers | modifierForKeycode | ignore, k, grab); | ||
44 | 27 | } | ||
45 | 28 | 0 | ||
46 | === modified file 'include/core/abiversion.h' | |||
47 | --- include/core/abiversion.h 2015-10-20 22:44:20 +0000 | |||
48 | +++ include/core/abiversion.h 2015-10-20 22:44:20 +0000 | |||
49 | @@ -5,6 +5,6 @@ | |||
50 | 5 | # error Conflicting definitions of CORE_ABIVERSION | 5 | # error Conflicting definitions of CORE_ABIVERSION |
51 | 6 | #endif | 6 | #endif |
52 | 7 | 7 | ||
54 | 8 | #define CORE_ABIVERSION 20150918 | 8 | #define CORE_ABIVERSION 20151010 |
55 | 9 | 9 | ||
56 | 10 | #endif // COMPIZ_ABIVERSION_H | 10 | #endif // COMPIZ_ABIVERSION_H |
57 | 11 | 11 | ||
58 | === modified file 'include/core/screen.h' | |||
59 | --- include/core/screen.h 2015-10-20 22:44:20 +0000 | |||
60 | +++ include/core/screen.h 2015-10-20 22:44:20 +0000 | |||
61 | @@ -155,6 +155,7 @@ | |||
62 | 155 | virtual void outputChangeNotify (); | 155 | virtual void outputChangeNotify (); |
63 | 156 | virtual void addSupportedAtoms (std::vector<Atom>& atoms); | 156 | virtual void addSupportedAtoms (std::vector<Atom>& atoms); |
64 | 157 | 157 | ||
65 | 158 | virtual void cursorChangeNotify (const CompString& theme, int size); | ||
66 | 158 | }; | 159 | }; |
67 | 159 | 160 | ||
68 | 160 | namespace compiz { namespace private_screen { | 161 | namespace compiz { namespace private_screen { |
69 | @@ -217,7 +218,7 @@ | |||
70 | 217 | } | 218 | } |
71 | 218 | 219 | ||
72 | 219 | class CompScreen : | 220 | class CompScreen : |
74 | 220 | public WrapableHandler<ScreenInterface, 18>, | 221 | public WrapableHandler<ScreenInterface, 19>, |
75 | 221 | public PluginClassStorage, // TODO should be an interface here | 222 | public PluginClassStorage, // TODO should be an interface here |
76 | 222 | public CompSize, | 223 | public CompSize, |
77 | 223 | public virtual ::compiz::DesktopWindowCount, | 224 | public virtual ::compiz::DesktopWindowCount, |
78 | @@ -267,6 +268,8 @@ | |||
79 | 267 | WRAPABLE_HND (16, ScreenInterface, void, outputChangeNotify); | 268 | WRAPABLE_HND (16, ScreenInterface, void, outputChangeNotify); |
80 | 268 | WRAPABLE_HND (17, ScreenInterface, void, addSupportedAtoms, | 269 | WRAPABLE_HND (17, ScreenInterface, void, addSupportedAtoms, |
81 | 269 | std::vector<Atom>& atoms); | 270 | std::vector<Atom>& atoms); |
82 | 271 | WRAPABLE_HND (18, ScreenInterface, void, cursorChangeNotify, | ||
83 | 272 | const CompString&, int); | ||
84 | 270 | 273 | ||
85 | 271 | unsigned int allocPluginClassIndex (); | 274 | unsigned int allocPluginClassIndex (); |
86 | 272 | void freePluginClassIndex (unsigned int index); | 275 | void freePluginClassIndex (unsigned int index); |
87 | @@ -392,6 +395,7 @@ | |||
88 | 392 | virtual const char * displayString () = 0; | 395 | virtual const char * displayString () = 0; |
89 | 393 | virtual CompRect getCurrentOutputExtents () = 0; | 396 | virtual CompRect getCurrentOutputExtents () = 0; |
90 | 394 | virtual Cursor normalCursor () = 0; | 397 | virtual Cursor normalCursor () = 0; |
91 | 398 | virtual Cursor cursorCache (unsigned int cursorName) = 0; | ||
92 | 395 | virtual bool grabbed () = 0; | 399 | virtual bool grabbed () = 0; |
93 | 396 | virtual SnDisplay * snDisplay () = 0; | 400 | virtual SnDisplay * snDisplay () = 0; |
94 | 397 | 401 | ||
95 | @@ -445,6 +449,7 @@ | |||
96 | 445 | virtual void _matchExpHandlerChanged() = 0; | 449 | virtual void _matchExpHandlerChanged() = 0; |
97 | 446 | virtual void _matchPropertyChanged(CompWindow *) = 0; | 450 | virtual void _matchPropertyChanged(CompWindow *) = 0; |
98 | 447 | virtual void _outputChangeNotify() = 0; | 451 | virtual void _outputChangeNotify() = 0; |
99 | 452 | virtual void _cursorChangeNotify(const CompString&, int) = 0; | ||
100 | 448 | }; | 453 | }; |
101 | 449 | 454 | ||
102 | 450 | #endif | 455 | #endif |
103 | 451 | 456 | ||
104 | === modified file 'plugins/expo/src/expo.cpp' | |||
105 | --- plugins/expo/src/expo.cpp 2015-04-10 21:55:21 +0000 | |||
106 | +++ plugins/expo/src/expo.cpp 2015-10-20 22:44:20 +0000 | |||
107 | @@ -610,7 +610,7 @@ | |||
108 | 610 | CompWindowGrabMoveMask | | 610 | CompWindowGrabMoveMask | |
109 | 611 | CompWindowGrabButtonMask); | 611 | CompWindowGrabButtonMask); |
110 | 612 | 612 | ||
112 | 613 | screen->updateGrab (grabIndex, dragCursor); | 613 | screen->updateGrab (grabIndex, screen->cursorCache (XC_fleur)); |
113 | 614 | 614 | ||
114 | 615 | w->raise (); | 615 | w->raise (); |
115 | 616 | w->moveInputFocusTo (); | 616 | w->moveInputFocusTo (); |
116 | @@ -1578,8 +1578,6 @@ | |||
117 | 1578 | upKey = XKeysymToKeycode (s->dpy (), XStringToKeysym ("Up")); | 1578 | upKey = XKeysymToKeycode (s->dpy (), XStringToKeysym ("Up")); |
118 | 1579 | downKey = XKeysymToKeycode (s->dpy (), XStringToKeysym ("Down")); | 1579 | downKey = XKeysymToKeycode (s->dpy (), XStringToKeysym ("Down")); |
119 | 1580 | 1580 | ||
120 | 1581 | dragCursor = XCreateFontCursor (screen->dpy (), XC_fleur); | ||
121 | 1582 | |||
122 | 1583 | EXPOINITBIND (ExpoKey, doExpo); | 1581 | EXPOINITBIND (ExpoKey, doExpo); |
123 | 1584 | EXPOTERMBIND (ExpoKey, termExpo); | 1582 | EXPOTERMBIND (ExpoKey, termExpo); |
124 | 1585 | EXPOINITBIND (ExpoButton, doExpo); | 1583 | EXPOINITBIND (ExpoButton, doExpo); |
125 | @@ -1603,11 +1601,6 @@ | |||
126 | 1603 | GL_RGBA, GL_UNSIGNED_BYTE); | 1601 | GL_RGBA, GL_UNSIGNED_BYTE); |
127 | 1604 | } | 1602 | } |
128 | 1605 | 1603 | ||
129 | 1606 | ExpoScreen::~ExpoScreen () | ||
130 | 1607 | { | ||
131 | 1608 | if (dragCursor != None) | ||
132 | 1609 | XFreeCursor (screen->dpy (), dragCursor); | ||
133 | 1610 | } | ||
134 | 1611 | 1604 | ||
135 | 1612 | ExpoWindow::ExpoWindow (CompWindow *w) : | 1605 | ExpoWindow::ExpoWindow (CompWindow *w) : |
136 | 1613 | PluginClassHandler<ExpoWindow, CompWindow> (w), | 1606 | PluginClassHandler<ExpoWindow, CompWindow> (w), |
137 | 1614 | 1607 | ||
138 | === modified file 'plugins/expo/src/expo.h' | |||
139 | --- plugins/expo/src/expo.h 2013-07-14 10:38:09 +0000 | |||
140 | +++ plugins/expo/src/expo.h 2015-10-20 22:44:20 +0000 | |||
141 | @@ -42,7 +42,6 @@ | |||
142 | 42 | public: | 42 | public: |
143 | 43 | 43 | ||
144 | 44 | ExpoScreen (CompScreen *); | 44 | ExpoScreen (CompScreen *); |
145 | 45 | ~ExpoScreen (); | ||
146 | 46 | 45 | ||
147 | 47 | void handleEvent (XEvent *); | 46 | void handleEvent (XEvent *); |
148 | 48 | 47 | ||
149 | @@ -153,8 +152,6 @@ | |||
150 | 153 | KeyCode rightKey; | 152 | KeyCode rightKey; |
151 | 154 | KeyCode upKey; | 153 | KeyCode upKey; |
152 | 155 | KeyCode downKey; | 154 | KeyCode downKey; |
153 | 156 | |||
154 | 157 | Cursor dragCursor; | ||
155 | 158 | }; | 155 | }; |
156 | 159 | 156 | ||
157 | 160 | class ExpoWindow : | 157 | class ExpoWindow : |
158 | 161 | 158 | ||
159 | === modified file 'plugins/freewins/src/action.cpp' | |||
160 | --- plugins/freewins/src/action.cpp 2013-03-26 22:02:39 +0000 | |||
161 | +++ plugins/freewins/src/action.cpp 2015-10-20 22:44:20 +0000 | |||
162 | @@ -82,8 +82,6 @@ | |||
163 | 82 | useW = getRealWindow (w); | 82 | useW = getRealWindow (w); |
164 | 83 | } | 83 | } |
165 | 84 | 84 | ||
166 | 85 | mRotateCursor = XCreateFontCursor (screen->dpy (), XC_fleur); | ||
167 | 86 | |||
168 | 87 | if (!screen->otherGrabExist ("freewins", 0)) | 85 | if (!screen->otherGrabExist ("freewins", 0)) |
169 | 88 | if (!mGrabIndex) | 86 | if (!mGrabIndex) |
170 | 89 | { | 87 | { |
171 | @@ -305,11 +303,9 @@ | |||
172 | 305 | useW = getRealWindow (w); | 303 | useW = getRealWindow (w); |
173 | 306 | } | 304 | } |
174 | 307 | 305 | ||
175 | 308 | mRotateCursor = XCreateFontCursor (screen->dpy (), XC_fleur); | ||
176 | 309 | |||
177 | 310 | if (!screen->otherGrabExist ("freewins", 0)) | 306 | if (!screen->otherGrabExist ("freewins", 0)) |
178 | 311 | if (!mGrabIndex) | 307 | if (!mGrabIndex) |
180 | 312 | mGrabIndex = screen->pushGrab (mRotateCursor, "freewins"); | 308 | mGrabIndex = screen->pushGrab (screen->cursorCache(XC_fleur), "freewins"); |
181 | 313 | } | 309 | } |
182 | 314 | 310 | ||
183 | 315 | if (useW) | 311 | if (useW) |
184 | 316 | 312 | ||
185 | === modified file 'plugins/freewins/src/events.cpp' | |||
186 | --- plugins/freewins/src/events.cpp 2013-03-26 22:02:39 +0000 | |||
187 | +++ plugins/freewins/src/events.cpp 2015-10-20 22:44:20 +0000 | |||
188 | @@ -60,13 +60,12 @@ | |||
189 | 60 | 60 | ||
190 | 61 | window->activate (); | 61 | window->activate (); |
191 | 62 | mGrab = grabResize; | 62 | mGrab = grabResize; |
192 | 63 | fws->mRotateCursor = XCreateFontCursor (screen->dpy (), XC_plus); | ||
193 | 64 | if(!screen->otherGrabExist ("freewins", "resize", 0)) | 63 | if(!screen->otherGrabExist ("freewins", "resize", 0)) |
194 | 65 | if(!fws->mGrabIndex) | 64 | if(!fws->mGrabIndex) |
195 | 66 | { | 65 | { |
196 | 67 | unsigned int mods = 0; | 66 | unsigned int mods = 0; |
197 | 68 | mods &= CompNoMask; | 67 | mods &= CompNoMask; |
199 | 69 | fws->mGrabIndex = screen->pushGrab (fws->mRotateCursor, "resize"); | 68 | fws->mGrabIndex = screen->pushGrab (screen->cursorCache (XC_plus), "resize"); |
200 | 70 | window->grabNotify (window->x () + (window->width () / 2), | 69 | window->grabNotify (window->x () + (window->width () / 2), |
201 | 71 | window->y () + (window->height () / 2), mods, | 70 | window->y () + (window->height () / 2), mods, |
202 | 72 | CompWindowGrabMoveMask | CompWindowGrabButtonMask); | 71 | CompWindowGrabMoveMask | CompWindowGrabButtonMask); |
203 | @@ -81,13 +80,12 @@ | |||
204 | 81 | 80 | ||
205 | 82 | window->activate (); | 81 | window->activate (); |
206 | 83 | mGrab = grabMove; | 82 | mGrab = grabMove; |
207 | 84 | fws->mRotateCursor = XCreateFontCursor (screen->dpy (), XC_fleur); | ||
208 | 85 | if(!screen->otherGrabExist ("freewins", "resize", 0)) | 83 | if(!screen->otherGrabExist ("freewins", "resize", 0)) |
209 | 86 | if(!fws->mGrabIndex) | 84 | if(!fws->mGrabIndex) |
210 | 87 | { | 85 | { |
211 | 88 | unsigned int mods = 0; | 86 | unsigned int mods = 0; |
212 | 89 | mods &= CompNoMask; | 87 | mods &= CompNoMask; |
214 | 90 | fws->mGrabIndex = screen->pushGrab (fws->mRotateCursor, "resize"); | 88 | fws->mGrabIndex = screen->pushGrab (screen->cursorCache (XC_fleur), "resize"); |
215 | 91 | window->grabNotify (window->x () + (window->width () / 2), | 89 | window->grabNotify (window->x () + (window->width () / 2), |
216 | 92 | window->y () + (window->height () / 2), mods, | 90 | window->y () + (window->height () / 2), mods, |
217 | 93 | CompWindowGrabResizeMask | CompWindowGrabButtonMask); | 91 | CompWindowGrabResizeMask | CompWindowGrabButtonMask); |
218 | 94 | 92 | ||
219 | === modified file 'plugins/freewins/src/freewins.h' | |||
220 | --- plugins/freewins/src/freewins.h 2013-02-20 14:24:30 +0000 | |||
221 | +++ plugins/freewins/src/freewins.h 2015-10-20 22:44:20 +0000 | |||
222 | @@ -281,8 +281,6 @@ | |||
223 | 281 | int mSnapMask; | 281 | int mSnapMask; |
224 | 282 | int mInvertMask; | 282 | int mInvertMask; |
225 | 283 | 283 | ||
226 | 284 | Cursor mRotateCursor; | ||
227 | 285 | |||
228 | 286 | CompScreen::GrabHandle mGrabIndex; | 284 | CompScreen::GrabHandle mGrabIndex; |
229 | 287 | 285 | ||
230 | 288 | void preparePaint (int); | 286 | void preparePaint (int); |
231 | 289 | 287 | ||
232 | === modified file 'plugins/move/src/move.cpp' | |||
233 | --- plugins/move/src/move.cpp 2015-10-20 22:44:20 +0000 | |||
234 | +++ plugins/move/src/move.cpp 2015-10-20 22:44:20 +0000 | |||
235 | @@ -105,10 +105,12 @@ | |||
236 | 105 | 105 | ||
237 | 106 | if (!ms->grab) | 106 | if (!ms->grab) |
238 | 107 | { | 107 | { |
239 | 108 | Cursor moveCursor = screen->cursorCache (XC_fleur); | ||
240 | 109 | |||
241 | 108 | if (state & CompAction::StateInitButton) | 110 | if (state & CompAction::StateInitButton) |
243 | 109 | ms->grab = s->pushPointerGrab (ms->moveCursor, "move"); | 111 | ms->grab = s->pushPointerGrab (moveCursor, "move"); |
244 | 110 | else | 112 | else |
246 | 111 | ms->grab = s->pushGrab (ms->moveCursor, "move"); | 113 | ms->grab = s->pushGrab (moveCursor, "move"); |
247 | 112 | } | 114 | } |
248 | 113 | 115 | ||
249 | 114 | if (ms->grab) | 116 | if (ms->grab) |
250 | @@ -716,7 +718,6 @@ | |||
251 | 716 | key[i] = XKeysymToKeycode (screen->dpy (), | 718 | key[i] = XKeysymToKeycode (screen->dpy (), |
252 | 717 | XStringToKeysym (mKeys[i].name)); | 719 | XStringToKeysym (mKeys[i].name)); |
253 | 718 | 720 | ||
254 | 719 | moveCursor = XCreateFontCursor (screen->dpy (), XC_fleur); | ||
255 | 720 | if (cScreen) | 721 | if (cScreen) |
256 | 721 | { | 722 | { |
257 | 722 | CompositeScreenInterface::setHandler (cScreen); | 723 | CompositeScreenInterface::setHandler (cScreen); |
258 | @@ -739,9 +740,6 @@ | |||
259 | 739 | { | 740 | { |
260 | 740 | if (region) | 741 | if (region) |
261 | 741 | XDestroyRegion (region); | 742 | XDestroyRegion (region); |
262 | 742 | |||
263 | 743 | if (moveCursor) | ||
264 | 744 | XFreeCursor (screen->dpy (), moveCursor); | ||
265 | 745 | } | 743 | } |
266 | 746 | 744 | ||
267 | 747 | bool | 745 | bool |
268 | 748 | 746 | ||
269 | === modified file 'plugins/move/src/move.h' | |||
270 | --- plugins/move/src/move.h 2013-04-13 21:59:11 +0000 | |||
271 | +++ plugins/move/src/move.h 2015-10-20 22:44:20 +0000 | |||
272 | @@ -82,8 +82,6 @@ | |||
273 | 82 | 82 | ||
274 | 83 | CompScreen::GrabHandle grab; | 83 | CompScreen::GrabHandle grab; |
275 | 84 | 84 | ||
276 | 85 | Cursor moveCursor; | ||
277 | 86 | |||
278 | 87 | unsigned int origState; | 85 | unsigned int origState; |
279 | 88 | 86 | ||
280 | 89 | int snapOffX; | 87 | int snapOffX; |
281 | 90 | 88 | ||
282 | === modified file 'plugins/resize/src/logic/include/resize-logic.h' | |||
283 | --- plugins/resize/src/logic/include/resize-logic.h 2014-05-28 07:08:10 +0000 | |||
284 | +++ plugins/resize/src/logic/include/resize-logic.h 2015-10-20 22:44:20 +0000 | |||
285 | @@ -113,20 +113,10 @@ | |||
286 | 113 | int pointerDx; | 113 | int pointerDx; |
287 | 114 | int pointerDy; | 114 | int pointerDy; |
288 | 115 | KeyCode key[NUM_KEYS]; | 115 | KeyCode key[NUM_KEYS]; |
289 | 116 | unsigned int keyCursorNames[NUM_KEYS]; | ||
290 | 116 | 117 | ||
291 | 117 | CompScreen::GrabHandle grabIndex; | 118 | CompScreen::GrabHandle grabIndex; |
292 | 118 | 119 | ||
293 | 119 | Cursor leftCursor; | ||
294 | 120 | Cursor rightCursor; | ||
295 | 121 | Cursor upCursor; | ||
296 | 122 | Cursor upLeftCursor; | ||
297 | 123 | Cursor upRightCursor; | ||
298 | 124 | Cursor downCursor; | ||
299 | 125 | Cursor downLeftCursor; | ||
300 | 126 | Cursor downRightCursor; | ||
301 | 127 | Cursor middleCursor; | ||
302 | 128 | Cursor cursor[NUM_KEYS]; | ||
303 | 129 | |||
304 | 130 | bool isConstrained; | 120 | bool isConstrained; |
305 | 131 | CompRegion constraintRegion; | 121 | CompRegion constraintRegion; |
306 | 132 | bool inRegionStatus; | 122 | bool inRegionStatus; |
307 | 133 | 123 | ||
308 | === modified file 'plugins/resize/src/logic/include/screen-interface.h' | |||
309 | --- plugins/resize/src/logic/include/screen-interface.h 2015-10-20 22:44:20 +0000 | |||
310 | +++ plugins/resize/src/logic/include/screen-interface.h 2015-10-20 22:44:20 +0000 | |||
311 | @@ -59,6 +59,7 @@ | |||
312 | 59 | virtual CompScreen::GrabHandle pushPointerGrab (Cursor cursor, const char *name) = 0; | 59 | virtual CompScreen::GrabHandle pushPointerGrab (Cursor cursor, const char *name) = 0; |
313 | 60 | virtual CompScreen::GrabHandle pushKeyboardGrab (const char *name) = 0; | 60 | virtual CompScreen::GrabHandle pushKeyboardGrab (const char *name) = 0; |
314 | 61 | virtual void removeGrab (CompScreen::GrabHandle handle, CompPoint *restorePointer) = 0; | 61 | virtual void removeGrab (CompScreen::GrabHandle handle, CompPoint *restorePointer) = 0; |
315 | 62 | virtual Cursor cursorCache (unsigned int cursorName) = 0; | ||
316 | 62 | 63 | ||
317 | 63 | /* CompOption::Class */ | 64 | /* CompOption::Class */ |
318 | 64 | virtual CompOption * getOption (const CompString &name) = 0; | 65 | virtual CompOption * getOption (const CompString &name) = 0; |
319 | 65 | 66 | ||
320 | === modified file 'plugins/resize/src/logic/src/resize-logic.cpp' | |||
321 | --- plugins/resize/src/logic/src/resize-logic.cpp 2015-10-20 22:44:20 +0000 | |||
322 | +++ plugins/resize/src/logic/src/resize-logic.cpp 2015-10-20 22:44:20 +0000 | |||
323 | @@ -27,6 +27,7 @@ | |||
324 | 27 | 27 | ||
325 | 28 | #include <core/core.h> | 28 | #include <core/core.h> |
326 | 29 | #include <core/atoms.h> | 29 | #include <core/atoms.h> |
327 | 30 | #include <X11/cursorfont.h> | ||
328 | 30 | 31 | ||
329 | 31 | #include "resize-logic.h" | 32 | #include "resize-logic.h" |
330 | 32 | 33 | ||
331 | @@ -48,6 +49,16 @@ | |||
332 | 48 | static const unsigned short TOUCH_TOP = 3; | 49 | static const unsigned short TOUCH_TOP = 3; |
333 | 49 | static const unsigned short TOUCH_BOTTOM = 4; | 50 | static const unsigned short TOUCH_BOTTOM = 4; |
334 | 50 | 51 | ||
335 | 52 | #define LEFT_CURSOR XC_left_side | ||
336 | 53 | #define RIGHT_CURSOR XC_right_side | ||
337 | 54 | #define UP_CURSOR XC_top_side | ||
338 | 55 | #define UP_LEFT_CURSOR XC_top_left_corner | ||
339 | 56 | #define UP_RIGHT_CURSOR XC_top_right_corner | ||
340 | 57 | #define DOWN_CURSOR XC_bottom_side | ||
341 | 58 | #define DOWN_LEFT_CURSOR XC_bottom_left_corner | ||
342 | 59 | #define DOWN_RIGHT_CURSOR XC_bottom_right_corner | ||
343 | 60 | #define MIDDLE_CURSOR XC_fleur | ||
344 | 61 | |||
345 | 51 | using namespace resize; | 62 | using namespace resize; |
346 | 52 | 63 | ||
347 | 53 | ResizeLogic::ResizeLogic() : | 64 | ResizeLogic::ResizeLogic() : |
348 | @@ -428,7 +439,7 @@ | |||
349 | 428 | lastMaskY = mask; | 439 | lastMaskY = mask; |
350 | 429 | } | 440 | } |
351 | 430 | 441 | ||
353 | 431 | mScreen->updateGrab (grabIndex, cursor[i]); | 442 | mScreen->updateGrab (grabIndex, screen->cursorCache (keyCursorNames[i])); |
354 | 432 | } | 443 | } |
355 | 433 | break; | 444 | break; |
356 | 434 | } | 445 | } |
357 | @@ -652,36 +663,36 @@ | |||
358 | 652 | Cursor | 663 | Cursor |
359 | 653 | ResizeLogic::cursorFromResizeMask (unsigned int mask) | 664 | ResizeLogic::cursorFromResizeMask (unsigned int mask) |
360 | 654 | { | 665 | { |
362 | 655 | Cursor cursor; | 666 | unsigned int cursor_name; |
363 | 656 | 667 | ||
364 | 657 | if (mask & ResizeLeftMask) | 668 | if (mask & ResizeLeftMask) |
365 | 658 | { | 669 | { |
366 | 659 | if (mask & ResizeDownMask) | 670 | if (mask & ResizeDownMask) |
368 | 660 | cursor = downLeftCursor; | 671 | cursor_name = DOWN_LEFT_CURSOR; |
369 | 661 | else if (mask & ResizeUpMask) | 672 | else if (mask & ResizeUpMask) |
371 | 662 | cursor = upLeftCursor; | 673 | cursor_name = UP_LEFT_CURSOR; |
372 | 663 | else | 674 | else |
374 | 664 | cursor = leftCursor; | 675 | cursor_name = LEFT_CURSOR; |
375 | 665 | } | 676 | } |
376 | 666 | else if (mask & ResizeRightMask) | 677 | else if (mask & ResizeRightMask) |
377 | 667 | { | 678 | { |
378 | 668 | if (mask & ResizeDownMask) | 679 | if (mask & ResizeDownMask) |
380 | 669 | cursor = downRightCursor; | 680 | cursor_name = DOWN_RIGHT_CURSOR; |
381 | 670 | else if (mask & ResizeUpMask) | 681 | else if (mask & ResizeUpMask) |
383 | 671 | cursor = upRightCursor; | 682 | cursor_name = UP_RIGHT_CURSOR; |
384 | 672 | else | 683 | else |
386 | 673 | cursor = rightCursor; | 684 | cursor_name = RIGHT_CURSOR; |
387 | 674 | } | 685 | } |
388 | 675 | else if (mask & ResizeUpMask) | 686 | else if (mask & ResizeUpMask) |
389 | 676 | { | 687 | { |
391 | 677 | cursor = upCursor; | 688 | cursor_name = UP_CURSOR; |
392 | 678 | } | 689 | } |
393 | 679 | else | 690 | else |
394 | 680 | { | 691 | { |
396 | 681 | cursor = downCursor; | 692 | cursor_name = DOWN_CURSOR; |
397 | 682 | } | 693 | } |
398 | 683 | 694 | ||
400 | 684 | return cursor; | 695 | return screen->cursorCache (cursor_name); |
401 | 685 | } | 696 | } |
402 | 686 | 697 | ||
403 | 687 | void | 698 | void |
404 | @@ -1327,7 +1338,7 @@ | |||
405 | 1327 | Cursor cursor; | 1338 | Cursor cursor; |
406 | 1328 | 1339 | ||
407 | 1329 | if (state & CompAction::StateInitKey) | 1340 | if (state & CompAction::StateInitKey) |
409 | 1330 | cursor = middleCursor; | 1341 | cursor = screen->cursorCache (MIDDLE_CURSOR); |
410 | 1331 | else | 1342 | else |
411 | 1332 | cursor = cursorFromResizeMask (mask); | 1343 | cursor = cursorFromResizeMask (mask); |
412 | 1333 | 1344 | ||
413 | 1334 | 1345 | ||
414 | === modified file 'plugins/resize/src/logic/tests/mock-screen.h' | |||
415 | --- plugins/resize/src/logic/tests/mock-screen.h 2015-10-20 22:44:20 +0000 | |||
416 | +++ plugins/resize/src/logic/tests/mock-screen.h 2015-10-20 22:44:20 +0000 | |||
417 | @@ -54,6 +54,7 @@ | |||
418 | 54 | MOCK_METHOD2(pushPointerGrab, CompScreen::GrabHandle(Cursor cursor, const char *name)); | 54 | MOCK_METHOD2(pushPointerGrab, CompScreen::GrabHandle(Cursor cursor, const char *name)); |
419 | 55 | MOCK_METHOD1(pushKeyboardGrab, CompScreen::GrabHandle(const char *name)); | 55 | MOCK_METHOD1(pushKeyboardGrab, CompScreen::GrabHandle(const char *name)); |
420 | 56 | MOCK_METHOD2(removeGrab, void(CompScreen::GrabHandle handle, CompPoint *restorePointer)); | 56 | MOCK_METHOD2(removeGrab, void(CompScreen::GrabHandle handle, CompPoint *restorePointer)); |
421 | 57 | MOCK_METHOD1(cursorCache, Cursor (unsigned int)); | ||
422 | 57 | 58 | ||
423 | 58 | MOCK_METHOD1(getOption, CompOption*(const CompString &name)); | 59 | MOCK_METHOD1(getOption, CompOption*(const CompString &name)); |
424 | 59 | 60 | ||
425 | 60 | 61 | ||
426 | === modified file 'plugins/resize/src/resize.cpp' | |||
427 | --- plugins/resize/src/resize.cpp 2013-05-15 10:23:30 +0000 | |||
428 | +++ plugins/resize/src/resize.cpp 2015-10-20 22:44:20 +0000 | |||
429 | @@ -380,7 +380,6 @@ | |||
430 | 380 | logic.options = this; | 380 | logic.options = this; |
431 | 381 | 381 | ||
432 | 382 | CompOption::Vector atomTemplate; | 382 | CompOption::Vector atomTemplate; |
433 | 383 | Display *dpy = s->dpy (); | ||
434 | 384 | ResizeOptions::ChangeNotify notify = | 383 | ResizeOptions::ChangeNotify notify = |
435 | 385 | boost::bind (&ResizeScreen::optionChanged, this, _1, _2); | 384 | boost::bind (&ResizeScreen::optionChanged, this, _1, _2); |
436 | 386 | 385 | ||
437 | @@ -404,21 +403,6 @@ | |||
438 | 404 | for (unsigned int i = 0; i < NUM_KEYS; i++) | 403 | for (unsigned int i = 0; i < NUM_KEYS; i++) |
439 | 405 | logic.key[i] = XKeysymToKeycode (s->dpy (), XStringToKeysym (logic.rKeys[i].name)); | 404 | logic.key[i] = XKeysymToKeycode (s->dpy (), XStringToKeysym (logic.rKeys[i].name)); |
440 | 406 | 405 | ||
441 | 407 | logic.leftCursor = XCreateFontCursor (dpy, XC_left_side); | ||
442 | 408 | logic.rightCursor = XCreateFontCursor (dpy, XC_right_side); | ||
443 | 409 | logic.upCursor = XCreateFontCursor (dpy, XC_top_side); | ||
444 | 410 | logic.upLeftCursor = XCreateFontCursor (dpy, XC_top_left_corner); | ||
445 | 411 | logic.upRightCursor = XCreateFontCursor (dpy, XC_top_right_corner); | ||
446 | 412 | logic.downCursor = XCreateFontCursor (dpy, XC_bottom_side); | ||
447 | 413 | logic.downLeftCursor = XCreateFontCursor (dpy, XC_bottom_left_corner); | ||
448 | 414 | logic.downRightCursor = XCreateFontCursor (dpy, XC_bottom_right_corner); | ||
449 | 415 | logic.middleCursor = XCreateFontCursor (dpy, XC_fleur); | ||
450 | 416 | |||
451 | 417 | logic.cursor[0] = logic.leftCursor; | ||
452 | 418 | logic.cursor[1] = logic.rightCursor; | ||
453 | 419 | logic.cursor[2] = logic.upCursor; | ||
454 | 420 | logic.cursor[3] = logic.downCursor; | ||
455 | 421 | |||
456 | 422 | optionSetInitiateKeyInitiate (resizeInitiateDefaultMode); | 406 | optionSetInitiateKeyInitiate (resizeInitiateDefaultMode); |
457 | 423 | optionSetInitiateKeyTerminate (resizeTerminate); | 407 | optionSetInitiateKeyTerminate (resizeTerminate); |
458 | 424 | optionSetInitiateButtonInitiate (resizeInitiateDefaultMode); | 408 | optionSetInitiateButtonInitiate (resizeInitiateDefaultMode); |
459 | @@ -442,27 +426,6 @@ | |||
460 | 442 | 426 | ||
461 | 443 | ResizeScreen::~ResizeScreen () | 427 | ResizeScreen::~ResizeScreen () |
462 | 444 | { | 428 | { |
463 | 445 | Display *dpy = screen->dpy (); | ||
464 | 446 | |||
465 | 447 | if (logic.leftCursor) | ||
466 | 448 | XFreeCursor (dpy, logic.leftCursor); | ||
467 | 449 | if (logic.rightCursor) | ||
468 | 450 | XFreeCursor (dpy, logic.rightCursor); | ||
469 | 451 | if (logic.upCursor) | ||
470 | 452 | XFreeCursor (dpy, logic.upCursor); | ||
471 | 453 | if (logic.downCursor) | ||
472 | 454 | XFreeCursor (dpy, logic.downCursor); | ||
473 | 455 | if (logic.middleCursor) | ||
474 | 456 | XFreeCursor (dpy, logic.middleCursor); | ||
475 | 457 | if (logic.upLeftCursor) | ||
476 | 458 | XFreeCursor (dpy, logic.upLeftCursor); | ||
477 | 459 | if (logic.upRightCursor) | ||
478 | 460 | XFreeCursor (dpy, logic.upRightCursor); | ||
479 | 461 | if (logic.downLeftCursor) | ||
480 | 462 | XFreeCursor (dpy, logic.downLeftCursor); | ||
481 | 463 | if (logic.downRightCursor) | ||
482 | 464 | XFreeCursor (dpy, logic.downRightCursor); | ||
483 | 465 | |||
484 | 466 | delete logic.mScreen; | 429 | delete logic.mScreen; |
485 | 467 | delete logic.cScreen; | 430 | delete logic.cScreen; |
486 | 468 | delete logic.gScreen; | 431 | delete logic.gScreen; |
487 | 469 | 432 | ||
488 | === modified file 'plugins/resize/src/screen-impl.h' | |||
489 | --- plugins/resize/src/screen-impl.h 2015-10-20 22:44:20 +0000 | |||
490 | +++ plugins/resize/src/screen-impl.h 2015-10-20 22:44:20 +0000 | |||
491 | @@ -134,6 +134,11 @@ | |||
492 | 134 | return mImpl->height (); | 134 | return mImpl->height (); |
493 | 135 | } | 135 | } |
494 | 136 | 136 | ||
495 | 137 | virtual Cursor cursorCache (unsigned int cursorName) | ||
496 | 138 | { | ||
497 | 139 | return mImpl->cursorCache (cursorName); | ||
498 | 140 | } | ||
499 | 141 | |||
500 | 137 | private: | 142 | private: |
501 | 138 | CompScreen *mImpl; | 143 | CompScreen *mImpl; |
502 | 139 | }; | 144 | }; |
503 | 140 | 145 | ||
504 | === modified file 'plugins/shelf/src/shelf.cpp' | |||
505 | --- plugins/shelf/src/shelf.cpp 2013-05-09 13:43:07 +0000 | |||
506 | +++ plugins/shelf/src/shelf.cpp 2015-10-20 22:44:20 +0000 | |||
507 | @@ -509,7 +509,7 @@ | |||
508 | 509 | { | 509 | { |
509 | 510 | window->activate (); | 510 | window->activate (); |
510 | 511 | ss->grabbedWindow = window->id (); | 511 | ss->grabbedWindow = window->id (); |
512 | 512 | ss->grabIndex = screen->pushGrab (ss->moveCursor, "shelf"); | 512 | ss->grabIndex = screen->pushGrab (screen->cursorCache (XC_fleur), "shelf"); |
513 | 513 | 513 | ||
514 | 514 | ss->lastPointerX = x; | 514 | ss->lastPointerX = x; |
515 | 515 | ss->lastPointerY = y; | 515 | ss->lastPointerY = y; |
516 | @@ -760,7 +760,6 @@ | |||
517 | 760 | gScreen (GLScreen::get (screen)), | 760 | gScreen (GLScreen::get (screen)), |
518 | 761 | grabIndex (0), | 761 | grabIndex (0), |
519 | 762 | grabbedWindow (None), | 762 | grabbedWindow (None), |
520 | 763 | moveCursor (XCreateFontCursor (screen->dpy (), XC_fleur)), | ||
521 | 764 | lastPointerX (0), | 763 | lastPointerX (0), |
522 | 765 | lastPointerY (0) | 764 | lastPointerY (0) |
523 | 766 | { | 765 | { |
524 | @@ -780,11 +779,6 @@ | |||
525 | 780 | _3)); | 779 | _3)); |
526 | 781 | } | 780 | } |
527 | 782 | 781 | ||
528 | 783 | ShelfScreen::~ShelfScreen () | ||
529 | 784 | { | ||
530 | 785 | if (moveCursor) | ||
531 | 786 | XFreeCursor (screen->dpy (), moveCursor); | ||
532 | 787 | } | ||
533 | 788 | 782 | ||
534 | 789 | ShelfWindow::ShelfWindow (CompWindow *window) : | 783 | ShelfWindow::ShelfWindow (CompWindow *window) : |
535 | 790 | PluginClassHandler <ShelfWindow, CompWindow> (window), | 784 | PluginClassHandler <ShelfWindow, CompWindow> (window), |
536 | 791 | 785 | ||
537 | === modified file 'plugins/shelf/src/shelf.h' | |||
538 | --- plugins/shelf/src/shelf.h 2012-09-07 23:29:42 +0000 | |||
539 | +++ plugins/shelf/src/shelf.h 2015-10-20 22:44:20 +0000 | |||
540 | @@ -145,7 +145,6 @@ | |||
541 | 145 | public: | 145 | public: |
542 | 146 | 146 | ||
543 | 147 | ShelfScreen (CompScreen *); | 147 | ShelfScreen (CompScreen *); |
544 | 148 | ~ShelfScreen (); | ||
545 | 149 | 148 | ||
546 | 150 | CompositeScreen *cScreen; | 149 | CompositeScreen *cScreen; |
547 | 151 | GLScreen *gScreen; | 150 | GLScreen *gScreen; |
548 | 152 | 151 | ||
549 | === modified file 'plugins/shift/src/shift.cpp' | |||
550 | --- plugins/shift/src/shift.cpp 2013-05-11 09:30:49 +0000 | |||
551 | +++ plugins/shift/src/shift.cpp 2015-10-20 22:44:20 +0000 | |||
552 | @@ -1968,7 +1968,6 @@ | |||
553 | 1968 | mMvTarget (0), | 1968 | mMvTarget (0), |
554 | 1969 | mMvVelocity (0), | 1969 | mMvVelocity (0), |
555 | 1970 | mInvert (false), | 1970 | mInvert (false), |
556 | 1971 | mCursor (XCreateFontCursor (screen->dpy (), XC_left_ptr)), | ||
557 | 1972 | mWindows (NULL), | 1971 | mWindows (NULL), |
558 | 1973 | mNWindows (0), | 1972 | mNWindows (0), |
559 | 1974 | mWindowsSize (0), | 1973 | mWindowsSize (0), |
560 | @@ -2059,8 +2058,6 @@ | |||
561 | 2059 | { | 2058 | { |
562 | 2060 | freeWindowTitle (); | 2059 | freeWindowTitle (); |
563 | 2061 | 2060 | ||
564 | 2062 | XFreeCursor (screen->dpy (), mCursor); | ||
565 | 2063 | |||
566 | 2064 | if (mWindows) | 2061 | if (mWindows) |
567 | 2065 | free (mWindows); | 2062 | free (mWindows); |
568 | 2066 | 2063 | ||
569 | 2067 | 2064 | ||
570 | === modified file 'plugins/shift/src/shift.h' | |||
571 | --- plugins/shift/src/shift.h 2013-04-27 16:51:53 +0000 | |||
572 | +++ plugins/shift/src/shift.h 2015-10-20 22:44:20 +0000 | |||
573 | @@ -143,8 +143,6 @@ | |||
574 | 143 | float mMvVelocity; | 143 | float mMvVelocity; |
575 | 144 | bool mInvert; | 144 | bool mInvert; |
576 | 145 | 145 | ||
577 | 146 | Cursor mCursor; | ||
578 | 147 | |||
579 | 148 | /* only used for sorting */ | 146 | /* only used for sorting */ |
580 | 149 | CompWindow **mWindows; | 147 | CompWindow **mWindows; |
581 | 150 | int mNWindows; | 148 | int mNWindows; |
582 | 151 | 149 | ||
583 | === modified file 'plugins/widget/src/widget.cpp' | |||
584 | --- plugins/widget/src/widget.cpp 2013-05-28 21:31:18 +0000 | |||
585 | +++ plugins/widget/src/widget.cpp 2015-10-20 22:44:20 +0000 | |||
586 | @@ -312,7 +312,7 @@ | |||
587 | 312 | } | 312 | } |
588 | 313 | 313 | ||
589 | 314 | if (!mGrabIndex) | 314 | if (!mGrabIndex) |
591 | 315 | mGrabIndex = screen->pushGrab (mCursor, "widget"); | 315 | mGrabIndex = screen->pushGrab (screen->cursorCache (XC_watch), "widget"); |
592 | 316 | 316 | ||
593 | 317 | enableFunctions (this, true); | 317 | enableFunctions (this, true); |
594 | 318 | 318 | ||
595 | @@ -672,8 +672,7 @@ | |||
596 | 672 | mLastActiveWindow (None), | 672 | mLastActiveWindow (None), |
597 | 673 | mCompizWidgetAtom (XInternAtom (screen->dpy (), "_COMPIZ_WIDGET", false)), | 673 | mCompizWidgetAtom (XInternAtom (screen->dpy (), "_COMPIZ_WIDGET", false)), |
598 | 674 | mFadeTime (0), | 674 | mFadeTime (0), |
601 | 675 | mGrabIndex (0), | 675 | mGrabIndex (0) |
600 | 676 | mCursor (XCreateFontCursor (screen->dpy (), XC_watch)) | ||
602 | 677 | { | 676 | { |
603 | 678 | CompAction::CallBack cb; | 677 | CompAction::CallBack cb; |
604 | 679 | ChangeNotify notify; | 678 | ChangeNotify notify; |
605 | @@ -706,9 +705,6 @@ | |||
606 | 706 | { | 705 | { |
607 | 707 | screen->matchExpHandlerChangedSetEnabled (this, false); | 706 | screen->matchExpHandlerChangedSetEnabled (this, false); |
608 | 708 | screen->matchExpHandlerChanged (); | 707 | screen->matchExpHandlerChanged (); |
609 | 709 | |||
610 | 710 | if (mCursor) | ||
611 | 711 | XFreeCursor (screen->dpy (), mCursor); | ||
612 | 712 | } | 708 | } |
613 | 713 | 709 | ||
614 | 714 | WidgetWindow::WidgetWindow (CompWindow *window) : | 710 | WidgetWindow::WidgetWindow (CompWindow *window) : |
615 | 715 | 711 | ||
616 | === modified file 'plugins/widget/src/widget.h' | |||
617 | --- plugins/widget/src/widget.h 2013-05-28 21:31:18 +0000 | |||
618 | +++ plugins/widget/src/widget.h 2015-10-20 22:44:20 +0000 | |||
619 | @@ -107,7 +107,6 @@ | |||
620 | 107 | WidgetState mState; | 107 | WidgetState mState; |
621 | 108 | int mFadeTime; | 108 | int mFadeTime; |
622 | 109 | CompScreen::GrabHandle mGrabIndex; | 109 | CompScreen::GrabHandle mGrabIndex; |
623 | 110 | Cursor mCursor; | ||
624 | 111 | }; | 110 | }; |
625 | 112 | 111 | ||
626 | 113 | #define WIDGET_SCREEN(screen) \ | 112 | #define WIDGET_SCREEN(screen) \ |
627 | 114 | 113 | ||
628 | === modified file 'src/event.cpp' | |||
629 | --- src/event.cpp 2015-08-05 11:26:30 +0000 | |||
630 | +++ src/event.cpp 2015-10-20 22:44:20 +0000 | |||
631 | @@ -1801,6 +1801,11 @@ | |||
632 | 1801 | if (w) | 1801 | if (w) |
633 | 1802 | w->priv->updateClassHints (); | 1802 | w->priv->updateClassHints (); |
634 | 1803 | } | 1803 | } |
635 | 1804 | else if (event->xproperty.atom == XA_RESOURCE_MANAGER) | ||
636 | 1805 | { | ||
637 | 1806 | if (event->xproperty.window == privateScreen.rootWindow()) | ||
638 | 1807 | privateScreen.updateResources(); | ||
639 | 1808 | } | ||
640 | 1804 | break; | 1809 | break; |
641 | 1805 | case MotionNotify: | 1810 | case MotionNotify: |
642 | 1806 | break; | 1811 | break; |
643 | 1807 | 1812 | ||
644 | === modified file 'src/privatescreen.h' | |||
645 | --- src/privatescreen.h 2015-10-20 22:44:20 +0000 | |||
646 | +++ src/privatescreen.h 2015-10-20 22:44:20 +0000 | |||
647 | @@ -688,6 +688,8 @@ | |||
648 | 688 | 688 | ||
649 | 689 | void updateScreenInfo (); | 689 | void updateScreenInfo (); |
650 | 690 | 690 | ||
651 | 691 | void updateResources (); | ||
652 | 692 | |||
653 | 691 | Window getActiveWindow (Window root); | 693 | Window getActiveWindow (Window root); |
654 | 692 | 694 | ||
655 | 693 | void setWindowState (unsigned int state, Window id); | 695 | void setWindowState (unsigned int state, Window id); |
656 | @@ -708,6 +710,10 @@ | |||
657 | 708 | 710 | ||
658 | 709 | void setDefaultWindowAttributes (XWindowAttributes *); | 711 | void setDefaultWindowAttributes (XWindowAttributes *); |
659 | 710 | 712 | ||
660 | 713 | void updateCursors (const CompString& theme, int size); | ||
661 | 714 | |||
662 | 715 | Cursor cursorCache (unsigned int cursorName); | ||
663 | 716 | |||
664 | 711 | static void compScreenSnEvent (SnMonitorEvent *event, | 717 | static void compScreenSnEvent (SnMonitorEvent *event, |
665 | 712 | void *userData); | 718 | void *userData); |
666 | 713 | 719 | ||
667 | @@ -775,9 +781,8 @@ | |||
668 | 775 | Window wmSnSelectionWindow; | 781 | Window wmSnSelectionWindow; |
669 | 776 | 782 | ||
670 | 777 | int clientPointerDeviceId; | 783 | int clientPointerDeviceId; |
671 | 778 | Cursor normalCursor; | ||
672 | 779 | Cursor busyCursor; | ||
673 | 780 | Cursor invisibleCursor; | 784 | Cursor invisibleCursor; |
674 | 785 | std::vector<Cursor> cursors; | ||
675 | 781 | CompRect workArea; | 786 | CompRect workArea; |
676 | 782 | 787 | ||
677 | 783 | bool initialized; | 788 | bool initialized; |
678 | @@ -814,6 +819,7 @@ | |||
679 | 814 | Window xdndWindow; | 819 | Window xdndWindow; |
680 | 815 | compiz::private_screen::PluginManager pluginManager; | 820 | compiz::private_screen::PluginManager pluginManager; |
681 | 816 | compiz::private_screen::WindowManager& windowManager; | 821 | compiz::private_screen::WindowManager& windowManager; |
682 | 822 | CompOption::Vector resourceManager; | ||
683 | 817 | }; | 823 | }; |
684 | 818 | 824 | ||
685 | 819 | class CompManager | 825 | class CompManager |
686 | @@ -966,8 +972,8 @@ | |||
687 | 966 | void unhookServerWindow (CompWindow *w); | 972 | void unhookServerWindow (CompWindow *w); |
688 | 967 | 973 | ||
689 | 968 | Cursor normalCursor (); | 974 | Cursor normalCursor (); |
690 | 969 | |||
691 | 970 | Cursor invisibleCursor (); | 975 | Cursor invisibleCursor (); |
692 | 976 | Cursor cursorCache (unsigned int cursorName); | ||
693 | 971 | 977 | ||
694 | 972 | /* Adds an X Pointer and Keyboard grab to the stack. Since | 978 | /* Adds an X Pointer and Keyboard grab to the stack. Since |
695 | 973 | * compiz as a client only need to grab once, multiple clients | 979 | * compiz as a client only need to grab once, multiple clients |
696 | @@ -1176,6 +1182,7 @@ | |||
697 | 1176 | virtual void _matchExpHandlerChanged(); | 1182 | virtual void _matchExpHandlerChanged(); |
698 | 1177 | virtual void _matchPropertyChanged(CompWindow *); | 1183 | virtual void _matchPropertyChanged(CompWindow *); |
699 | 1178 | virtual void _outputChangeNotify(); | 1184 | virtual void _outputChangeNotify(); |
700 | 1185 | virtual void _cursorChangeNotify(const CompString&, int); | ||
701 | 1179 | 1186 | ||
702 | 1180 | void grabServer (); | 1187 | void grabServer (); |
703 | 1181 | void ungrabServer (); | 1188 | void ungrabServer (); |
704 | 1182 | 1189 | ||
705 | === modified file 'src/privatescreen/tests/test-privatescreen.cpp' | |||
706 | --- src/privatescreen/tests/test-privatescreen.cpp 2015-10-20 22:44:20 +0000 | |||
707 | +++ src/privatescreen/tests/test-privatescreen.cpp 2015-10-20 22:44:20 +0000 | |||
708 | @@ -81,6 +81,7 @@ | |||
709 | 81 | MOCK_METHOD0(_matchExpHandlerChanged, void ()); | 81 | MOCK_METHOD0(_matchExpHandlerChanged, void ()); |
710 | 82 | MOCK_METHOD1(_matchPropertyChanged, void (CompWindow *)); | 82 | MOCK_METHOD1(_matchPropertyChanged, void (CompWindow *)); |
711 | 83 | MOCK_METHOD0(_outputChangeNotify, void ()); | 83 | MOCK_METHOD0(_outputChangeNotify, void ()); |
712 | 84 | MOCK_METHOD2(_cursorChangeNotify, void (const CompString&, int)); | ||
713 | 84 | 85 | ||
714 | 85 | MOCK_METHOD0(outputDevs, CompOutput::vector & ()); | 86 | MOCK_METHOD0(outputDevs, CompOutput::vector & ()); |
715 | 86 | MOCK_METHOD2(setWindowState, void (unsigned int state, Window id)); | 87 | MOCK_METHOD2(setWindowState, void (unsigned int state, Window id)); |
716 | @@ -177,6 +178,7 @@ | |||
717 | 177 | MOCK_METHOD0(displayString, const char * ()); | 178 | MOCK_METHOD0(displayString, const char * ()); |
718 | 178 | MOCK_METHOD0(getCurrentOutputExtents, CompRect ()); | 179 | MOCK_METHOD0(getCurrentOutputExtents, CompRect ()); |
719 | 179 | MOCK_METHOD0(normalCursor, Cursor ()); | 180 | MOCK_METHOD0(normalCursor, Cursor ()); |
720 | 181 | MOCK_METHOD1(cursorCache, Cursor (unsigned int)); | ||
721 | 180 | MOCK_METHOD0(grabbed, bool ()); | 182 | MOCK_METHOD0(grabbed, bool ()); |
722 | 181 | MOCK_METHOD0(snDisplay, SnDisplay * ()); | 183 | MOCK_METHOD0(snDisplay, SnDisplay * ()); |
723 | 182 | MOCK_CONST_METHOD0(createFailed, bool ()); | 184 | MOCK_CONST_METHOD0(createFailed, bool ()); |
724 | 183 | 185 | ||
725 | === modified file 'src/screen.cpp' | |||
726 | --- src/screen.cpp 2015-10-20 22:44:20 +0000 | |||
727 | +++ src/screen.cpp 2015-10-20 22:44:20 +0000 | |||
728 | @@ -44,6 +44,7 @@ | |||
729 | 44 | 44 | ||
730 | 45 | #include <boost/bind.hpp> | 45 | #include <boost/bind.hpp> |
731 | 46 | #include <boost/foreach.hpp> | 46 | #include <boost/foreach.hpp> |
732 | 47 | #include <boost/algorithm/string.hpp> | ||
733 | 47 | #define foreach BOOST_FOREACH | 48 | #define foreach BOOST_FOREACH |
734 | 48 | 49 | ||
735 | 49 | #include <X11/Xlib.h> | 50 | #include <X11/Xlib.h> |
736 | @@ -53,6 +54,7 @@ | |||
737 | 53 | #include <X11/extensions/shape.h> | 54 | #include <X11/extensions/shape.h> |
738 | 54 | #include <X11/cursorfont.h> | 55 | #include <X11/cursorfont.h> |
739 | 55 | #include <X11/extensions/XInput2.h> | 56 | #include <X11/extensions/XInput2.h> |
740 | 57 | #include <X11/Xcursor/Xcursor.h> | ||
741 | 56 | 58 | ||
742 | 57 | #include <core/global.h> | 59 | #include <core/global.h> |
743 | 58 | #include <core/screen.h> | 60 | #include <core/screen.h> |
744 | @@ -77,10 +79,12 @@ | |||
745 | 77 | namespace | 79 | namespace |
746 | 78 | { | 80 | { |
747 | 79 | bool inHandleEvent = false; | 81 | bool inHandleEvent = false; |
748 | 80 | |||
749 | 81 | bool screenInitalized = false; | 82 | bool screenInitalized = false; |
750 | 82 | } | 83 | } |
751 | 83 | 84 | ||
752 | 85 | #define normalCursorName XC_left_ptr | ||
753 | 86 | #define busyCursorName XC_watch | ||
754 | 87 | |||
755 | 84 | #define MwmHintsFunctions (1L << 0) | 88 | #define MwmHintsFunctions (1L << 0) |
756 | 85 | #define MwmHintsDecorations (1L << 1) | 89 | #define MwmHintsDecorations (1L << 1) |
757 | 86 | static const unsigned short PropMotifWmHintElements = 3; | 90 | static const unsigned short PropMotifWmHintElements = 3; |
758 | @@ -101,6 +105,14 @@ | |||
759 | 101 | 105 | ||
760 | 102 | PluginClassStorage::Indices screenPluginClassIndices (0); | 106 | PluginClassStorage::Indices screenPluginClassIndices (0); |
761 | 103 | 107 | ||
762 | 108 | namespace utils | ||
763 | 109 | { | ||
764 | 110 | bool is_number (CompString const& s) | ||
765 | 111 | { | ||
766 | 112 | return std::find_if (s.begin (), s.end (), [](char c) { return !std::isdigit (c); }) == s.end (); | ||
767 | 113 | } | ||
768 | 114 | } | ||
769 | 115 | |||
770 | 104 | void CompScreenImpl::sizePluginClasses(unsigned int size) | 116 | void CompScreenImpl::sizePluginClasses(unsigned int size) |
771 | 105 | { | 117 | { |
772 | 106 | if(size != pluginClasses.size ()) | 118 | if(size != pluginClasses.size ()) |
773 | @@ -1271,8 +1283,8 @@ | |||
774 | 1271 | eventManager.quit (); | 1283 | eventManager.quit (); |
775 | 1272 | } | 1284 | } |
776 | 1273 | 1285 | ||
779 | 1274 | static const std::string IMAGEDIR("images"); | 1286 | static const CompString IMAGEDIR("images"); |
780 | 1275 | static const std::string HOMECOMPIZDIR(".compiz-1"); | 1287 | static const CompString HOMECOMPIZDIR(".compiz-1"); |
781 | 1276 | 1288 | ||
782 | 1277 | bool | 1289 | bool |
783 | 1278 | CompScreenImpl::readImageFromFile (CompString &name, | 1290 | CompScreenImpl::readImageFromFile (CompString &name, |
784 | @@ -1353,6 +1365,68 @@ | |||
785 | 1353 | return w; | 1365 | return w; |
786 | 1354 | } | 1366 | } |
787 | 1355 | 1367 | ||
788 | 1368 | void | ||
789 | 1369 | PrivateScreen::updateResources () | ||
790 | 1370 | { | ||
791 | 1371 | Atom actual; | ||
792 | 1372 | int result, format; | ||
793 | 1373 | unsigned long n, left; | ||
794 | 1374 | unsigned char *data; | ||
795 | 1375 | |||
796 | 1376 | result = XGetWindowProperty (dpy, root, | ||
797 | 1377 | XA_RESOURCE_MANAGER, 0L, 65536, False, | ||
798 | 1378 | XA_STRING, &actual, &format, | ||
799 | 1379 | &n, &left, &data); | ||
800 | 1380 | |||
801 | 1381 | int oldCursorSize = CompOption::getIntOptionNamed (resourceManager, "Xcursor.size", -1); | ||
802 | 1382 | CompString oldCursorTheme = CompOption::getStringOptionNamed (resourceManager, "Xcursor.theme"); | ||
803 | 1383 | resourceManager.clear (); | ||
804 | 1384 | |||
805 | 1385 | if (result == Success && data) | ||
806 | 1386 | { | ||
807 | 1387 | if (actual == XA_STRING) | ||
808 | 1388 | { | ||
809 | 1389 | std::vector<CompString> lines; | ||
810 | 1390 | CompString resources (reinterpret_cast<char *> (data)); | ||
811 | 1391 | boost::split (lines, resources, boost::is_any_of ("\n")); | ||
812 | 1392 | |||
813 | 1393 | for (auto const& line : lines) | ||
814 | 1394 | { | ||
815 | 1395 | std::vector<CompString> pair; | ||
816 | 1396 | boost::split (pair, line, boost::is_any_of ("\t")); | ||
817 | 1397 | |||
818 | 1398 | if (pair.size () == 2 && pair[0].back () == ':') | ||
819 | 1399 | { | ||
820 | 1400 | CompOption option; | ||
821 | 1401 | auto key = pair[0].substr (0, pair[0].size () - 1); | ||
822 | 1402 | auto const& value = pair[1]; | ||
823 | 1403 | |||
824 | 1404 | if (utils::is_number (value)) | ||
825 | 1405 | { | ||
826 | 1406 | option.setName (key, CompOption::TypeInt); | ||
827 | 1407 | option.value ().set (std::atoi (value.c_str ())); | ||
828 | 1408 | } | ||
829 | 1409 | else | ||
830 | 1410 | { | ||
831 | 1411 | option.setName (key, CompOption::TypeString); | ||
832 | 1412 | option.value ().set (value); | ||
833 | 1413 | } | ||
834 | 1414 | |||
835 | 1415 | resourceManager.push_back (option); | ||
836 | 1416 | } | ||
837 | 1417 | } | ||
838 | 1418 | } | ||
839 | 1419 | |||
840 | 1420 | XFree (data); | ||
841 | 1421 | } | ||
842 | 1422 | |||
843 | 1423 | int cursorSize = CompOption::getIntOptionNamed (resourceManager, "Xcursor.size", -1); | ||
844 | 1424 | CompString const& cursorTheme = CompOption::getStringOptionNamed (resourceManager, "Xcursor.theme"); | ||
845 | 1425 | |||
846 | 1426 | if (cursorSize != oldCursorSize || cursorTheme != oldCursorTheme) | ||
847 | 1427 | screen->cursorChangeNotify (cursorTheme, cursorSize); | ||
848 | 1428 | } | ||
849 | 1429 | |||
850 | 1356 | bool | 1430 | bool |
851 | 1357 | CompScreen::fileToImage (CompString &name, | 1431 | CompScreen::fileToImage (CompString &name, |
852 | 1358 | CompSize &size, | 1432 | CompSize &size, |
853 | @@ -2078,9 +2152,9 @@ | |||
854 | 2078 | if (priv->initialized) | 2152 | if (priv->initialized) |
855 | 2079 | { | 2153 | { |
856 | 2080 | if (!emptySequence()) | 2154 | if (!emptySequence()) |
858 | 2081 | XIDefineCursor (priv->dpy, priv->clientPointerDeviceId, priv->rootWindow(), priv->busyCursor); | 2155 | XIDefineCursor (priv->dpy, priv->clientPointerDeviceId, priv->rootWindow(), priv->cursorCache (busyCursorName)); |
859 | 2082 | else | 2156 | else |
861 | 2083 | XIDefineCursor (priv->dpy, priv->clientPointerDeviceId, priv->rootWindow(), priv->normalCursor); | 2157 | XIDefineCursor (priv->dpy, priv->clientPointerDeviceId, priv->rootWindow(), priv->cursorCache (normalCursorName)); |
862 | 2084 | } | 2158 | } |
863 | 2085 | } | 2159 | } |
864 | 2086 | 2160 | ||
865 | @@ -3012,7 +3086,7 @@ | |||
866 | 3012 | Cursor | 3086 | Cursor |
867 | 3013 | CompScreenImpl::normalCursor () | 3087 | CompScreenImpl::normalCursor () |
868 | 3014 | { | 3088 | { |
870 | 3015 | return privateScreen.normalCursor; | 3089 | return privateScreen.cursorCache (normalCursorName); |
871 | 3016 | } | 3090 | } |
872 | 3017 | 3091 | ||
873 | 3018 | Cursor | 3092 | Cursor |
874 | @@ -3021,6 +3095,12 @@ | |||
875 | 3021 | return privateScreen.invisibleCursor; | 3095 | return privateScreen.invisibleCursor; |
876 | 3022 | } | 3096 | } |
877 | 3023 | 3097 | ||
878 | 3098 | Cursor | ||
879 | 3099 | CompScreenImpl::cursorCache (unsigned int cursorName) | ||
880 | 3100 | { | ||
881 | 3101 | return privateScreen.cursorCache (cursorName); | ||
882 | 3102 | } | ||
883 | 3103 | |||
884 | 3024 | #define POINTER_GRAB_MASK (ButtonReleaseMask | \ | 3104 | #define POINTER_GRAB_MASK (ButtonReleaseMask | \ |
885 | 3025 | ButtonPressMask | \ | 3105 | ButtonPressMask | \ |
886 | 3026 | PointerMotionMask) | 3106 | PointerMotionMask) |
887 | @@ -3302,10 +3382,19 @@ | |||
888 | 3302 | * This is so that we can detect taps on individual modifier | 3382 | * This is so that we can detect taps on individual modifier |
889 | 3303 | * keys, and know to cancel the tap if <modifier>+k is pressed. | 3383 | * keys, and know to cancel the tap if <modifier>+k is pressed. |
890 | 3304 | */ | 3384 | */ |
895 | 3305 | if (!(currentState & CompAction::StateIgnoreTap)) | 3385 | int minCode, maxCode; |
896 | 3306 | { | 3386 | XDisplayKeycodes (screen->dpy(), &minCode, &maxCode); |
897 | 3307 | int minCode, maxCode; | 3387 | |
898 | 3308 | XDisplayKeycodes (screen->dpy(), &minCode, &maxCode); | 3388 | if ((currentState & CompAction::StateIgnoreTap)) |
899 | 3389 | { | ||
900 | 3390 | KeyCode code_p = XKeysymToKeycode(screen->dpy(), XK_p); | ||
901 | 3391 | |||
902 | 3392 | for (k = minCode; k <= maxCode; k++) | ||
903 | 3393 | if (k != code_p) | ||
904 | 3394 | grabUngrabOneKey (modifiers | ignore, k, grab); | ||
905 | 3395 | } | ||
906 | 3396 | else | ||
907 | 3397 | { | ||
908 | 3309 | for (k = minCode; k <= maxCode; k++) | 3398 | for (k = minCode; k <= maxCode; k++) |
909 | 3310 | grabUngrabOneKey (modifiers | modifierForKeycode | ignore, k, grab); | 3399 | grabUngrabOneKey (modifiers | modifierForKeycode | ignore, k, grab); |
910 | 3311 | } | 3400 | } |
911 | @@ -3782,11 +3871,11 @@ | |||
912 | 3782 | setsid (); | 3871 | setsid (); |
913 | 3783 | 3872 | ||
914 | 3784 | pos = env.find (':'); | 3873 | pos = env.find (':'); |
916 | 3785 | if (pos != std::string::npos) | 3874 | if (pos != CompString::npos) |
917 | 3786 | { | 3875 | { |
918 | 3787 | size_t pointPos = env.find ('.', pos); | 3876 | size_t pointPos = env.find ('.', pos); |
919 | 3788 | 3877 | ||
921 | 3789 | if (pointPos != std::string::npos) | 3878 | if (pointPos != CompString::npos) |
922 | 3790 | { | 3879 | { |
923 | 3791 | env.erase (pointPos); | 3880 | env.erase (pointPos); |
924 | 3792 | } | 3881 | } |
925 | @@ -4066,6 +4155,53 @@ | |||
926 | 4066 | { | 4155 | { |
927 | 4067 | } | 4156 | } |
928 | 4068 | 4157 | ||
929 | 4158 | void | ||
930 | 4159 | CompScreen::cursorChangeNotify (const CompString& theme, int size) | ||
931 | 4160 | { | ||
932 | 4161 | WRAPABLE_HND_FUNCTN (cursorChangeNotify, theme, size); | ||
933 | 4162 | _cursorChangeNotify (theme, size); | ||
934 | 4163 | } | ||
935 | 4164 | |||
936 | 4165 | Cursor | ||
937 | 4166 | PrivateScreen::cursorCache (unsigned int cursorName) | ||
938 | 4167 | { | ||
939 | 4168 | if (cursorName >= XC_num_glyphs) | ||
940 | 4169 | return 0; | ||
941 | 4170 | |||
942 | 4171 | if (cursors.size() > cursorName && cursors[cursorName]) | ||
943 | 4172 | return cursors[cursorName]; | ||
944 | 4173 | |||
945 | 4174 | cursors.resize(std::max<size_t>(cursorName + 1, cursors.size()), 0); | ||
946 | 4175 | cursors[cursorName] = XCreateFontCursor (dpy, cursorName); | ||
947 | 4176 | |||
948 | 4177 | return cursors[cursorName]; | ||
949 | 4178 | } | ||
950 | 4179 | |||
951 | 4180 | void | ||
952 | 4181 | PrivateScreen::updateCursors (const CompString& theme, int size) | ||
953 | 4182 | { | ||
954 | 4183 | XcursorSetDefaultSize (dpy, size); | ||
955 | 4184 | XcursorSetTheme (dpy, theme.c_str()); | ||
956 | 4185 | |||
957 | 4186 | for (auto it = begin (cursors); it != end (cursors); ++it) | ||
958 | 4187 | { | ||
959 | 4188 | if (*it) | ||
960 | 4189 | { | ||
961 | 4190 | XFreeCursor (dpy, *it); | ||
962 | 4191 | *it = XCreateFontCursor (dpy, it - begin (cursors)); | ||
963 | 4192 | } | ||
964 | 4193 | } | ||
965 | 4194 | |||
966 | 4195 | XIDefineCursor (dpy, clientPointerDeviceId, root, cursorCache (normalCursorName)); | ||
967 | 4196 | startupSequence.updateStartupFeedback (); | ||
968 | 4197 | } | ||
969 | 4198 | |||
970 | 4199 | void | ||
971 | 4200 | CompScreenImpl::_cursorChangeNotify (const CompString& theme, int size) | ||
972 | 4201 | { | ||
973 | 4202 | privateScreen.updateCursors (theme, size); | ||
974 | 4203 | } | ||
975 | 4204 | |||
976 | 4069 | /* Returns default viewport for some window geometry. If the window spans | 4205 | /* Returns default viewport for some window geometry. If the window spans |
977 | 4070 | * more than one viewport the most appropriate viewport is returned. How the | 4206 | * more than one viewport the most appropriate viewport is returned. How the |
978 | 4071 | * most appropriate viewport is computed can be made optional if necessary. It | 4207 | * most appropriate viewport is computed can be made optional if necessary. It |
979 | @@ -4208,6 +4344,9 @@ | |||
980 | 4208 | ScreenInterface::addSupportedAtoms (std::vector<Atom>& atoms) | 4344 | ScreenInterface::addSupportedAtoms (std::vector<Atom>& atoms) |
981 | 4209 | WRAPABLE_DEF (addSupportedAtoms, atoms) | 4345 | WRAPABLE_DEF (addSupportedAtoms, atoms) |
982 | 4210 | 4346 | ||
983 | 4347 | void | ||
984 | 4348 | ScreenInterface::cursorChangeNotify (const CompString& theme, int size) | ||
985 | 4349 | WRAPABLE_DEF (cursorChangeNotify, theme, size) | ||
986 | 4211 | 4350 | ||
987 | 4212 | Window | 4351 | Window |
988 | 4213 | CompScreenImpl::root () | 4352 | CompScreenImpl::root () |
989 | @@ -5060,12 +5199,10 @@ | |||
990 | 5060 | eventManager.setSupportingWmCheck (dpy, rootWindow()); | 5199 | eventManager.setSupportingWmCheck (dpy, rootWindow()); |
991 | 5061 | screen->updateSupportedWmHints (); | 5200 | screen->updateSupportedWmHints (); |
992 | 5062 | 5201 | ||
993 | 5202 | |||
994 | 5063 | XIGetClientPointer (dpy, None, &clientPointerDeviceId); | 5203 | XIGetClientPointer (dpy, None, &clientPointerDeviceId); |
1000 | 5064 | 5204 | updateCursors (XcursorGetTheme (dpy), XcursorGetDefaultSize (dpy)); | |
1001 | 5065 | normalCursor = XCreateFontCursor (dpy, XC_left_ptr); | 5205 | updateResources (); |
997 | 5066 | busyCursor = XCreateFontCursor (dpy, XC_watch); | ||
998 | 5067 | |||
999 | 5068 | XIDefineCursor (dpy, clientPointerDeviceId, rootWindow(), normalCursor); | ||
1002 | 5069 | 5206 | ||
1003 | 5070 | /* Attempt to gain SubstructureRedirectMask */ | 5207 | /* Attempt to gain SubstructureRedirectMask */ |
1004 | 5071 | CompScreenImpl::checkForError (dpy); | 5208 | CompScreenImpl::checkForError (dpy); |
1005 | @@ -5241,8 +5378,6 @@ | |||
1006 | 5241 | currentDesktop (0), | 5378 | currentDesktop (0), |
1007 | 5242 | wmSnSelectionWindow (None), | 5379 | wmSnSelectionWindow (None), |
1008 | 5243 | clientPointerDeviceId (None), | 5380 | clientPointerDeviceId (None), |
1009 | 5244 | normalCursor (None), | ||
1010 | 5245 | busyCursor (None), | ||
1011 | 5246 | invisibleCursor (None), | 5381 | invisibleCursor (None), |
1012 | 5247 | initialized (false), | 5382 | initialized (false), |
1013 | 5248 | screen(screen), | 5383 | screen(screen), |
1014 | @@ -5363,11 +5498,8 @@ | |||
1015 | 5363 | 5498 | ||
1016 | 5364 | eventManager.destroyGrabWindow (dpy); | 5499 | eventManager.destroyGrabWindow (dpy); |
1017 | 5365 | 5500 | ||
1023 | 5366 | if (normalCursor != None) | 5501 | for (auto cursor : cursors) |
1024 | 5367 | XFreeCursor (dpy, normalCursor); | 5502 | XFreeCursor (dpy, cursor); |
1020 | 5368 | |||
1021 | 5369 | if (busyCursor != None) | ||
1022 | 5370 | XFreeCursor (dpy, busyCursor); | ||
1025 | 5371 | 5503 | ||
1026 | 5372 | if (invisibleCursor != None) | 5504 | if (invisibleCursor != None) |
1027 | 5373 | XFreeCursor (dpy, invisibleCursor); | 5505 | XFreeCursor (dpy, invisibleCursor); |
FAILED: Continuous integration, rev:3952 jenkins. qa.ubuntu. com/job/ compiz- ci/103/ jenkins. qa.ubuntu. com/job/ compiz- wily-amd64- ci/48/console jenkins. qa.ubuntu. com/job/ compiz- wily-armhf- ci/48/console jenkins. qa.ubuntu. com/job/ compiz- wily-i386- ci/48/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/compiz- ci/103/ rebuild
http://