From 6b06779a64e0b03d18862c685227ef08ac2371b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 18 Feb 2016 11:18:50 +0100 Subject: [PATCH] Port Workspace::requestDelayFocus to AbstractClient And also call cancelDelayFocus when removing a ShellClient. --- workspace.cpp | 5 ++++- workspace.h | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/workspace.cpp b/workspace.cpp index 0488da6b88..a7d574dd45 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -399,6 +399,9 @@ void Workspace::init() connect(w, &WaylandServer::shellClientRemoved, this, [this] (ShellClient *c) { m_allClients.removeAll(c); + if (c == delayfocus_client) { + cancelDelayFocus(); + } clientHidden(c); emit clientRemoved(c); x_stacking_dirty = true; @@ -1207,7 +1210,7 @@ void Workspace::delayFocus() cancelDelayFocus(); } -void Workspace::requestDelayFocus(Client* c) +void Workspace::requestDelayFocus(AbstractClient* c) { delayfocus_client = c; delete delayFocusTimer; diff --git a/workspace.h b/workspace.h index 4191f70aca..1c4d8a737b 100644 --- a/workspace.h +++ b/workspace.h @@ -325,7 +325,7 @@ public: int packPositionDown(const AbstractClient* cl, int oldy, bool bottom_edge) const; void cancelDelayFocus(); - void requestDelayFocus(Client*); + void requestDelayFocus(AbstractClient*); /** * updates the mouse position to track whether a focus follow mouse focus change was caused by @@ -535,7 +535,7 @@ private: // Delay(ed) window focus timer and client QTimer* delayFocusTimer; - Client* delayfocus_client; + AbstractClient* delayfocus_client; QPoint focusMousePos; ClientList clients;