From 484f9b6e65214f20445aae1140a7171f89a2443d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 6 Mar 2015 14:45:58 +0100 Subject: [PATCH] Workspace::activateClient and ::requestFocus changed to AbstractClient requestFocus delegates to takeActivity which is not yet adjusted but performs a nullptr check, thus we pass a casted Client. --- abstract_client.h | 1 + activation.cpp | 11 +++++++---- client.h | 2 +- workspace.h | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/abstract_client.h b/abstract_client.h index 795faea335..a6572113da 100644 --- a/abstract_client.h +++ b/abstract_client.h @@ -71,6 +71,7 @@ public: virtual void setOnAllDesktops(bool set) = 0; virtual void setDesktop(int) = 0; virtual void minimize(bool avoid_animation = false) = 0; + virtual void unminimize(bool avoid_animation = false)= 0; virtual void setFullScreen(bool set, bool user = true) = 0; virtual bool keepAbove() const = 0; virtual void setKeepAbove(bool) = 0; diff --git a/activation.cpp b/activation.cpp index 5ceee90809..5bb3a73d60 100644 --- a/activation.cpp +++ b/activation.cpp @@ -287,7 +287,7 @@ void Workspace::setActiveClient(Client* c) \sa stActiveClient(), requestFocus() */ -void Workspace::activateClient(Client* c, bool force) +void Workspace::activateClient(AbstractClient* c, bool force) { if (c == NULL) { focusToNull(); @@ -322,7 +322,10 @@ void Workspace::activateClient(Client* c, bool force) // E.g. typing URL in minicli which will show kio_uiserver dialog (with workaround), // and then kdesktop shows dialog about SSL certificate. // This needs also avoiding user creation time in Client::readUserTimeMapTimestamp(). - c->updateUserTime(); + if (Client *client = dynamic_cast(c)) { + // updateUserTime is X11 specific + client->updateUserTime(); + } } /*! @@ -332,9 +335,9 @@ void Workspace::activateClient(Client* c, bool force) \sa Workspace::activateClient() */ -void Workspace::requestFocus(Client* c, bool force) +void Workspace::requestFocus(AbstractClient* c, bool force) { - takeActivity(c, force ? ActivityFocusForce : ActivityFocus); + takeActivity(dynamic_cast(c), force ? ActivityFocusForce : ActivityFocus); } void Workspace::takeActivity(Client* c, ActivityFlags flags) diff --git a/client.h b/client.h index 13f57af708..d5ea957f3e 100644 --- a/client.h +++ b/client.h @@ -538,7 +538,7 @@ public: void setMinimized(bool set); void minimize(bool avoid_animation = false) override; - void unminimize(bool avoid_animation = false); + void unminimize(bool avoid_animation = false) override; void killWindow(); void maximize(MaximizeMode) override; void toggleShade(); diff --git a/workspace.h b/workspace.h index ff3a9be05e..906c5a2028 100644 --- a/workspace.h +++ b/workspace.h @@ -148,8 +148,8 @@ public: Client* clientUnderMouse(int screen) const; - void activateClient(Client*, bool force = false); - void requestFocus(Client* c, bool force = false); + void activateClient(AbstractClient*, bool force = false); + void requestFocus(AbstractClient* c, bool force = false); enum ActivityFlag { ActivityFocus = 1 << 0, // focus the window ActivityFocusForce = 1 << 1 | ActivityFocus, // focus even if Dock etc.