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.
This commit is contained in:
Martin Gräßlin 2013-07-26 13:00:51 +02:00
parent ce10105dfc
commit 62c044601b
2 changed files with 7 additions and 18 deletions

View file

@ -1524,14 +1524,14 @@ bool Unmanaged::windowEvent(xcb_generic_event_t *e)
emit opacityChanged(this, old_opacity); emit opacityChanged(this, old_opacity);
} }
} }
switch(e->type) { #endif
case UnmapNotify: const uint8_t eventType = e->response_type & ~0x80;
switch (eventType) {
case XCB_UNMAP_NOTIFY:
workspace()->updateFocusMousePosition(Cursor::pos()); workspace()->updateFocusMousePosition(Cursor::pos());
unmapNotifyEvent(&e->xunmap); release();
break;
case MapNotify:
mapNotifyEvent(&e->xmap);
break; break;
#if KWIN_QT5_PORTING
case ConfigureNotify: case ConfigureNotify:
configureNotifyEvent(&e->xconfigure); configureNotifyEvent(&e->xconfigure);
break; break;
@ -1549,20 +1549,11 @@ bool Unmanaged::windowEvent(xcb_generic_event_t *e)
damageNotifyEvent(); damageNotifyEvent();
break; break;
} }
}
#endif #endif
}
return false; // don't eat events, even our own unmanaged widgets are tracked 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) void Unmanaged::configureNotifyEvent(XConfigureEvent* e)
{ {
if (effects) if (effects)

View file

@ -53,8 +53,6 @@ protected:
private: private:
virtual ~Unmanaged(); // use release() virtual ~Unmanaged(); // use release()
// handlers for X11 events // handlers for X11 events
void mapNotifyEvent(XMapEvent* e);
void unmapNotifyEvent(XUnmapEvent*e);
void configureNotifyEvent(XConfigureEvent* e); void configureNotifyEvent(XConfigureEvent* e);
}; };