Enable focus in event handling in Client
This commit is contained in:
parent
bf775b1c0e
commit
6af74b86f4
2 changed files with 8 additions and 8 deletions
2
client.h
2
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();
|
||||
|
||||
|
|
14
events.cpp
14
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<xcb_focus_in_event_t*>(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
|
||||
|
|
Loading…
Reference in a new issue