diff options
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-events')
-rw-r--r-- | src-qt5/core/lumina-desktop-unified/src-events/LXcbEventFilter.cpp | 24 | ||||
-rw-r--r-- | src-qt5/core/lumina-desktop-unified/src-events/LXcbEventFilter.h | 1 |
2 files changed, 15 insertions, 10 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-events/LXcbEventFilter.cpp b/src-qt5/core/lumina-desktop-unified/src-events/LXcbEventFilter.cpp index e04ee924..ced2cadb 100644 --- a/src-qt5/core/lumina-desktop-unified/src-events/LXcbEventFilter.cpp +++ b/src-qt5/core/lumina-desktop-unified/src-events/LXcbEventFilter.cpp @@ -22,7 +22,7 @@ #define SYSTEM_TRAY_CANCEL_MESSAGE 2 -#define DEBUG 1 +#define DEBUG 0 // Also keep the root window/screen around for use in the filters namespace L_XCB{ @@ -64,6 +64,10 @@ void EventFilter::stop(){ QList<WId> EventFilter::currentTrayApps(){ return static_cast<XCBEventFilter*>(EF)->trayApps(); } +// === PUBLIC SLOTS === +void EventFilter::RegisterVirtualRoot(WId id){ + XCB->WM_Set_Virtual_Roots( QList<WId>() << id ); +} //============================= // XCBEventFilter Class @@ -121,19 +125,19 @@ bool XCBEventFilter::nativeEventFilter(const QByteArray &eventType, void *messag //============================== case XCB_KEY_PRESS: //This is a keyboard key press - //qDebug() << "Key Press Event"; + qDebug() << "Key Press Event"; obj->emit NewInputEvent(); stopevent = BlockInputEvent( ((xcb_key_press_event_t *) ev)->root ); //use the main "root" window - not the child widget break; case XCB_KEY_RELEASE: //This is a keyboard key release - //qDebug() << "Key Release Event"; + qDebug() << "Key Release Event"; obj->emit NewInputEvent(); stopevent = BlockInputEvent( ((xcb_key_release_event_t *) ev)->root ); //use the main "root" window - not the child widget break; case XCB_BUTTON_PRESS: //This is a mouse button press - //qDebug() << "Button Press Event"; + qDebug() << "Button Press Event"; obj->emit NewInputEvent(); stopevent = BlockInputEvent( ((xcb_button_press_event_t *) ev)->root ); //use the main "root" window - not the child widget if(!stopevent){ @@ -145,7 +149,7 @@ bool XCBEventFilter::nativeEventFilter(const QByteArray &eventType, void *messag break; case XCB_BUTTON_RELEASE: //This is a mouse button release - //qDebug() << "Button Release Event"; + qDebug() << "Button Release Event"; //xcb_button_release_event_t *tmp = (xcb_button_release_event_t *)ev; stopevent = BlockInputEvent( ((xcb_button_release_event_t *) ev)->root ); //use the main "root" window - not the child widget break; @@ -157,19 +161,19 @@ bool XCBEventFilter::nativeEventFilter(const QByteArray &eventType, void *messag break; case XCB_ENTER_NOTIFY: //This is a mouse movement event when mouse goes over a new window - //qDebug() << "Enter Notify Event"; + qDebug() << "Enter Notify Event"; obj->emit NewInputEvent(); stopevent = BlockInputEvent( ((xcb_enter_notify_event_t *) ev)->root ); break; case XCB_LEAVE_NOTIFY: //This is a mouse movement event when mouse goes leaves a window - //qDebug() << "Leave Notify Event"; + qDebug() << "Leave Notify Event"; obj->emit NewInputEvent(); stopevent = BlockInputEvent(); break; //============================== case XCB_EXPOSE: - //qDebug() << "Expose Notify Event:"; + qDebug() << "Expose Notify Event:"; //qDebug() << " - Given Window:" << ((xcb_property_notify_event_t*)ev)->window; break; //============================== @@ -205,12 +209,12 @@ bool XCBEventFilter::nativeEventFilter(const QByteArray &eventType, void *messag break; //============================== case XCB_PROPERTY_NOTIFY: - //qDebug() << "Property Notify Event:"; + qDebug() << "Property Notify Event:"; //qDebug() << " - Given Window:" << ((xcb_property_notify_event_t*)ev)->window; break; //============================== case XCB_CLIENT_MESSAGE: - //qDebug() << "Client Message Event"; + qDebug() << "Client Message Event"; //qDebug() << " - Given Window:" << ((xcb_client_message_event_t*)ev)->window; if( ((xcb_client_message_event_t*)ev)->type == _NET_SYSTEM_TRAY_OPCODE && ((xcb_client_message_event_t*)ev)->format == 32){ //data32[0] is timestamp, [1] is opcode, [2] is window handle diff --git a/src-qt5/core/lumina-desktop-unified/src-events/LXcbEventFilter.h b/src-qt5/core/lumina-desktop-unified/src-events/LXcbEventFilter.h index 713d97a0..bd235658 100644 --- a/src-qt5/core/lumina-desktop-unified/src-events/LXcbEventFilter.h +++ b/src-qt5/core/lumina-desktop-unified/src-events/LXcbEventFilter.h @@ -62,6 +62,7 @@ public: LXCB *XCB; //used to interact with the X11 graphics subsystem public slots: + void RegisterVirtualRoot(WId); signals: void NewInputEvent(); |