diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d93b2c2f6d8acf8f22ff816cd719ee483d40c0c..eca53f06555006aed052de34792cf712ee09b9d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,6 +101,7 @@ set (COMPIZ_REQUIRES xext xdamage xcomposite + xcursor x11-xcb xrandr xinerama diff --git a/src/privatescreen.h b/src/privatescreen.h index 555510993874dd20787eb3c7aea1c249da1235c9..2efb53109cfd5ba094f49dbd4ecd254967ad399d 100644 --- a/src/privatescreen.h +++ b/src/privatescreen.h @@ -710,6 +710,8 @@ class PrivateScreen : void setDefaultWindowAttributes (XWindowAttributes *); + void updateCursors (const CompString& theme, int size); + static void compScreenSnEvent (SnMonitorEvent *event, void *userData); diff --git a/src/screen.cpp b/src/screen.cpp index 273a7f94dd243a560c303c43887cc54fa82d9027..eace9ecb8fe8102539537b7fa1f6b0f97d071a7f 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -54,6 +54,7 @@ #include #include #include +#include #include #include @@ -4153,8 +4154,26 @@ CompScreen::cursorChangeNotify (const CompString& theme, int size) _cursorChangeNotify (theme, size); } -void CompScreenImpl::_cursorChangeNotify (const CompString&, int) +void +PrivateScreen::updateCursors (const CompString& theme, int size) +{ + XFreeCursor (dpy, normalCursor); + XFreeCursor (dpy, busyCursor); + + XcursorSetDefaultSize (dpy, size); + XcursorSetTheme (dpy, theme.c_str()); + + normalCursor = XCreateFontCursor (dpy, XC_left_ptr); + busyCursor = XCreateFontCursor (dpy, XC_watch); + + XIDefineCursor (dpy, clientPointerDeviceId, root, normalCursor); + startupSequence.updateStartupFeedback (); +} + +void +CompScreenImpl::_cursorChangeNotify (const CompString& theme, int size) { + privateScreen.updateCursors (theme, size); } /* Returns default viewport for some window geometry. If the window spans @@ -5154,14 +5173,10 @@ PrivateScreen::initDisplay (const char *name, cps::History& history, unsigned in eventManager.setSupportingWmCheck (dpy, rootWindow()); screen->updateSupportedWmHints (); - updateResources (); XIGetClientPointer (dpy, None, &clientPointerDeviceId); - - normalCursor = XCreateFontCursor (dpy, XC_left_ptr); - busyCursor = XCreateFontCursor (dpy, XC_watch); - - XIDefineCursor (dpy, clientPointerDeviceId, rootWindow(), normalCursor); + updateCursors (XcursorGetTheme (dpy), XcursorGetDefaultSize (dpy)); + updateResources (); /* Attempt to gain SubstructureRedirectMask */ CompScreenImpl::checkForError (dpy);