diff options
author | Ken Moore <moorekou@gmail.com> | 2015-11-03 13:32:35 -0500 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-11-03 13:32:35 -0500 |
commit | 8417684b84a2ff4bb07c28c89274c045fd4104f8 (patch) | |
tree | 754ade19c856f79c00e3fdf3d9c220d62aa87e97 /lumina-wm-INCOMPLETE/LXcbEventFilter.cpp | |
parent | Add all the animations framework for the screensaver side of lumina-wm (with ... (diff) | |
download | lumina-8417684b84a2ff4bb07c28c89274c045fd4104f8.tar.gz lumina-8417684b84a2ff4bb07c28c89274c045fd4104f8.tar.bz2 lumina-8417684b84a2ff4bb07c28c89274c045fd4104f8.zip |
Clean up the Screensaver framework a bit more, add a test flag (--test-ss), and fix up the starting of screensavers on all screens simultaneously.
This solidifies the Screensaver plugin framework as completely functional - just need to finish up the lock/unlock screen now.
Diffstat (limited to 'lumina-wm-INCOMPLETE/LXcbEventFilter.cpp')
-rw-r--r-- | lumina-wm-INCOMPLETE/LXcbEventFilter.cpp | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/lumina-wm-INCOMPLETE/LXcbEventFilter.cpp b/lumina-wm-INCOMPLETE/LXcbEventFilter.cpp index 00639a27..ba825b90 100644 --- a/lumina-wm-INCOMPLETE/LXcbEventFilter.cpp +++ b/lumina-wm-INCOMPLETE/LXcbEventFilter.cpp @@ -6,15 +6,19 @@ //=========================================== #include "LXcbEventFilter.h" -//For all the XCB interactions and atoms -// is accessed via -// XCB->EWMH.(atom name) -// XCB->(do something) +//================================================== +// NOTE: All the XCB interactions and atoms are accessed via: +// LWM::SYSTEM->EWMH.(atom name) +// LWM::SYSTEM->(do something) +// (LWM::SYSTEM is the global XCB structure) +//================================================== + #include <LuminaX11.h> #include <QDebug> //#include <xcb/screensaver.h> +#define DEBUG 1 // Also keep the root window/screen around for use in the filters namespace L_XCB{ xcb_screen_t *root_screen; @@ -29,22 +33,11 @@ EventFilter::EventFilter() : QObject(){ } void EventFilter::start(){ + if(DEBUG){ qDebug() << " - Install event filter..."; } QCoreApplication::instance()->installNativeEventFilter(EF); - xcb_generic_error_t *status; - xcb_connection_t *my_connection; - xcb_void_cookie_t window_attributes; - const unsigned int *returned; - //Also ensure it gets root window events - - //Need the "real" root window (not the virtual root which Qt might return - my_connection = QX11Info::connection(); - returned = (uint32_t *) ROOT_EVENT_MASK; - window_attributes = xcb_change_window_attributes_checked(my_connection, L_XCB::root, XCB_CW_EVENT_MASK, returned); - status = xcb_request_check(my_connection, window_attributes); - - // if( 0!= xcb_request_check( QX11Info::connection(), xcb_change_window_attributes_checked(QX11Info::connection(), L_XCB::root, XCB_CW_EVENT_MASK, (uint32_t[]){ROOT_EVENT_MASK} ) ) ){ - if (status) - { + if(DEBUG){ qDebug() << " - Run request check..."; } + xcb_generic_error_t *status = xcb_request_check( QX11Info::connection(), xcb_change_window_attributes_checked(QX11Info::connection(), L_XCB::root, XCB_CW_EVENT_MASK, (uint32_t[]){ROOT_EVENT_MASK} ) ); + if(status){ qCritical() << "[ERROR] Unable to setup WM event retrieval. Is another WM running?"; exit(1); } |