// called from Client after FocusIn that wasn't initiated by KWin and the client // wasn't allowed to activate void Workspace::restoreFocus() { // this updateXTime() is necessary - as FocusIn events don't have // a timestamp *sigh*, twin's timestamp would be older than the timestamp // that was used by whoever caused the focus change, and therefore // the attempt to restore the focus would fail due to old timestamp updateXTime(); if( should_get_focus.count() > 0 ) requestFocus( should_get_focus.last()); else if( last_active_client ) requestFocus( last_active_client ); }
bool ScreenEdge::isEntered(XEvent* e) { if (e->type == EnterNotify) { for (int i = 0; i < ELECTRIC_COUNT; ++i) if (m_screenEdgeWindows[i] != None && e->xcrossing.window == m_screenEdgeWindows[i]) { // The user entered an electric border check(QPoint(e->xcrossing.x_root, e->xcrossing.y_root), e->xcrossing.time); return true; } } if (e->type == ClientMessage) { if (e->xclient.message_type == atoms->xdnd_position) { for (int i = 0; i < ELECTRIC_COUNT; ++i) if (m_screenEdgeWindows[i] != None && e->xclient.window == m_screenEdgeWindows[i]) { updateXTime(); check(QPoint(e->xclient.data.l[2] >> 16, e->xclient.data.l[2] & 0xffff), xTime()); return true; } } }