From 6af74b86f4b49447ec730a693b515286fbb6bfd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 26 Jul 2013 14:35:28 +0200 Subject: [PATCH] Enable focus in event handling in Client --- client.h | 2 +- events.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client.h b/client.h index 5ee928ef56..d69fd7dd33 100644 --- a/client.h +++ b/client.h @@ -680,7 +680,7 @@ private: void clientMessageEvent(XClientMessageEvent* e); void enterNotifyEvent(xcb_enter_notify_event_t *e); void leaveNotifyEvent(xcb_leave_notify_event_t *e); - void focusInEvent(XFocusInEvent* e); + void focusInEvent(xcb_focus_in_event_t *e); void focusOutEvent(XFocusOutEvent* e); virtual void damageNotifyEvent(); diff --git a/events.cpp b/events.cpp index a2b159567a..0c45c335b1 100644 --- a/events.cpp +++ b/events.cpp @@ -564,10 +564,10 @@ bool Client::windowEvent(xcb_generic_event_t *e) // workspace()->updateFocusMousePosition( QPoint( e->xcrossing.x_root, e->xcrossing.y_root )); break; } -#if KWIN_QT5_PORTING - case FocusIn: - focusInEvent(&e->xfocus); + case XCB_FOCUS_IN: + focusInEvent(reinterpret_cast(e)); break; +#if KWIN_QT5_PORTING case FocusOut: focusOutEvent(&e->xfocus); break; @@ -1336,13 +1336,13 @@ bool Client::motionNotifyEvent(xcb_window_t w, int state, int x, int y, int x_ro return true; } -void Client::focusInEvent(XFocusInEvent* e) +void Client::focusInEvent(xcb_focus_in_event_t *e) { - if (e->window != window()) + if (e->event != window()) return; // only window gets focus - if (e->mode == NotifyUngrab) + if (e->mode == XCB_NOTIFY_MODE_UNGRAB) return; // we don't care - if (e->detail == NotifyPointer) + if (e->detail == XCB_NOTIFY_DETAIL_POINTER) return; // we don't care if (!isShown(false) || !isOnCurrentDesktop()) // we unmapped it, but it got focus meanwhile -> return; // activateNextClient() already transferred focus elsewhere