diff --git a/abstract_client.cpp b/abstract_client.cpp
index 1d788c2f30..2bc0104efa 100644
--- a/abstract_client.cpp
+++ b/abstract_client.cpp
@@ -43,4 +43,16 @@ bool AbstractClient::isTransient() const
return false;
}
+TabGroup *AbstractClient::tabGroup() const
+{
+ return nullptr;
+}
+
+bool AbstractClient::untab(const QRect &toGeometry, bool clientRemoved)
+{
+ Q_UNUSED(toGeometry)
+ Q_UNUSED(clientRemoved)
+ return false;
+}
+
}
diff --git a/abstract_client.h b/abstract_client.h
index 9a1befe32c..12a5afc5f9 100644
--- a/abstract_client.h
+++ b/abstract_client.h
@@ -21,10 +21,13 @@ along with this program. If not, see .
#define KWIN_ABSTRACT_CLIENT_H
#include "toplevel.h"
+#include "options.h"
namespace KWin
{
+class TabGroup;
+
namespace TabBox
{
class TabBoxClientImpl;
@@ -63,6 +66,20 @@ public:
virtual void sendToScreen(int screen) = 0;
virtual const QKeySequence &shortcut() const = 0;
virtual void setShortcut(const QString &cut) = 0;
+ virtual bool performMouseCommand(Options::MouseCommand, const QPoint &globalPos) = 0;
+ virtual void setOnAllDesktops(bool set) = 0;
+ virtual void minimize(bool avoid_animation = false) = 0;
+ virtual void setFullScreen(bool set, bool user = true) = 0;
+ virtual bool keepAbove() const = 0;
+ virtual void setKeepAbove(bool) = 0;
+ virtual bool keepBelow() const = 0;
+ virtual void setKeepBelow(bool) = 0;
+ virtual TabGroup *tabGroup() const;
+ Q_INVOKABLE virtual bool untab(const QRect &toGeometry = QRect(), bool clientRemoved = false);
+ virtual MaximizeMode maximizeMode() const = 0;
+ virtual void maximize(MaximizeMode) = 0;
+ virtual bool noBorder() const = 0;
+ virtual void setNoBorder(bool set) = 0;
// TODO: remove boolean trap
static bool belongToSameApplication(const AbstractClient* c1, const AbstractClient* c2, bool active_hack = false);
diff --git a/client.h b/client.h
index 50553c68e9..f643faa442 100644
--- a/client.h
+++ b/client.h
@@ -356,7 +356,7 @@ public:
virtual int desktop() const;
void setDesktop(int);
- void setOnAllDesktops(bool set);
+ void setOnAllDesktops(bool set) override;
void sendToScreen(int screen) override;
@@ -380,7 +380,7 @@ public:
bool isMinimized() const override;
bool isMaximizable() const;
QRect geometryRestore() const;
- MaximizeMode maximizeMode() const;
+ MaximizeMode maximizeMode() const override;
enum QuickTileFlag {
QuickTileNone = 0,
@@ -399,7 +399,7 @@ public:
void setMaximize(bool vertically, bool horizontally);
QRect iconGeometry() const;
- void setFullScreen(bool set, bool user = true);
+ void setFullScreen(bool set, bool user = true) override;
bool isFullScreen() const override;
bool isFullScreenable(bool fullscreen_hack = false) const;
bool isActiveFullScreen() const;
@@ -411,8 +411,8 @@ public:
return fullscreen_mode; // only for session saving
}
- bool noBorder() const;
- void setNoBorder(bool set);
+ bool noBorder() const override;
+ void setNoBorder(bool set) override;
bool userCanSetNoBorder() const;
void checkNoBorder();
@@ -425,10 +425,10 @@ public:
bool skipSwitcher() const override;
void setSkipSwitcher(bool set);
- bool keepAbove() const;
- void setKeepAbove(bool);
- bool keepBelow() const;
- void setKeepBelow(bool);
+ bool keepAbove() const override;
+ void setKeepAbove(bool) override;
+ bool keepBelow() const override;
+ void setKeepBelow(bool) override;
virtual Layer layer() const;
Layer belongsToLayer() const;
void invalidateLayer();
@@ -493,7 +493,7 @@ public:
void setShortcut(const QString& cut) override;
Options::WindowOperation mouseButtonToWindowOperation(Qt::MouseButtons button);
- bool performMouseCommand(Options::MouseCommand, const QPoint& globalPos);
+ bool performMouseCommand(Options::MouseCommand, const QPoint& globalPos) override;
QRect adjustedClientArea(const QRect& desktop, const QRect& area) const;
@@ -537,10 +537,10 @@ public:
static bool sameAppWindowRoleMatch(const Client* c1, const Client* c2, bool active_hack);
void setMinimized(bool set);
- void minimize(bool avoid_animation = false);
+ void minimize(bool avoid_animation = false) override;
void unminimize(bool avoid_animation = false);
void killWindow();
- void maximize(MaximizeMode);
+ void maximize(MaximizeMode) override;
void toggleShade();
void showContextHelp();
void cancelShadeHoverTimer();
@@ -551,7 +551,7 @@ public:
bool hasStrut() const;
// Tabbing functions
- TabGroup* tabGroup() const; // Returns a pointer to client_group
+ TabGroup* tabGroup() const override; // Returns a pointer to client_group
Q_INVOKABLE inline bool tabBefore(Client *other, bool activate) { return tabTo(other, false, activate); }
Q_INVOKABLE inline bool tabBehind(Client *other, bool activate) { return tabTo(other, true, activate); }
/**
@@ -566,7 +566,7 @@ public:
* WARNING: non dynamic properties are ignored - you're not supposed to alter/update such explicitly
*/
Q_INVOKABLE void syncTabGroupFor(QString property, bool fromThisClient = false);
- Q_INVOKABLE bool untab(const QRect &toGeometry = QRect(), bool clientRemoved = false);
+ Q_INVOKABLE bool untab(const QRect &toGeometry = QRect(), bool clientRemoved = false) override;
/**
* Set tab group - this is to be invoked by TabGroup::add/remove(client) and NO ONE ELSE
*/
diff --git a/useractions.cpp b/useractions.cpp
index 9eee210eac..55d1efb85d 100644
--- a/useractions.cpp
+++ b/useractions.cpp
@@ -735,7 +735,7 @@ void UserActionsMenu::slotWindowOperation(QAction *action)
qRegisterMetaType();
QMetaObject::invokeMethod(workspace(), "performWindowOperation",
Qt::QueuedConnection,
- Q_ARG(KWin::Client*, c.data()),
+ Q_ARG(KWin::AbstractClient*, c.data()),
Q_ARG(Options::WindowOperation, op));
}
@@ -1019,7 +1019,7 @@ void Workspace::clientShortcutUpdated(Client* c)
}
}
-void Workspace::performWindowOperation(Client* c, Options::WindowOperation op)
+void Workspace::performWindowOperation(AbstractClient* c, Options::WindowOperation op)
{
if (!c)
return;
@@ -1107,7 +1107,7 @@ void Workspace::performWindowOperation(Client* c, Options::WindowOperation op)
break;
case Options::RemoveTabFromGroupOp:
if (c->untab(c->geometry().translated(cascadeOffset(c))) && options->focusPolicyIsReasonable())
- takeActivity(c, ActivityFocus | ActivityRaise);
+ takeActivity(dynamic_cast(c), ActivityFocus | ActivityRaise);
break;
case Options::ActivateNextTabOp:
if (c->tabGroup())
diff --git a/workspace.h b/workspace.h
index db369e2681..c5da590c77 100644
--- a/workspace.h
+++ b/workspace.h
@@ -340,7 +340,7 @@ public:
void unregisterEventFilter(X11EventFilter *filter);
public Q_SLOTS:
- void performWindowOperation(KWin::Client* c, Options::WindowOperation op);
+ void performWindowOperation(KWin::AbstractClient* c, Options::WindowOperation op);
// Keybindings
//void slotSwitchToWindow( int );
void slotWindowToDesktop();