Commit 4d466f9a authored by Martin Flöser's avatar Martin Flöser

Implement AbstractClient::skipSwitcher

Moves implementation from Client to AbstractClient.
parent 3182c8f3
......@@ -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();
}
}
......@@ -22,12 +22,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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<TabBox::TabBoxClientImpl> m_tabBoxClient;
bool m_firstInTabBox = false;
bool m_skipSwitcher = false;
};
}
......
......@@ -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 :(
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment