Enable unmap notify event handling in Client

Interestingly the attribute send_event from XUnmapEvent does not exist in
xcb_unmap_notify_event_t and also the X protocol doesn't know anything
about send event.
This commit is contained in:
Martin Gräßlin 2013-07-26 13:34:54 +02:00
parent df4b43ea78
commit 958e47b36c
2 changed files with 8 additions and 5 deletions

View file

@ -673,7 +673,7 @@ private:
// Handlers for X11 events
bool mapRequestEvent(XMapRequestEvent* e);
void unmapNotifyEvent(XUnmapEvent* e);
void unmapNotifyEvent(xcb_unmap_notify_event_t *e);
void destroyNotifyEvent(XDestroyWindowEvent* e);
void configureRequestEvent(XConfigureRequestEvent* e);
virtual void propertyNotifyEvent(xcb_property_notify_event_t *e) override;

View file

@ -494,10 +494,10 @@ bool Client::windowEvent(xcb_generic_event_t *e)
const uint8_t eventType = e->response_type & ~0x80;
switch(eventType) {
#if KWIN_QT5_PORTING
case UnmapNotify:
unmapNotifyEvent(&e->xunmap);
case XCB_UNMAP_NOTIFY:
unmapNotifyEvent(reinterpret_cast<xcb_unmap_notify_event_t*>(e));
break;
#if KWIN_QT5_PORTING
case DestroyNotify:
destroyNotifyEvent(&e->xdestroywindow);
break;
@ -624,10 +624,12 @@ bool Client::mapRequestEvent(XMapRequestEvent* e)
/*!
Handles unmap notify events of the client window
*/
void Client::unmapNotifyEvent(XUnmapEvent* e)
void Client::unmapNotifyEvent(xcb_unmap_notify_event_t *e)
{
if (e->window != window())
return;
#warning unmap notify event doesn't have a sendEvent attribute, where did it come from in XUnmapNotify?
#if KWIN_QT5_PORTING
if (e->event != wrapperId()) {
// most probably event from root window when initially reparenting
bool ignore = true;
@ -636,6 +638,7 @@ void Client::unmapNotifyEvent(XUnmapEvent* e)
if (ignore)
return;
}
#endif
// check whether this is result of an XReparentWindow - client then won't be parented by wrapper
// in this case do not release the client (causes reparent to root, removal from saveSet and what not)