Enable enter/leave notify event handling

This commit is contained in:
Martin Gräßlin 2013-07-26 11:24:19 +02:00
parent 939c2d14c1
commit 70f93c12a8

View file

@ -272,10 +272,9 @@ bool Workspace::workspaceEvent(xcb_generic_event_t *e)
return (event->event != event->window); // hide wm typical event from Qt return (event->event != event->window); // hide wm typical event from Qt
} }
#if KWIN_QT5_PORTING case XCB_ENTER_NOTIFY: {
case EnterNotify: {
if (QWhatsThis::inWhatsThisMode()) { if (QWhatsThis::inWhatsThisMode()) {
QWidget* w = QWidget::find(e->xcrossing.window); QWidget* w = QWidget::find(reinterpret_cast<xcb_enter_notify_event_t*>(e)->event);
if (w) if (w)
QWhatsThis::leaveWhatsThisMode(); QWhatsThis::leaveWhatsThisMode();
} }
@ -285,15 +284,17 @@ bool Workspace::workspaceEvent(xcb_generic_event_t *e)
#endif #endif
break; break;
} }
case LeaveNotify: { case XCB_LEAVE_NOTIFY: {
if (!QWhatsThis::inWhatsThisMode()) if (!QWhatsThis::inWhatsThisMode())
break; break;
// TODO is this cliente ever found, given that client events are searched above? // TODO is this cliente ever found, given that client events are searched above?
Client* c = findClient(FrameIdMatchPredicate(e->xcrossing.window)); const auto *event = reinterpret_cast<xcb_leave_notify_event_t*>(e);
if (c && e->xcrossing.detail != NotifyInferior) Client* c = findClient(FrameIdMatchPredicate(event->event));
if (c && event->detail != XCB_NOTIFY_DETAIL_INFERIOR)
QWhatsThis::leaveWhatsThisMode(); QWhatsThis::leaveWhatsThisMode();
break; break;
} }
#if KWIN_QT5_PORTING
case ConfigureRequest: { case ConfigureRequest: {
if (e->xconfigurerequest.parent == rootWindow()) { if (e->xconfigurerequest.parent == rootWindow()) {
XWindowChanges wc; XWindowChanges wc;