From 62c044601b8bc542233db40c930b9492cdb3b77d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 26 Jul 2013 13:00:51 +0200 Subject: [PATCH] Enable (un)map notify event filtering in Unmanaged The specific methods are dropped as UnmapNotify event is not used at all and just delegates to another method and map notify was noop. --- events.cpp | 23 +++++++---------------- unmanaged.h | 2 -- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/events.cpp b/events.cpp index acd0fcb4f5..271bff77ac 100644 --- a/events.cpp +++ b/events.cpp @@ -1524,14 +1524,14 @@ bool Unmanaged::windowEvent(xcb_generic_event_t *e) emit opacityChanged(this, old_opacity); } } - switch(e->type) { - case UnmapNotify: +#endif + const uint8_t eventType = e->response_type & ~0x80; + switch (eventType) { + case XCB_UNMAP_NOTIFY: workspace()->updateFocusMousePosition(Cursor::pos()); - unmapNotifyEvent(&e->xunmap); - break; - case MapNotify: - mapNotifyEvent(&e->xmap); + release(); break; +#if KWIN_QT5_PORTING case ConfigureNotify: configureNotifyEvent(&e->xconfigure); break; @@ -1549,20 +1549,11 @@ bool Unmanaged::windowEvent(xcb_generic_event_t *e) damageNotifyEvent(); break; } - } #endif + } return false; // don't eat events, even our own unmanaged widgets are tracked } -void Unmanaged::mapNotifyEvent(XMapEvent*) -{ -} - -void Unmanaged::unmapNotifyEvent(XUnmapEvent*) -{ - release(); -} - void Unmanaged::configureNotifyEvent(XConfigureEvent* e) { if (effects) diff --git a/unmanaged.h b/unmanaged.h index dd8d4d3699..c52ff9ba91 100644 --- a/unmanaged.h +++ b/unmanaged.h @@ -53,8 +53,6 @@ protected: private: virtual ~Unmanaged(); // use release() // handlers for X11 events - void mapNotifyEvent(XMapEvent* e); - void unmapNotifyEvent(XUnmapEvent*e); void configureNotifyEvent(XConfigureEvent* e); };