From 4d466f9ab3f251a1625bb0c11a5b7fb781ef1cd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 12 Mar 2015 15:35:36 +0100 Subject: [PATCH] Implement AbstractClient::skipSwitcher Moves implementation from Client to AbstractClient. --- abstract_client.cpp | 10 ++++++++++ abstract_client.h | 16 ++++++++++++++-- client.cpp | 11 ----------- client.h | 16 +--------------- 4 files changed, 25 insertions(+), 28 deletions(-) diff --git a/abstract_client.cpp b/abstract_client.cpp index 3c4742c5a1..a57eacb410 100644 --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -93,4 +93,14 @@ xcb_timestamp_t AbstractClient::userTime() const return XCB_TIME_CURRENT_TIME; } +void AbstractClient::setSkipSwitcher(bool set) +{ + set = rules()->checkSkipSwitcher(set); + if (set == skipSwitcher()) + return; + m_skipSwitcher = set; + updateWindowRules(Rules::SkipSwitcher); + emit skipSwitcherChanged(); +} + } diff --git a/abstract_client.h b/abstract_client.h index ae6ef98e6c..cfd4c660ba 100644 --- a/abstract_client.h +++ b/abstract_client.h @@ -22,12 +22,12 @@ along with this program. If not, see . #include "toplevel.h" #include "options.h" +#include "rules.h" namespace KWin { class TabGroup; -class WindowRules; namespace TabBox { @@ -42,6 +42,10 @@ class AbstractClient : public Toplevel * For change connect to the visibleChanged signal on the Client's Group. **/ Q_PROPERTY(bool isCurrentTab READ isCurrentTab) + /** + * Whether the Client should be excluded from window switching effects. + **/ + Q_PROPERTY(bool skipSwitcher READ skipSwitcher WRITE setSkipSwitcher NOTIFY skipSwitcherChanged) public: virtual ~AbstractClient(); @@ -51,6 +55,10 @@ public: bool isFirstInTabBox() const { return m_firstInTabBox; } + bool skipSwitcher() const { + return m_skipSwitcher; + } + void setSkipSwitcher(bool set); virtual void updateMouseGrab(); virtual QString caption(bool full = true, bool stripped = false) const = 0; @@ -61,7 +69,6 @@ public: virtual bool wantsTabFocus() const = 0; virtual bool isFullScreen() const = 0; virtual const QIcon &icon() const = 0; - virtual bool skipSwitcher() const = 0; // TODO: remove boolean trap virtual AbstractClient *findModal(bool allow_itself = false) = 0; virtual void cancelAutoRaise() = 0; @@ -116,6 +123,7 @@ public: virtual void checkWorkspacePosition(QRect oldGeometry = QRect(), int oldDesktop = -2) = 0; virtual xcb_timestamp_t userTime() const; virtual void demandAttention(bool set = true) = 0; + virtual void updateWindowRules(Rules::Types selection) = 0; virtual void growHorizontal(); virtual void shrinkHorizontal(); @@ -165,6 +173,9 @@ public: public Q_SLOTS: virtual void closeWindow() = 0; +Q_SIGNALS: + void skipSwitcherChanged(); + protected: AbstractClient(); void setFirstInTabBox(bool enable) { @@ -176,6 +187,7 @@ protected: private: QSharedPointer m_tabBoxClient; bool m_firstInTabBox = false; + bool m_skipSwitcher = false; }; } diff --git a/client.cpp b/client.cpp index e09035cef9..f700adc167 100644 --- a/client.cpp +++ b/client.cpp @@ -111,7 +111,6 @@ Client::Client() , m_transientForId(XCB_WINDOW_NONE) , m_originalTransientForId(XCB_WINDOW_NONE) , shade_below(NULL) - , skip_switcher(false) , m_motif(atoms->motif_wm_hints) , blocks_compositing(false) , m_cursor(Qt::ArrowCursor) @@ -1299,16 +1298,6 @@ void Client::setSkipPager(bool b) emit skipPagerChanged(); } -void Client::setSkipSwitcher(bool set) -{ - set = rules()->checkSkipSwitcher(set); - if (set == skipSwitcher()) - return; - skip_switcher = set; - updateWindowRules(Rules::SkipSwitcher); - emit skipSwitcherChanged(); -} - void Client::setModal(bool m) { // Qt-3.2 can have even modal normal windows :( diff --git a/client.h b/client.h index 50a36fa29b..2399479eea 100644 --- a/client.h +++ b/client.h @@ -222,10 +222,6 @@ class Client **/ Q_PROPERTY(bool wantsInput READ wantsInput) Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged) - /** - * Whether the Client should be excluded from window switching effects. - **/ - Q_PROPERTY(bool skipSwitcher READ skipSwitcher WRITE setSkipSwitcher NOTIFY skipSwitcherChanged) /** * Indicates that the window should not be included on a taskbar. **/ @@ -307,7 +303,7 @@ public: void removeRule(Rules* r); void setupWindowRules(bool ignore_temporary); void applyWindowRules(); - void updateWindowRules(Rules::Types selection); + void updateWindowRules(Rules::Types selection) override; void updateFullscreenMonitors(NETFullscreenMonitors topology); /** @@ -405,9 +401,6 @@ public: bool skipPager() const; void setSkipPager(bool); - bool skipSwitcher() const override; - void setSkipSwitcher(bool set); - bool keepAbove() const override; void setKeepAbove(bool) override; bool keepBelow() const override; @@ -710,7 +703,6 @@ Q_SIGNALS: void minimizedChanged(); void moveResizedChanged(); void iconChanged(); - void skipSwitcherChanged(); void skipTaskbarChanged(); void skipPagerChanged(); void paletteChanged(const QPalette &p); @@ -902,7 +894,6 @@ private: uint skip_taskbar : 1; uint original_skip_taskbar : 1; ///< Unaffected by KWin uint skip_pager : 1; - uint skip_switcher : 1; Xcb::MotifHints m_motif; uint keep_below : 1; ///< NET::KeepBelow uint minimized : 1; @@ -1127,11 +1118,6 @@ inline bool Client::skipPager() const return skip_pager; } -inline bool Client::skipSwitcher() const -{ - return skip_switcher; -} - inline bool Client::keepAbove() const { return keep_above;