Merge lp:~3v1n0/compiz/wily-cursors-update-and-cache into lp:compiz/wily

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Andrea Azzarone
Approved revision: 3984
Merged at revision: 3983
Proposed branch: lp:~3v1n0/compiz/wily-cursors-update-and-cache
Merge into: lp:compiz/wily
Diff against target: 966 lines (+209/-134)
26 files modified
CMakeLists.txt (+1/-0)
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 (+1/-5)
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 (+145/-20)
To merge this branch: bzr merge lp:~3v1n0/compiz/wily-cursors-update-and-cache
Reviewer Review Type Date Requested Status
Andrea Azzarone Approve
Review via email: mp+279304@code.launchpad.net

Commit message

Screen: monitor root RESOURCE_MANAGER and update cursors when Size or Theme changes

Also add cursorCache to get a cursor caching its shape for future re-usage.

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2015-07-30 20:12:45 +0000
+++ CMakeLists.txt 2015-12-02 16:44:19 +0000
@@ -101,6 +101,7 @@
101 xext101 xext
102 xdamage102 xdamage
103 xcomposite103 xcomposite
104 xcursor
104 x11-xcb105 x11-xcb
105 xrandr106 xrandr
106 xinerama107 xinerama
107108
=== modified file 'include/core/abiversion.h'
--- include/core/abiversion.h 2015-02-17 14:57:27 +0000
+++ include/core/abiversion.h 2015-12-02 16:44:19 +0000
@@ -5,6 +5,6 @@
5# error Conflicting definitions of CORE_ABIVERSION5# error Conflicting definitions of CORE_ABIVERSION
6#endif6#endif
77
8#define CORE_ABIVERSION 201502178#define CORE_ABIVERSION 20151010
99
10#endif // COMPIZ_ABIVERSION_H10#endif // COMPIZ_ABIVERSION_H
1111
=== modified file 'include/core/screen.h'
--- include/core/screen.h 2012-12-03 10:36:42 +0000
+++ include/core/screen.h 2015-12-02 16:44:19 +0000
@@ -155,6 +155,7 @@
155 virtual void outputChangeNotify ();155 virtual void outputChangeNotify ();
156 virtual void addSupportedAtoms (std::vector<Atom>& atoms);156 virtual void addSupportedAtoms (std::vector<Atom>& atoms);
157157
158 virtual void cursorChangeNotify (const CompString& theme, int size);
158};159};
159160
160namespace compiz { namespace private_screen {161namespace compiz { namespace private_screen {
@@ -217,7 +218,7 @@
217}218}
218219
219class CompScreen :220class CompScreen :
220 public WrapableHandler<ScreenInterface, 18>,221 public WrapableHandler<ScreenInterface, 19>,
221 public PluginClassStorage, // TODO should be an interface here222 public PluginClassStorage, // TODO should be an interface here
222 public CompSize,223 public CompSize,
223 public virtual ::compiz::DesktopWindowCount,224 public virtual ::compiz::DesktopWindowCount,
@@ -267,6 +268,8 @@
267 WRAPABLE_HND (16, ScreenInterface, void, outputChangeNotify);268 WRAPABLE_HND (16, ScreenInterface, void, outputChangeNotify);
268 WRAPABLE_HND (17, ScreenInterface, void, addSupportedAtoms,269 WRAPABLE_HND (17, ScreenInterface, void, addSupportedAtoms,
269 std::vector<Atom>& atoms);270 std::vector<Atom>& atoms);
271 WRAPABLE_HND (18, ScreenInterface, void, cursorChangeNotify,
272 const CompString&, int);
270273
271 unsigned int allocPluginClassIndex ();274 unsigned int allocPluginClassIndex ();
272 void freePluginClassIndex (unsigned int index);275 void freePluginClassIndex (unsigned int index);
@@ -390,6 +393,7 @@
390 virtual const char * displayString () = 0;393 virtual const char * displayString () = 0;
391 virtual CompRect getCurrentOutputExtents () = 0;394 virtual CompRect getCurrentOutputExtents () = 0;
392 virtual Cursor normalCursor () = 0;395 virtual Cursor normalCursor () = 0;
396 virtual Cursor cursorCache (unsigned int cursorName) = 0;
393 virtual bool grabbed () = 0;397 virtual bool grabbed () = 0;
394 virtual SnDisplay * snDisplay () = 0;398 virtual SnDisplay * snDisplay () = 0;
395399
@@ -443,6 +447,7 @@
443 virtual void _matchExpHandlerChanged() = 0;447 virtual void _matchExpHandlerChanged() = 0;
444 virtual void _matchPropertyChanged(CompWindow *) = 0;448 virtual void _matchPropertyChanged(CompWindow *) = 0;
445 virtual void _outputChangeNotify() = 0;449 virtual void _outputChangeNotify() = 0;
450 virtual void _cursorChangeNotify(const CompString&, int) = 0;
446};451};
447452
448#endif453#endif
449454
=== modified file 'plugins/expo/src/expo.cpp'
--- plugins/expo/src/expo.cpp 2015-04-10 21:55:21 +0000
+++ plugins/expo/src/expo.cpp 2015-12-02 16:44:19 +0000
@@ -610,7 +610,7 @@
610 CompWindowGrabMoveMask |610 CompWindowGrabMoveMask |
611 CompWindowGrabButtonMask);611 CompWindowGrabButtonMask);
612612
613 screen->updateGrab (grabIndex, dragCursor);613 screen->updateGrab (grabIndex, screen->cursorCache (XC_fleur));
614614
615 w->raise ();615 w->raise ();
616 w->moveInputFocusTo ();616 w->moveInputFocusTo ();
@@ -1578,8 +1578,6 @@
1578 upKey = XKeysymToKeycode (s->dpy (), XStringToKeysym ("Up"));1578 upKey = XKeysymToKeycode (s->dpy (), XStringToKeysym ("Up"));
1579 downKey = XKeysymToKeycode (s->dpy (), XStringToKeysym ("Down"));1579 downKey = XKeysymToKeycode (s->dpy (), XStringToKeysym ("Down"));
15801580
1581 dragCursor = XCreateFontCursor (screen->dpy (), XC_fleur);
1582
1583 EXPOINITBIND (ExpoKey, doExpo);1581 EXPOINITBIND (ExpoKey, doExpo);
1584 EXPOTERMBIND (ExpoKey, termExpo);1582 EXPOTERMBIND (ExpoKey, termExpo);
1585 EXPOINITBIND (ExpoButton, doExpo);1583 EXPOINITBIND (ExpoButton, doExpo);
@@ -1603,11 +1601,6 @@
1603 GL_RGBA, GL_UNSIGNED_BYTE);1601 GL_RGBA, GL_UNSIGNED_BYTE);
1604}1602}
16051603
1606ExpoScreen::~ExpoScreen ()
1607{
1608 if (dragCursor != None)
1609 XFreeCursor (screen->dpy (), dragCursor);
1610}
16111604
1612ExpoWindow::ExpoWindow (CompWindow *w) :1605ExpoWindow::ExpoWindow (CompWindow *w) :
1613 PluginClassHandler<ExpoWindow, CompWindow> (w),1606 PluginClassHandler<ExpoWindow, CompWindow> (w),
16141607
=== modified file 'plugins/expo/src/expo.h'
--- plugins/expo/src/expo.h 2013-07-14 10:38:09 +0000
+++ plugins/expo/src/expo.h 2015-12-02 16:44:19 +0000
@@ -42,7 +42,6 @@
42 public:42 public:
4343
44 ExpoScreen (CompScreen *);44 ExpoScreen (CompScreen *);
45 ~ExpoScreen ();
4645
47 void handleEvent (XEvent *);46 void handleEvent (XEvent *);
4847
@@ -153,8 +152,6 @@
153 KeyCode rightKey;152 KeyCode rightKey;
154 KeyCode upKey;153 KeyCode upKey;
155 KeyCode downKey;154 KeyCode downKey;
156
157 Cursor dragCursor;
158};155};
159156
160class ExpoWindow :157class ExpoWindow :
161158
=== modified file 'plugins/freewins/src/action.cpp'
--- plugins/freewins/src/action.cpp 2013-03-26 22:02:39 +0000
+++ plugins/freewins/src/action.cpp 2015-12-02 16:44:19 +0000
@@ -82,8 +82,6 @@
82 useW = getRealWindow (w);82 useW = getRealWindow (w);
83 }83 }
8484
85 mRotateCursor = XCreateFontCursor (screen->dpy (), XC_fleur);
86
87 if (!screen->otherGrabExist ("freewins", 0))85 if (!screen->otherGrabExist ("freewins", 0))
88 if (!mGrabIndex)86 if (!mGrabIndex)
89 {87 {
@@ -305,11 +303,9 @@
305 useW = getRealWindow (w);303 useW = getRealWindow (w);
306 }304 }
307305
308 mRotateCursor = XCreateFontCursor (screen->dpy (), XC_fleur);
309
310 if (!screen->otherGrabExist ("freewins", 0))306 if (!screen->otherGrabExist ("freewins", 0))
311 if (!mGrabIndex)307 if (!mGrabIndex)
312 mGrabIndex = screen->pushGrab (mRotateCursor, "freewins");308 mGrabIndex = screen->pushGrab (screen->cursorCache(XC_fleur), "freewins");
313 }309 }
314310
315 if (useW)311 if (useW)
316312
=== modified file 'plugins/freewins/src/events.cpp'
--- plugins/freewins/src/events.cpp 2013-03-26 22:02:39 +0000
+++ plugins/freewins/src/events.cpp 2015-12-02 16:44:19 +0000
@@ -60,13 +60,12 @@
6060
61 window->activate ();61 window->activate ();
62 mGrab = grabResize;62 mGrab = grabResize;
63 fws->mRotateCursor = XCreateFontCursor (screen->dpy (), XC_plus);
64 if(!screen->otherGrabExist ("freewins", "resize", 0))63 if(!screen->otherGrabExist ("freewins", "resize", 0))
65 if(!fws->mGrabIndex)64 if(!fws->mGrabIndex)
66 {65 {
67 unsigned int mods = 0;66 unsigned int mods = 0;
68 mods &= CompNoMask;67 mods &= CompNoMask;
69 fws->mGrabIndex = screen->pushGrab (fws->mRotateCursor, "resize");68 fws->mGrabIndex = screen->pushGrab (screen->cursorCache (XC_plus), "resize");
70 window->grabNotify (window->x () + (window->width () / 2),69 window->grabNotify (window->x () + (window->width () / 2),
71 window->y () + (window->height () / 2), mods,70 window->y () + (window->height () / 2), mods,
72 CompWindowGrabMoveMask | CompWindowGrabButtonMask);71 CompWindowGrabMoveMask | CompWindowGrabButtonMask);
@@ -81,13 +80,12 @@
8180
82 window->activate ();81 window->activate ();
83 mGrab = grabMove;82 mGrab = grabMove;
84 fws->mRotateCursor = XCreateFontCursor (screen->dpy (), XC_fleur);
85 if(!screen->otherGrabExist ("freewins", "resize", 0))83 if(!screen->otherGrabExist ("freewins", "resize", 0))
86 if(!fws->mGrabIndex)84 if(!fws->mGrabIndex)
87 {85 {
88 unsigned int mods = 0;86 unsigned int mods = 0;
89 mods &= CompNoMask;87 mods &= CompNoMask;
90 fws->mGrabIndex = screen->pushGrab (fws->mRotateCursor, "resize");88 fws->mGrabIndex = screen->pushGrab (screen->cursorCache (XC_fleur), "resize");
91 window->grabNotify (window->x () + (window->width () / 2),89 window->grabNotify (window->x () + (window->width () / 2),
92 window->y () + (window->height () / 2), mods,90 window->y () + (window->height () / 2), mods,
93 CompWindowGrabResizeMask | CompWindowGrabButtonMask);91 CompWindowGrabResizeMask | CompWindowGrabButtonMask);
9492
=== modified file 'plugins/freewins/src/freewins.h'
--- plugins/freewins/src/freewins.h 2013-02-20 14:24:30 +0000
+++ plugins/freewins/src/freewins.h 2015-12-02 16:44:19 +0000
@@ -281,8 +281,6 @@
281 int mSnapMask;281 int mSnapMask;
282 int mInvertMask;282 int mInvertMask;
283283
284 Cursor mRotateCursor;
285
286 CompScreen::GrabHandle mGrabIndex;284 CompScreen::GrabHandle mGrabIndex;
287285
288 void preparePaint (int);286 void preparePaint (int);
289287
=== modified file 'plugins/move/src/move.cpp'
--- plugins/move/src/move.cpp 2013-06-28 01:10:57 +0000
+++ plugins/move/src/move.cpp 2015-12-02 16:44:19 +0000
@@ -104,7 +104,7 @@
104 ms->snapOffY = y - workArea.y ();104 ms->snapOffY = y - workArea.y ();
105105
106 if (!ms->grab)106 if (!ms->grab)
107 ms->grab = s->pushGrab (ms->moveCursor, "move");107 ms->grab = s->pushGrab (screen->cursorCache (XC_fleur), "move");
108108
109 if (ms->grab)109 if (ms->grab)
110 {110 {
@@ -711,7 +711,6 @@
711 key[i] = XKeysymToKeycode (screen->dpy (),711 key[i] = XKeysymToKeycode (screen->dpy (),
712 XStringToKeysym (mKeys[i].name));712 XStringToKeysym (mKeys[i].name));
713713
714 moveCursor = XCreateFontCursor (screen->dpy (), XC_fleur);
715 if (cScreen)714 if (cScreen)
716 {715 {
717 CompositeScreenInterface::setHandler (cScreen);716 CompositeScreenInterface::setHandler (cScreen);
@@ -734,9 +733,6 @@
734{733{
735 if (region)734 if (region)
736 XDestroyRegion (region);735 XDestroyRegion (region);
737
738 if (moveCursor)
739 XFreeCursor (screen->dpy (), moveCursor);
740}736}
741737
742bool738bool
743739
=== modified file 'plugins/move/src/move.h'
--- plugins/move/src/move.h 2013-04-13 21:59:11 +0000
+++ plugins/move/src/move.h 2015-12-02 16:44:19 +0000
@@ -82,8 +82,6 @@
8282
83 CompScreen::GrabHandle grab;83 CompScreen::GrabHandle grab;
8484
85 Cursor moveCursor;
86
87 unsigned int origState;85 unsigned int origState;
8886
89 int snapOffX;87 int snapOffX;
9088
=== modified file 'plugins/resize/src/logic/include/resize-logic.h'
--- plugins/resize/src/logic/include/resize-logic.h 2014-05-28 07:08:10 +0000
+++ plugins/resize/src/logic/include/resize-logic.h 2015-12-02 16:44:19 +0000
@@ -113,20 +113,10 @@
113 int pointerDx;113 int pointerDx;
114 int pointerDy;114 int pointerDy;
115 KeyCode key[NUM_KEYS];115 KeyCode key[NUM_KEYS];
116 unsigned int keyCursorNames[NUM_KEYS];
116117
117 CompScreen::GrabHandle grabIndex;118 CompScreen::GrabHandle grabIndex;
118119
119 Cursor leftCursor;
120 Cursor rightCursor;
121 Cursor upCursor;
122 Cursor upLeftCursor;
123 Cursor upRightCursor;
124 Cursor downCursor;
125 Cursor downLeftCursor;
126 Cursor downRightCursor;
127 Cursor middleCursor;
128 Cursor cursor[NUM_KEYS];
129
130 bool isConstrained;120 bool isConstrained;
131 CompRegion constraintRegion;121 CompRegion constraintRegion;
132 bool inRegionStatus;122 bool inRegionStatus;
133123
=== modified file 'plugins/resize/src/logic/include/screen-interface.h'
--- plugins/resize/src/logic/include/screen-interface.h 2013-01-08 09:17:25 +0000
+++ plugins/resize/src/logic/include/screen-interface.h 2015-12-02 16:44:19 +0000
@@ -57,6 +57,7 @@
57 virtual void updateGrab (CompScreen::GrabHandle handle, Cursor cursor) = 0;57 virtual void updateGrab (CompScreen::GrabHandle handle, Cursor cursor) = 0;
58 virtual CompScreen::GrabHandle pushGrab (Cursor cursor, const char *name) = 0;58 virtual CompScreen::GrabHandle pushGrab (Cursor cursor, const char *name) = 0;
59 virtual void removeGrab (CompScreen::GrabHandle handle, CompPoint *restorePointer) = 0;59 virtual void removeGrab (CompScreen::GrabHandle handle, CompPoint *restorePointer) = 0;
60 virtual Cursor cursorCache (unsigned int cursorName) = 0;
6061
61 /* CompOption::Class */62 /* CompOption::Class */
62 virtual CompOption * getOption (const CompString &name) = 0;63 virtual CompOption * getOption (const CompString &name) = 0;
6364
=== modified file 'plugins/resize/src/logic/src/resize-logic.cpp'
--- plugins/resize/src/logic/src/resize-logic.cpp 2015-03-19 15:14:55 +0000
+++ plugins/resize/src/logic/src/resize-logic.cpp 2015-12-02 16:44:19 +0000
@@ -27,6 +27,7 @@
2727
28#include <core/core.h>28#include <core/core.h>
29#include <core/atoms.h>29#include <core/atoms.h>
30#include <X11/cursorfont.h>
3031
31#include "resize-logic.h"32#include "resize-logic.h"
3233
@@ -48,6 +49,16 @@
48static const unsigned short TOUCH_TOP = 3;49static const unsigned short TOUCH_TOP = 3;
49static const unsigned short TOUCH_BOTTOM = 4;50static const unsigned short TOUCH_BOTTOM = 4;
5051
52#define LEFT_CURSOR XC_left_side
53#define RIGHT_CURSOR XC_right_side
54#define UP_CURSOR XC_top_side
55#define UP_LEFT_CURSOR XC_top_left_corner
56#define UP_RIGHT_CURSOR XC_top_right_corner
57#define DOWN_CURSOR XC_bottom_side
58#define DOWN_LEFT_CURSOR XC_bottom_left_corner
59#define DOWN_RIGHT_CURSOR XC_bottom_right_corner
60#define MIDDLE_CURSOR XC_fleur
61
51using namespace resize;62using namespace resize;
5263
53ResizeLogic::ResizeLogic() :64ResizeLogic::ResizeLogic() :
@@ -428,7 +439,7 @@
428 lastMaskY = mask;439 lastMaskY = mask;
429 }440 }
430441
431 mScreen->updateGrab (grabIndex, cursor[i]);442 mScreen->updateGrab (grabIndex, screen->cursorCache (keyCursorNames[i]));
432 }443 }
433 break;444 break;
434 }445 }
@@ -652,36 +663,36 @@
652Cursor663Cursor
653ResizeLogic::cursorFromResizeMask (unsigned int mask)664ResizeLogic::cursorFromResizeMask (unsigned int mask)
654{665{
655 Cursor cursor;666 unsigned int cursor_name;
656667
657 if (mask & ResizeLeftMask)668 if (mask & ResizeLeftMask)
658 {669 {
659 if (mask & ResizeDownMask)670 if (mask & ResizeDownMask)
660 cursor = downLeftCursor;671 cursor_name = DOWN_LEFT_CURSOR;
661 else if (mask & ResizeUpMask)672 else if (mask & ResizeUpMask)
662 cursor = upLeftCursor;673 cursor_name = UP_LEFT_CURSOR;
663 else674 else
664 cursor = leftCursor;675 cursor_name = LEFT_CURSOR;
665 }676 }
666 else if (mask & ResizeRightMask)677 else if (mask & ResizeRightMask)
667 {678 {
668 if (mask & ResizeDownMask)679 if (mask & ResizeDownMask)
669 cursor = downRightCursor;680 cursor_name = DOWN_RIGHT_CURSOR;
670 else if (mask & ResizeUpMask)681 else if (mask & ResizeUpMask)
671 cursor = upRightCursor;682 cursor_name = UP_RIGHT_CURSOR;
672 else683 else
673 cursor = rightCursor;684 cursor_name = RIGHT_CURSOR;
674 }685 }
675 else if (mask & ResizeUpMask)686 else if (mask & ResizeUpMask)
676 {687 {
677 cursor = upCursor;688 cursor_name = UP_CURSOR;
678 }689 }
679 else690 else
680 {691 {
681 cursor = downCursor;692 cursor_name = DOWN_CURSOR;
682 }693 }
683694
684 return cursor;695 return screen->cursorCache (cursor_name);
685}696}
686697
687void698void
@@ -1327,7 +1338,7 @@
1327 Cursor cursor;1338 Cursor cursor;
13281339
1329 if (state & CompAction::StateInitKey)1340 if (state & CompAction::StateInitKey)
1330 cursor = middleCursor;1341 cursor = screen->cursorCache (MIDDLE_CURSOR);
1331 else1342 else
1332 cursor = cursorFromResizeMask (mask);1343 cursor = cursorFromResizeMask (mask);
13331344
13341345
=== modified file 'plugins/resize/src/logic/tests/mock-screen.h'
--- plugins/resize/src/logic/tests/mock-screen.h 2012-08-16 14:04:59 +0000
+++ plugins/resize/src/logic/tests/mock-screen.h 2015-12-02 16:44:19 +0000
@@ -52,6 +52,7 @@
52 MOCK_METHOD2(updateGrab, void(CompScreen::GrabHandle handle, Cursor cursor));52 MOCK_METHOD2(updateGrab, void(CompScreen::GrabHandle handle, Cursor cursor));
53 MOCK_METHOD2(pushGrab, CompScreen::GrabHandle(Cursor cursor, const char *name));53 MOCK_METHOD2(pushGrab, CompScreen::GrabHandle(Cursor cursor, const char *name));
54 MOCK_METHOD2(removeGrab, void(CompScreen::GrabHandle handle, CompPoint *restorePointer));54 MOCK_METHOD2(removeGrab, void(CompScreen::GrabHandle handle, CompPoint *restorePointer));
55 MOCK_METHOD1(cursorCache, Cursor (unsigned int));
5556
56 MOCK_METHOD1(getOption, CompOption*(const CompString &name));57 MOCK_METHOD1(getOption, CompOption*(const CompString &name));
5758
5859
=== modified file 'plugins/resize/src/resize.cpp'
--- plugins/resize/src/resize.cpp 2013-05-15 10:23:30 +0000
+++ plugins/resize/src/resize.cpp 2015-12-02 16:44:19 +0000
@@ -380,7 +380,6 @@
380 logic.options = this;380 logic.options = this;
381381
382 CompOption::Vector atomTemplate;382 CompOption::Vector atomTemplate;
383 Display *dpy = s->dpy ();
384 ResizeOptions::ChangeNotify notify =383 ResizeOptions::ChangeNotify notify =
385 boost::bind (&ResizeScreen::optionChanged, this, _1, _2);384 boost::bind (&ResizeScreen::optionChanged, this, _1, _2);
386385
@@ -404,21 +403,6 @@
404 for (unsigned int i = 0; i < NUM_KEYS; i++)403 for (unsigned int i = 0; i < NUM_KEYS; i++)
405 logic.key[i] = XKeysymToKeycode (s->dpy (), XStringToKeysym (logic.rKeys[i].name));404 logic.key[i] = XKeysymToKeycode (s->dpy (), XStringToKeysym (logic.rKeys[i].name));
406405
407 logic.leftCursor = XCreateFontCursor (dpy, XC_left_side);
408 logic.rightCursor = XCreateFontCursor (dpy, XC_right_side);
409 logic.upCursor = XCreateFontCursor (dpy, XC_top_side);
410 logic.upLeftCursor = XCreateFontCursor (dpy, XC_top_left_corner);
411 logic.upRightCursor = XCreateFontCursor (dpy, XC_top_right_corner);
412 logic.downCursor = XCreateFontCursor (dpy, XC_bottom_side);
413 logic.downLeftCursor = XCreateFontCursor (dpy, XC_bottom_left_corner);
414 logic.downRightCursor = XCreateFontCursor (dpy, XC_bottom_right_corner);
415 logic.middleCursor = XCreateFontCursor (dpy, XC_fleur);
416
417 logic.cursor[0] = logic.leftCursor;
418 logic.cursor[1] = logic.rightCursor;
419 logic.cursor[2] = logic.upCursor;
420 logic.cursor[3] = logic.downCursor;
421
422 optionSetInitiateKeyInitiate (resizeInitiateDefaultMode);406 optionSetInitiateKeyInitiate (resizeInitiateDefaultMode);
423 optionSetInitiateKeyTerminate (resizeTerminate);407 optionSetInitiateKeyTerminate (resizeTerminate);
424 optionSetInitiateButtonInitiate (resizeInitiateDefaultMode);408 optionSetInitiateButtonInitiate (resizeInitiateDefaultMode);
@@ -442,27 +426,6 @@
442426
443ResizeScreen::~ResizeScreen ()427ResizeScreen::~ResizeScreen ()
444{428{
445 Display *dpy = screen->dpy ();
446
447 if (logic.leftCursor)
448 XFreeCursor (dpy, logic.leftCursor);
449 if (logic.rightCursor)
450 XFreeCursor (dpy, logic.rightCursor);
451 if (logic.upCursor)
452 XFreeCursor (dpy, logic.upCursor);
453 if (logic.downCursor)
454 XFreeCursor (dpy, logic.downCursor);
455 if (logic.middleCursor)
456 XFreeCursor (dpy, logic.middleCursor);
457 if (logic.upLeftCursor)
458 XFreeCursor (dpy, logic.upLeftCursor);
459 if (logic.upRightCursor)
460 XFreeCursor (dpy, logic.upRightCursor);
461 if (logic.downLeftCursor)
462 XFreeCursor (dpy, logic.downLeftCursor);
463 if (logic.downRightCursor)
464 XFreeCursor (dpy, logic.downRightCursor);
465
466 delete logic.mScreen;429 delete logic.mScreen;
467 delete logic.cScreen;430 delete logic.cScreen;
468 delete logic.gScreen;431 delete logic.gScreen;
469432
=== modified file 'plugins/resize/src/screen-impl.h'
--- plugins/resize/src/screen-impl.h 2013-01-08 09:17:25 +0000
+++ plugins/resize/src/screen-impl.h 2015-12-02 16:44:19 +0000
@@ -124,6 +124,11 @@
124 return mImpl->height ();124 return mImpl->height ();
125 }125 }
126126
127 virtual Cursor cursorCache (unsigned int cursorName)
128 {
129 return mImpl->cursorCache (cursorName);
130 }
131
127 private:132 private:
128 CompScreen *mImpl;133 CompScreen *mImpl;
129};134};
130135
=== modified file 'plugins/shelf/src/shelf.cpp'
--- plugins/shelf/src/shelf.cpp 2013-05-09 13:43:07 +0000
+++ plugins/shelf/src/shelf.cpp 2015-12-02 16:44:19 +0000
@@ -509,7 +509,7 @@
509 {509 {
510 window->activate ();510 window->activate ();
511 ss->grabbedWindow = window->id ();511 ss->grabbedWindow = window->id ();
512 ss->grabIndex = screen->pushGrab (ss->moveCursor, "shelf");512 ss->grabIndex = screen->pushGrab (screen->cursorCache (XC_fleur), "shelf");
513513
514 ss->lastPointerX = x;514 ss->lastPointerX = x;
515 ss->lastPointerY = y;515 ss->lastPointerY = y;
@@ -760,7 +760,6 @@
760 gScreen (GLScreen::get (screen)),760 gScreen (GLScreen::get (screen)),
761 grabIndex (0),761 grabIndex (0),
762 grabbedWindow (None),762 grabbedWindow (None),
763 moveCursor (XCreateFontCursor (screen->dpy (), XC_fleur)),
764 lastPointerX (0),763 lastPointerX (0),
765 lastPointerY (0)764 lastPointerY (0)
766{765{
@@ -780,11 +779,6 @@
780 _3));779 _3));
781}780}
782781
783ShelfScreen::~ShelfScreen ()
784{
785 if (moveCursor)
786 XFreeCursor (screen->dpy (), moveCursor);
787}
788782
789ShelfWindow::ShelfWindow (CompWindow *window) :783ShelfWindow::ShelfWindow (CompWindow *window) :
790 PluginClassHandler <ShelfWindow, CompWindow> (window),784 PluginClassHandler <ShelfWindow, CompWindow> (window),
791785
=== modified file 'plugins/shelf/src/shelf.h'
--- plugins/shelf/src/shelf.h 2012-09-07 23:29:42 +0000
+++ plugins/shelf/src/shelf.h 2015-12-02 16:44:19 +0000
@@ -145,7 +145,6 @@
145 public:145 public:
146146
147 ShelfScreen (CompScreen *);147 ShelfScreen (CompScreen *);
148 ~ShelfScreen ();
149148
150 CompositeScreen *cScreen;149 CompositeScreen *cScreen;
151 GLScreen *gScreen;150 GLScreen *gScreen;
152151
=== modified file 'plugins/shift/src/shift.cpp'
--- plugins/shift/src/shift.cpp 2013-05-11 09:30:49 +0000
+++ plugins/shift/src/shift.cpp 2015-12-02 16:44:19 +0000
@@ -1968,7 +1968,6 @@
1968 mMvTarget (0),1968 mMvTarget (0),
1969 mMvVelocity (0),1969 mMvVelocity (0),
1970 mInvert (false),1970 mInvert (false),
1971 mCursor (XCreateFontCursor (screen->dpy (), XC_left_ptr)),
1972 mWindows (NULL),1971 mWindows (NULL),
1973 mNWindows (0),1972 mNWindows (0),
1974 mWindowsSize (0),1973 mWindowsSize (0),
@@ -2059,8 +2058,6 @@
2059{2058{
2060 freeWindowTitle ();2059 freeWindowTitle ();
20612060
2062 XFreeCursor (screen->dpy (), mCursor);
2063
2064 if (mWindows)2061 if (mWindows)
2065 free (mWindows);2062 free (mWindows);
20662063
20672064
=== modified file 'plugins/shift/src/shift.h'
--- plugins/shift/src/shift.h 2013-04-27 16:51:53 +0000
+++ plugins/shift/src/shift.h 2015-12-02 16:44:19 +0000
@@ -143,8 +143,6 @@
143 float mMvVelocity;143 float mMvVelocity;
144 bool mInvert;144 bool mInvert;
145 145
146 Cursor mCursor;
147
148 /* only used for sorting */146 /* only used for sorting */
149 CompWindow **mWindows;147 CompWindow **mWindows;
150 int mNWindows;148 int mNWindows;
151149
=== modified file 'plugins/widget/src/widget.cpp'
--- plugins/widget/src/widget.cpp 2013-05-28 21:31:18 +0000
+++ plugins/widget/src/widget.cpp 2015-12-02 16:44:19 +0000
@@ -312,7 +312,7 @@
312 }312 }
313313
314 if (!mGrabIndex)314 if (!mGrabIndex)
315 mGrabIndex = screen->pushGrab (mCursor, "widget");315 mGrabIndex = screen->pushGrab (screen->cursorCache (XC_watch), "widget");
316316
317 enableFunctions (this, true);317 enableFunctions (this, true);
318318
@@ -672,8 +672,7 @@
672 mLastActiveWindow (None),672 mLastActiveWindow (None),
673 mCompizWidgetAtom (XInternAtom (screen->dpy (), "_COMPIZ_WIDGET", false)),673 mCompizWidgetAtom (XInternAtom (screen->dpy (), "_COMPIZ_WIDGET", false)),
674 mFadeTime (0),674 mFadeTime (0),
675 mGrabIndex (0),675 mGrabIndex (0)
676 mCursor (XCreateFontCursor (screen->dpy (), XC_watch))
677{676{
678 CompAction::CallBack cb;677 CompAction::CallBack cb;
679 ChangeNotify notify;678 ChangeNotify notify;
@@ -706,9 +705,6 @@
706{705{
707 screen->matchExpHandlerChangedSetEnabled (this, false);706 screen->matchExpHandlerChangedSetEnabled (this, false);
708 screen->matchExpHandlerChanged ();707 screen->matchExpHandlerChanged ();
709
710 if (mCursor)
711 XFreeCursor (screen->dpy (), mCursor);
712}708}
713709
714WidgetWindow::WidgetWindow (CompWindow *window) :710WidgetWindow::WidgetWindow (CompWindow *window) :
715711
=== modified file 'plugins/widget/src/widget.h'
--- plugins/widget/src/widget.h 2013-05-28 21:31:18 +0000
+++ plugins/widget/src/widget.h 2015-12-02 16:44:19 +0000
@@ -107,7 +107,6 @@
107 WidgetState mState;107 WidgetState mState;
108 int mFadeTime;108 int mFadeTime;
109 CompScreen::GrabHandle mGrabIndex;109 CompScreen::GrabHandle mGrabIndex;
110 Cursor mCursor;
111};110};
112111
113#define WIDGET_SCREEN(screen) \112#define WIDGET_SCREEN(screen) \
114113
=== modified file 'src/event.cpp'
--- src/event.cpp 2015-08-05 11:26:30 +0000
+++ src/event.cpp 2015-12-02 16:44:19 +0000
@@ -1801,6 +1801,11 @@
1801 if (w)1801 if (w)
1802 w->priv->updateClassHints ();1802 w->priv->updateClassHints ();
1803 }1803 }
1804 else if (event->xproperty.atom == XA_RESOURCE_MANAGER)
1805 {
1806 if (event->xproperty.window == privateScreen.rootWindow())
1807 privateScreen.updateResources();
1808 }
1804 break;1809 break;
1805 case MotionNotify:1810 case MotionNotify:
1806 break;1811 break;
18071812
=== modified file 'src/privatescreen.h'
--- src/privatescreen.h 2014-12-02 19:37:10 +0000
+++ src/privatescreen.h 2015-12-02 16:44:19 +0000
@@ -680,6 +680,8 @@
680680
681 void updateScreenInfo ();681 void updateScreenInfo ();
682682
683 void updateResources ();
684
683 Window getActiveWindow (Window root);685 Window getActiveWindow (Window root);
684686
685 void setWindowState (unsigned int state, Window id);687 void setWindowState (unsigned int state, Window id);
@@ -700,6 +702,10 @@
700702
701 void setDefaultWindowAttributes (XWindowAttributes *);703 void setDefaultWindowAttributes (XWindowAttributes *);
702704
705 void updateCursors (const CompString& theme, int size);
706
707 Cursor cursorCache (unsigned int cursorName);
708
703 static void compScreenSnEvent (SnMonitorEvent *event,709 static void compScreenSnEvent (SnMonitorEvent *event,
704 void *userData);710 void *userData);
705711
@@ -763,9 +769,8 @@
763 Window wmSnSelectionWindow;769 Window wmSnSelectionWindow;
764770
765 int clientPointerDeviceId;771 int clientPointerDeviceId;
766 Cursor normalCursor;
767 Cursor busyCursor;
768 Cursor invisibleCursor;772 Cursor invisibleCursor;
773 std::vector<Cursor> cursors;
769 CompRect workArea;774 CompRect workArea;
770775
771 bool initialized;776 bool initialized;
@@ -802,6 +807,7 @@
802 Window xdndWindow;807 Window xdndWindow;
803 compiz::private_screen::PluginManager pluginManager;808 compiz::private_screen::PluginManager pluginManager;
804 compiz::private_screen::WindowManager& windowManager;809 compiz::private_screen::WindowManager& windowManager;
810 CompOption::Vector resourceManager;
805};811};
806812
807class CompManager813class CompManager
@@ -954,8 +960,8 @@
954 void unhookServerWindow (CompWindow *w);960 void unhookServerWindow (CompWindow *w);
955961
956 Cursor normalCursor ();962 Cursor normalCursor ();
957
958 Cursor invisibleCursor ();963 Cursor invisibleCursor ();
964 Cursor cursorCache (unsigned int cursorName);
959965
960 /* Adds an X Pointer and Keyboard grab to the stack. Since966 /* Adds an X Pointer and Keyboard grab to the stack. Since
961 * compiz as a client only need to grab once, multiple clients967 * compiz as a client only need to grab once, multiple clients
@@ -1158,6 +1164,7 @@
1158 virtual void _matchExpHandlerChanged();1164 virtual void _matchExpHandlerChanged();
1159 virtual void _matchPropertyChanged(CompWindow *);1165 virtual void _matchPropertyChanged(CompWindow *);
1160 virtual void _outputChangeNotify();1166 virtual void _outputChangeNotify();
1167 virtual void _cursorChangeNotify(const CompString&, int);
11611168
1162 void grabServer ();1169 void grabServer ();
1163 void ungrabServer ();1170 void ungrabServer ();
11641171
=== modified file 'src/privatescreen/tests/test-privatescreen.cpp'
--- src/privatescreen/tests/test-privatescreen.cpp 2015-09-23 23:17:54 +0000
+++ src/privatescreen/tests/test-privatescreen.cpp 2015-12-02 16:44:19 +0000
@@ -81,6 +81,7 @@
81 MOCK_METHOD0(_matchExpHandlerChanged, void ());81 MOCK_METHOD0(_matchExpHandlerChanged, void ());
82 MOCK_METHOD1(_matchPropertyChanged, void (CompWindow *));82 MOCK_METHOD1(_matchPropertyChanged, void (CompWindow *));
83 MOCK_METHOD0(_outputChangeNotify, void ());83 MOCK_METHOD0(_outputChangeNotify, void ());
84 MOCK_METHOD2(_cursorChangeNotify, void (const CompString&, int));
8485
85 MOCK_METHOD0(outputDevs, CompOutput::vector & ());86 MOCK_METHOD0(outputDevs, CompOutput::vector & ());
86 MOCK_METHOD2(setWindowState, void (unsigned int state, Window id));87 MOCK_METHOD2(setWindowState, void (unsigned int state, Window id));
@@ -175,6 +176,7 @@
175 MOCK_METHOD0(displayString, const char * ());176 MOCK_METHOD0(displayString, const char * ());
176 MOCK_METHOD0(getCurrentOutputExtents, CompRect ());177 MOCK_METHOD0(getCurrentOutputExtents, CompRect ());
177 MOCK_METHOD0(normalCursor, Cursor ());178 MOCK_METHOD0(normalCursor, Cursor ());
179 MOCK_METHOD1(cursorCache, Cursor (unsigned int));
178 MOCK_METHOD0(grabbed, bool ());180 MOCK_METHOD0(grabbed, bool ());
179 MOCK_METHOD0(snDisplay, SnDisplay * ());181 MOCK_METHOD0(snDisplay, SnDisplay * ());
180 MOCK_CONST_METHOD0(createFailed, bool ());182 MOCK_CONST_METHOD0(createFailed, bool ());
181183
=== modified file 'src/screen.cpp'
--- src/screen.cpp 2014-12-02 19:37:10 +0000
+++ src/screen.cpp 2015-12-02 16:44:19 +0000
@@ -44,6 +44,7 @@
4444
45#include <boost/bind.hpp>45#include <boost/bind.hpp>
46#include <boost/foreach.hpp>46#include <boost/foreach.hpp>
47#include <boost/algorithm/string.hpp>
47#define foreach BOOST_FOREACH48#define foreach BOOST_FOREACH
4849
49#include <X11/Xlib.h>50#include <X11/Xlib.h>
@@ -53,6 +54,7 @@
53#include <X11/extensions/shape.h>54#include <X11/extensions/shape.h>
54#include <X11/cursorfont.h>55#include <X11/cursorfont.h>
55#include <X11/extensions/XInput2.h>56#include <X11/extensions/XInput2.h>
57#include <X11/Xcursor/Xcursor.h>
5658
57#include <core/global.h>59#include <core/global.h>
58#include <core/screen.h>60#include <core/screen.h>
@@ -77,10 +79,12 @@
77namespace79namespace
78{80{
79bool inHandleEvent = false;81bool inHandleEvent = false;
80
81bool screenInitalized = false;82bool screenInitalized = false;
82}83}
8384
85#define normalCursorName XC_left_ptr
86#define busyCursorName XC_watch
87
84#define MwmHintsFunctions (1L << 0)88#define MwmHintsFunctions (1L << 0)
85#define MwmHintsDecorations (1L << 1)89#define MwmHintsDecorations (1L << 1)
86static const unsigned short PropMotifWmHintElements = 3;90static const unsigned short PropMotifWmHintElements = 3;
@@ -101,6 +105,14 @@
101105
102PluginClassStorage::Indices screenPluginClassIndices (0);106PluginClassStorage::Indices screenPluginClassIndices (0);
103107
108namespace utils
109{
110bool is_number (CompString const& s)
111{
112 return std::find_if (s.begin (), s.end (), [](char c) { return !std::isdigit (c); }) == s.end ();
113}
114}
115
104void CompScreenImpl::sizePluginClasses(unsigned int size)116void CompScreenImpl::sizePluginClasses(unsigned int size)
105{117{
106 if(size != pluginClasses.size ())118 if(size != pluginClasses.size ())
@@ -1271,8 +1283,8 @@
1271 eventManager.quit ();1283 eventManager.quit ();
1272}1284}
12731285
1274static const std::string IMAGEDIR("images");1286static const CompString IMAGEDIR("images");
1275static const std::string HOMECOMPIZDIR(".compiz-1");1287static const CompString HOMECOMPIZDIR(".compiz-1");
12761288
1277bool1289bool
1278CompScreenImpl::readImageFromFile (CompString &name,1290CompScreenImpl::readImageFromFile (CompString &name,
@@ -1353,6 +1365,68 @@
1353 return w;1365 return w;
1354}1366}
13551367
1368void
1369PrivateScreen::updateResources ()
1370{
1371 Atom actual;
1372 int result, format;
1373 unsigned long n, left;
1374 unsigned char *data;
1375
1376 result = XGetWindowProperty (dpy, root,
1377 XA_RESOURCE_MANAGER, 0L, 65536, False,
1378 XA_STRING, &actual, &format,
1379 &n, &left, &data);
1380
1381 int oldCursorSize = CompOption::getIntOptionNamed (resourceManager, "Xcursor.size", -1);
1382 CompString oldCursorTheme = CompOption::getStringOptionNamed (resourceManager, "Xcursor.theme");
1383 resourceManager.clear ();
1384
1385 if (result == Success && data)
1386 {
1387 if (actual == XA_STRING)
1388 {
1389 std::vector<CompString> lines;
1390 CompString resources (reinterpret_cast<char *> (data));
1391 boost::split (lines, resources, boost::is_any_of ("\n"));
1392
1393 for (auto const& line : lines)
1394 {
1395 std::vector<CompString> pair;
1396 boost::split (pair, line, boost::is_any_of ("\t"));
1397
1398 if (pair.size () == 2 && pair[0].back () == ':')
1399 {
1400 CompOption option;
1401 auto key = pair[0].substr (0, pair[0].size () - 1);
1402 auto const& value = pair[1];
1403
1404 if (utils::is_number (value))
1405 {
1406 option.setName (key, CompOption::TypeInt);
1407 option.value ().set (std::atoi (value.c_str ()));
1408 }
1409 else
1410 {
1411 option.setName (key, CompOption::TypeString);
1412 option.value ().set (value);
1413 }
1414
1415 resourceManager.push_back (option);
1416 }
1417 }
1418 }
1419
1420 XFree (data);
1421 }
1422
1423 int cursorSize = CompOption::getIntOptionNamed (resourceManager, "Xcursor.size", -1);
1424 CompString const& cursorTheme = CompOption::getStringOptionNamed (resourceManager, "Xcursor.theme");
1425
1426 if (cursorSize != oldCursorSize || cursorTheme != oldCursorTheme)
1427 screen->cursorChangeNotify (cursorTheme, cursorSize);
1428}
1429
1356bool1430bool
1357CompScreen::fileToImage (CompString &name,1431CompScreen::fileToImage (CompString &name,
1358 CompSize &size,1432 CompSize &size,
@@ -2078,9 +2152,9 @@
2078 if (priv->initialized)2152 if (priv->initialized)
2079 {2153 {
2080 if (!emptySequence())2154 if (!emptySequence())
2081 XIDefineCursor (priv->dpy, priv->clientPointerDeviceId, priv->rootWindow(), priv->busyCursor);2155 XIDefineCursor (priv->dpy, priv->clientPointerDeviceId, priv->rootWindow(), priv->cursorCache (busyCursorName));
2082 else2156 else
2083 XIDefineCursor (priv->dpy, priv->clientPointerDeviceId, priv->rootWindow(), priv->normalCursor);2157 XIDefineCursor (priv->dpy, priv->clientPointerDeviceId, priv->rootWindow(), priv->cursorCache (normalCursorName));
2084 }2158 }
2085}2159}
20862160
@@ -3012,7 +3086,7 @@
3012Cursor3086Cursor
3013CompScreenImpl::normalCursor ()3087CompScreenImpl::normalCursor ()
3014{3088{
3015 return privateScreen.normalCursor;3089 return privateScreen.cursorCache (normalCursorName);
3016}3090}
30173091
3018Cursor3092Cursor
@@ -3021,6 +3095,12 @@
3021 return privateScreen.invisibleCursor;3095 return privateScreen.invisibleCursor;
3022}3096}
30233097
3098Cursor
3099CompScreenImpl::cursorCache (unsigned int cursorName)
3100{
3101 return privateScreen.cursorCache (cursorName);
3102}
3103
3024#define POINTER_GRAB_MASK (ButtonReleaseMask | \3104#define POINTER_GRAB_MASK (ButtonReleaseMask | \
3025 ButtonPressMask | \3105 ButtonPressMask | \
3026 PointerMotionMask)3106 PointerMotionMask)
@@ -3744,11 +3824,11 @@
3744 setsid ();3824 setsid ();
37453825
3746 pos = env.find (':');3826 pos = env.find (':');
3747 if (pos != std::string::npos)3827 if (pos != CompString::npos)
3748 {3828 {
3749 size_t pointPos = env.find ('.', pos);3829 size_t pointPos = env.find ('.', pos);
37503830
3751 if (pointPos != std::string::npos)3831 if (pointPos != CompString::npos)
3752 {3832 {
3753 env.erase (pointPos);3833 env.erase (pointPos);
3754 }3834 }
@@ -4028,6 +4108,56 @@
4028{4108{
4029}4109}
40304110
4111void
4112CompScreen::cursorChangeNotify (const CompString& theme, int size)
4113{
4114 WRAPABLE_HND_FUNCTN (cursorChangeNotify, theme, size);
4115 _cursorChangeNotify (theme, size);
4116}
4117
4118Cursor
4119PrivateScreen::cursorCache (unsigned int cursorName)
4120{
4121 if (cursorName >= XC_num_glyphs)
4122 return 0;
4123
4124 if (cursors.size() > cursorName && cursors[cursorName])
4125 return cursors[cursorName];
4126
4127 cursors.resize(std::max<size_t>(cursorName + 1, cursors.size()), 0);
4128 cursors[cursorName] = XCreateFontCursor (dpy, cursorName);
4129
4130 return cursors[cursorName];
4131}
4132
4133void
4134PrivateScreen::updateCursors (const CompString& theme, int size)
4135{
4136 if (size > 0)
4137 XcursorSetDefaultSize (dpy, size);
4138
4139 if (!theme.empty())
4140 XcursorSetTheme (dpy, theme.c_str());
4141
4142 for (auto it = begin (cursors); it != end (cursors); ++it)
4143 {
4144 if (*it)
4145 {
4146 XFreeCursor (dpy, *it);
4147 *it = XCreateFontCursor (dpy, it - begin (cursors));
4148 }
4149 }
4150
4151 XIDefineCursor (dpy, clientPointerDeviceId, root, cursorCache (normalCursorName));
4152 startupSequence.updateStartupFeedback ();
4153}
4154
4155void
4156CompScreenImpl::_cursorChangeNotify (const CompString& theme, int size)
4157{
4158 privateScreen.updateCursors (theme, size);
4159}
4160
4031/* Returns default viewport for some window geometry. If the window spans4161/* Returns default viewport for some window geometry. If the window spans
4032 * more than one viewport the most appropriate viewport is returned. How the4162 * more than one viewport the most appropriate viewport is returned. How the
4033 * most appropriate viewport is computed can be made optional if necessary. It4163 * most appropriate viewport is computed can be made optional if necessary. It
@@ -4170,6 +4300,9 @@
4170ScreenInterface::addSupportedAtoms (std::vector<Atom>& atoms)4300ScreenInterface::addSupportedAtoms (std::vector<Atom>& atoms)
4171 WRAPABLE_DEF (addSupportedAtoms, atoms)4301 WRAPABLE_DEF (addSupportedAtoms, atoms)
41724302
4303void
4304ScreenInterface::cursorChangeNotify (const CompString& theme, int size)
4305 WRAPABLE_DEF (cursorChangeNotify, theme, size)
41734306
4174Window4307Window
4175CompScreenImpl::root ()4308CompScreenImpl::root ()
@@ -5022,12 +5155,9 @@
5022 eventManager.setSupportingWmCheck (dpy, rootWindow());5155 eventManager.setSupportingWmCheck (dpy, rootWindow());
5023 screen->updateSupportedWmHints ();5156 screen->updateSupportedWmHints ();
50245157
5158
5025 XIGetClientPointer (dpy, None, &clientPointerDeviceId);5159 XIGetClientPointer (dpy, None, &clientPointerDeviceId);
50265160 updateResources ();
5027 normalCursor = XCreateFontCursor (dpy, XC_left_ptr);
5028 busyCursor = XCreateFontCursor (dpy, XC_watch);
5029
5030 XIDefineCursor (dpy, clientPointerDeviceId, rootWindow(), normalCursor);
50315161
5032 /* Attempt to gain SubstructureRedirectMask */5162 /* Attempt to gain SubstructureRedirectMask */
5033 CompScreenImpl::checkForError (dpy);5163 CompScreenImpl::checkForError (dpy);
@@ -5203,8 +5333,6 @@
5203 currentDesktop (0),5333 currentDesktop (0),
5204 wmSnSelectionWindow (None),5334 wmSnSelectionWindow (None),
5205 clientPointerDeviceId (None),5335 clientPointerDeviceId (None),
5206 normalCursor (None),
5207 busyCursor (None),
5208 invisibleCursor (None),5336 invisibleCursor (None),
5209 initialized (false),5337 initialized (false),
5210 screen(screen),5338 screen(screen),
@@ -5325,11 +5453,8 @@
53255453
5326 eventManager.destroyGrabWindow (dpy);5454 eventManager.destroyGrabWindow (dpy);
53275455
5328 if (normalCursor != None)5456 for (auto cursor : cursors)
5329 XFreeCursor (dpy, normalCursor);5457 XFreeCursor (dpy, cursor);
5330
5331 if (busyCursor != None)
5332 XFreeCursor (dpy, busyCursor);
53335458
5334 if (invisibleCursor != None)5459 if (invisibleCursor != None)
5335 XFreeCursor (dpy, invisibleCursor);5460 XFreeCursor (dpy, invisibleCursor);

Subscribers

People subscribed via source and target branches