2007-11-27 19:40:25 +00:00
|
|
|
/********************************************************************
|
2007-04-29 17:35:43 +00:00
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
|
|
|
|
Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
|
2013-03-12 12:17:53 +00:00
|
|
|
Copyright (C) 2009 Martin Gräßlin <mgraesslin@kde.org>
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2007-11-27 19:40:25 +00:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*********************************************************************/
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
#ifndef KWIN_TABBOX_H
|
|
|
|
#define KWIN_TABBOX_H
|
|
|
|
|
2013-09-06 12:57:33 +00:00
|
|
|
#include <QKeySequence>
|
2007-04-29 17:35:43 +00:00
|
|
|
#include <QTimer>
|
2009-09-13 11:36:45 +00:00
|
|
|
#include <QModelIndex>
|
2007-04-29 17:35:43 +00:00
|
|
|
#include "utils.h"
|
2009-09-13 11:36:45 +00:00
|
|
|
#include "tabbox/tabboxhandler.h"
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2013-04-25 15:21:54 +00:00
|
|
|
class KConfigGroup;
|
2013-09-06 12:57:33 +00:00
|
|
|
class QAction;
|
2016-03-04 13:15:27 +00:00
|
|
|
class QMouseEvent;
|
2009-09-13 11:36:45 +00:00
|
|
|
class QKeyEvent;
|
2016-03-04 13:15:27 +00:00
|
|
|
class QWheelEvent;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
|
|
|
class Workspace;
|
2015-03-05 12:59:18 +00:00
|
|
|
class AbstractClient;
|
2007-04-29 17:35:43 +00:00
|
|
|
class Client;
|
2017-08-18 15:32:31 +00:00
|
|
|
class X11EventFilter;
|
2009-09-13 11:36:45 +00:00
|
|
|
namespace TabBox
|
|
|
|
{
|
2012-11-17 10:50:59 +00:00
|
|
|
class DesktopChainManager;
|
2009-09-13 11:36:45 +00:00
|
|
|
class TabBoxConfig;
|
2011-06-25 16:05:07 +00:00
|
|
|
class TabBox;
|
2009-09-13 11:36:45 +00:00
|
|
|
class TabBoxHandlerImpl : public TabBoxHandler
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-12-29 06:34:38 +00:00
|
|
|
explicit TabBoxHandlerImpl(TabBox* tabBox);
|
Run clang-tidy with modernize-use-override check
Summary:
Currently code base of kwin can be viewed as two pieces. One is very
ancient, and the other one is more modern, which uses new C++ features.
The main problem with the ancient code is that it was written before
C++11 era. So, no override or final keywords, lambdas, etc.
Quite recently, KDE compiler settings were changed to show a warning if
a virtual method has missing override keyword. As you might have already
guessed, this fired back at us because of that ancient code. We had
about 500 new compiler warnings.
A "solution" was proposed to that problem - disable -Wno-suggest-override
and the other similar warning for clang. It's hard to call a solution
because those warnings are disabled not only for the old code, but also
for new. This is not what we want!
The main argument for not actually fixing the problem was that git
history will be screwed as well because of human factor. While good git
history is a very important thing, we should not go crazy about it and
block every change that somehow alters git history. git blame allows to
specify starting revision for a reason.
The other argument (human factor) can be easily solved by using tools
such as clang-tidy. clang-tidy is a clang-based linter for C++. It can
be used for various things, e.g. fixing coding style(e.g. add missing
braces to if statements, readability-braces-around-statements check),
or in our case add missing override keywords.
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, apol, romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D22371
2019-07-22 16:52:26 +00:00
|
|
|
~TabBoxHandlerImpl() override;
|
|
|
|
|
|
|
|
int activeScreen() const override;
|
|
|
|
QWeakPointer< TabBoxClient > activeClient() const override;
|
|
|
|
int currentDesktop() const override;
|
|
|
|
QString desktopName(TabBoxClient* client) const override;
|
|
|
|
QString desktopName(int desktop) const override;
|
|
|
|
bool isKWinCompositing() const override;
|
|
|
|
QWeakPointer< TabBoxClient > nextClientFocusChain(TabBoxClient* client) const override;
|
|
|
|
QWeakPointer< TabBoxClient > firstClientFocusChain() const override;
|
|
|
|
bool isInFocusChain (TabBoxClient* client) const override;
|
|
|
|
int nextDesktopFocusChain(int desktop) const override;
|
|
|
|
int numberOfDesktops() const override;
|
|
|
|
TabBoxClientList stackingOrder() const override;
|
|
|
|
void elevateClient(TabBoxClient* c, QWindow *tabbox, bool elevate) const override;
|
|
|
|
void raiseClient(TabBoxClient *client) const override;
|
|
|
|
void restack(TabBoxClient *c, TabBoxClient *under) override;
|
|
|
|
void shadeClient(TabBoxClient *c, bool b) const override;
|
|
|
|
QWeakPointer< TabBoxClient > clientToAddToList(KWin::TabBox::TabBoxClient* client, int desktop) const override;
|
|
|
|
QWeakPointer< TabBoxClient > desktopClient() const override;
|
|
|
|
void activateAndClose() override;
|
2016-08-30 13:50:31 +00:00
|
|
|
void highlightWindows(TabBoxClient *window = nullptr, QWindow *controller = nullptr) override;
|
2017-04-12 16:14:37 +00:00
|
|
|
bool noModifierGrab() const override;
|
2011-06-25 16:05:07 +00:00
|
|
|
|
|
|
|
private:
|
2012-03-04 18:24:13 +00:00
|
|
|
bool checkDesktop(TabBoxClient* client, int desktop) const;
|
|
|
|
bool checkActivity(TabBoxClient* client) const;
|
|
|
|
bool checkApplications(TabBoxClient* client) const;
|
|
|
|
bool checkMinimized(TabBoxClient* client) const;
|
|
|
|
bool checkMultiScreen(TabBoxClient* client) const;
|
|
|
|
|
2011-06-25 16:05:07 +00:00
|
|
|
TabBox* m_tabBox;
|
2012-11-17 10:50:59 +00:00
|
|
|
DesktopChainManager* m_desktopFocusChain;
|
2011-01-30 14:34:42 +00:00
|
|
|
};
|
2009-09-13 11:36:45 +00:00
|
|
|
|
|
|
|
class TabBoxClientImpl : public TabBoxClient
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
|
|
|
public:
|
2015-03-05 12:59:18 +00:00
|
|
|
explicit TabBoxClientImpl(AbstractClient *client);
|
Run clang-tidy with modernize-use-override check
Summary:
Currently code base of kwin can be viewed as two pieces. One is very
ancient, and the other one is more modern, which uses new C++ features.
The main problem with the ancient code is that it was written before
C++11 era. So, no override or final keywords, lambdas, etc.
Quite recently, KDE compiler settings were changed to show a warning if
a virtual method has missing override keyword. As you might have already
guessed, this fired back at us because of that ancient code. We had
about 500 new compiler warnings.
A "solution" was proposed to that problem - disable -Wno-suggest-override
and the other similar warning for clang. It's hard to call a solution
because those warnings are disabled not only for the old code, but also
for new. This is not what we want!
The main argument for not actually fixing the problem was that git
history will be screwed as well because of human factor. While good git
history is a very important thing, we should not go crazy about it and
block every change that somehow alters git history. git blame allows to
specify starting revision for a reason.
The other argument (human factor) can be easily solved by using tools
such as clang-tidy. clang-tidy is a clang-based linter for C++. It can
be used for various things, e.g. fixing coding style(e.g. add missing
braces to if statements, readability-braces-around-statements check),
or in our case add missing override keywords.
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, apol, romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D22371
2019-07-22 16:52:26 +00:00
|
|
|
~TabBoxClientImpl() override;
|
|
|
|
|
|
|
|
QString caption() const override;
|
|
|
|
QIcon icon() const override;
|
|
|
|
WId window() const override;
|
|
|
|
bool isMinimized() const override;
|
|
|
|
int x() const override;
|
|
|
|
int y() const override;
|
|
|
|
int width() const override;
|
|
|
|
int height() const override;
|
|
|
|
bool isCloseable() const override;
|
|
|
|
void close() override;
|
|
|
|
bool isFirstInTabBox() const override;
|
2019-01-20 13:04:13 +00:00
|
|
|
QUuid internalId() const override;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2015-03-05 12:59:18 +00:00
|
|
|
AbstractClient* client() const {
|
2011-01-30 14:34:42 +00:00
|
|
|
return m_client;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2015-03-05 12:59:18 +00:00
|
|
|
AbstractClient* m_client;
|
2011-01-30 14:34:42 +00:00
|
|
|
};
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2016-09-13 11:04:27 +00:00
|
|
|
class KWIN_EXPORT TabBox : public QObject
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-04-29 17:35:43 +00:00
|
|
|
Q_OBJECT
|
2011-01-30 14:34:42 +00:00
|
|
|
public:
|
Run clang-tidy with modernize-use-override check
Summary:
Currently code base of kwin can be viewed as two pieces. One is very
ancient, and the other one is more modern, which uses new C++ features.
The main problem with the ancient code is that it was written before
C++11 era. So, no override or final keywords, lambdas, etc.
Quite recently, KDE compiler settings were changed to show a warning if
a virtual method has missing override keyword. As you might have already
guessed, this fired back at us because of that ancient code. We had
about 500 new compiler warnings.
A "solution" was proposed to that problem - disable -Wno-suggest-override
and the other similar warning for clang. It's hard to call a solution
because those warnings are disabled not only for the old code, but also
for new. This is not what we want!
The main argument for not actually fixing the problem was that git
history will be screwed as well because of human factor. While good git
history is a very important thing, we should not go crazy about it and
block every change that somehow alters git history. git blame allows to
specify starting revision for a reason.
The other argument (human factor) can be easily solved by using tools
such as clang-tidy. clang-tidy is a clang-based linter for C++. It can
be used for various things, e.g. fixing coding style(e.g. add missing
braces to if statements, readability-braces-around-statements check),
or in our case add missing override keywords.
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, apol, romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D22371
2019-07-22 16:52:26 +00:00
|
|
|
~TabBox() override;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2019-02-02 18:17:44 +00:00
|
|
|
/**
|
|
|
|
* Returns the currently displayed client ( only works in TabBoxWindowsMode ).
|
|
|
|
* Returns 0 if no client is displayed.
|
|
|
|
**/
|
2015-03-05 12:59:18 +00:00
|
|
|
AbstractClient *currentClient();
|
2019-02-02 18:17:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the list of clients potentially displayed ( only works in
|
|
|
|
* TabBoxWindowsMode ).
|
|
|
|
* Returns an empty list if no clients are available.
|
|
|
|
**/
|
2015-03-05 12:59:18 +00:00
|
|
|
QList<AbstractClient*> currentClientList();
|
2019-02-02 18:17:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the currently displayed virtual desktop ( only works in
|
|
|
|
* TabBoxDesktopListMode )
|
|
|
|
* Returns -1 if no desktop is displayed.
|
|
|
|
**/
|
2011-01-30 14:34:42 +00:00
|
|
|
int currentDesktop();
|
2019-02-02 18:17:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the list of desktops potentially displayed ( only works in
|
|
|
|
* TabBoxDesktopListMode )
|
|
|
|
* Returns an empty list if no are available.
|
|
|
|
**/
|
2011-01-30 14:34:42 +00:00
|
|
|
QList< int > currentDesktopList();
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2019-02-02 18:17:44 +00:00
|
|
|
/**
|
|
|
|
* Change the currently selected client, and notify the effects.
|
|
|
|
*
|
|
|
|
* @see setCurrentDesktop
|
|
|
|
**/
|
2015-03-05 12:59:18 +00:00
|
|
|
void setCurrentClient(AbstractClient *newClient);
|
2019-02-02 18:17:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Change the currently selected desktop, and notify the effects.
|
|
|
|
*
|
|
|
|
* @see setCurrentClient
|
|
|
|
**/
|
2011-01-30 14:34:42 +00:00
|
|
|
void setCurrentDesktop(int newDesktop);
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2019-02-02 18:17:44 +00:00
|
|
|
/**
|
|
|
|
* Sets the current mode to \a mode, either TabBoxDesktopListMode or TabBoxWindowsMode
|
|
|
|
*
|
|
|
|
* @see mode
|
|
|
|
**/
|
2011-01-30 14:34:42 +00:00
|
|
|
void setMode(TabBoxMode mode);
|
|
|
|
TabBoxMode mode() const {
|
|
|
|
return m_tabBoxMode;
|
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2019-02-02 18:17:44 +00:00
|
|
|
/**
|
|
|
|
* Resets the tab box to display the active client in TabBoxWindowsMode, or the
|
|
|
|
* current desktop in TabBoxDesktopListMode
|
|
|
|
**/
|
2011-01-30 14:34:42 +00:00
|
|
|
void reset(bool partial_reset = false);
|
2019-02-02 18:17:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Shows the next or previous item, depending on \a next
|
|
|
|
**/
|
2011-01-30 14:34:42 +00:00
|
|
|
void nextPrev(bool next = true);
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2019-02-02 18:17:44 +00:00
|
|
|
/**
|
|
|
|
* Shows the tab box after some delay.
|
|
|
|
*
|
|
|
|
* If the 'ShowDelay' setting is false, show() is simply called.
|
|
|
|
*
|
|
|
|
* Otherwise, we start a timer for the delay given in the settings and only
|
|
|
|
* do a show() when it times out.
|
|
|
|
*
|
|
|
|
* This means that you can alt-tab between windows and you don't see the
|
|
|
|
* tab box immediately. Not only does this make alt-tabbing faster, it gives
|
|
|
|
* less 'flicker' to the eyes. You don't need to see the tab box if you're
|
|
|
|
* just quickly switching between 2 or 3 windows. It seems to work quite
|
|
|
|
* nicely.
|
|
|
|
**/
|
2011-01-30 14:34:42 +00:00
|
|
|
void delayedShow();
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2019-02-02 18:17:44 +00:00
|
|
|
/**
|
|
|
|
* Notify effects that the tab box is being hidden.
|
|
|
|
**/
|
|
|
|
void hide(bool abort = false);
|
2011-06-25 16:05:07 +00:00
|
|
|
|
2019-02-02 18:17:44 +00:00
|
|
|
/**
|
|
|
|
* Increases the reference count, preventing the default tabbox from showing.
|
|
|
|
*
|
|
|
|
* @see unreference
|
|
|
|
* @see isDisplayed
|
|
|
|
**/
|
2011-06-25 16:05:07 +00:00
|
|
|
void reference() {
|
|
|
|
++m_displayRefcount;
|
|
|
|
}
|
2019-02-02 18:17:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Decreases the reference count. Only when the reference count is 0 will
|
|
|
|
* the default tab box be shown.
|
|
|
|
**/
|
2011-06-25 16:05:07 +00:00
|
|
|
void unreference() {
|
|
|
|
--m_displayRefcount;
|
|
|
|
}
|
|
|
|
|
2019-02-02 18:17:44 +00:00
|
|
|
/**
|
|
|
|
* Returns whether the tab box is being displayed, either natively or by an
|
|
|
|
* effect.
|
|
|
|
*
|
|
|
|
* @see reference
|
|
|
|
* @see unreference
|
|
|
|
**/
|
2011-06-25 16:05:07 +00:00
|
|
|
bool isDisplayed() const {
|
|
|
|
return m_displayRefcount > 0;
|
2018-10-27 08:59:53 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2017-08-18 15:32:31 +00:00
|
|
|
/**
|
|
|
|
* @returns @c true if TabBox is shown, @c false if replaced by Effect
|
|
|
|
**/
|
|
|
|
bool isShown() const {
|
|
|
|
return m_isShown;
|
|
|
|
}
|
|
|
|
|
2016-03-04 13:15:27 +00:00
|
|
|
bool handleMouseEvent(QMouseEvent *event);
|
|
|
|
bool handleWheelEvent(QWheelEvent *event);
|
2011-01-30 14:34:42 +00:00
|
|
|
void grabbedKeyEvent(QKeyEvent* event);
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2011-06-25 16:05:07 +00:00
|
|
|
bool isGrabbed() const {
|
|
|
|
return m_tabGrab || m_desktopGrab;
|
2017-09-13 16:46:55 +00:00
|
|
|
}
|
2011-06-25 16:05:07 +00:00
|
|
|
|
2013-12-10 08:34:11 +00:00
|
|
|
void initShortcuts();
|
2011-06-25 16:05:07 +00:00
|
|
|
|
2017-06-19 15:01:47 +00:00
|
|
|
AbstractClient* nextClientStatic(AbstractClient*) const;
|
|
|
|
AbstractClient* previousClientStatic(AbstractClient*) const;
|
2011-06-25 16:05:07 +00:00
|
|
|
int nextDesktopStatic(int iDesktop) const;
|
|
|
|
int previousDesktopStatic(int iDesktop) const;
|
|
|
|
void keyPress(int key);
|
2016-09-14 11:19:43 +00:00
|
|
|
void modifiersReleased();
|
2011-06-25 16:05:07 +00:00
|
|
|
|
2014-05-22 13:28:29 +00:00
|
|
|
bool forcedGlobalMouseGrab() const {
|
|
|
|
return m_forcedGlobalMouseGrab;
|
|
|
|
}
|
|
|
|
|
2017-04-12 16:14:37 +00:00
|
|
|
bool noModifierGrab() const {
|
|
|
|
return m_noModifierGrab;
|
|
|
|
}
|
2017-08-18 15:32:31 +00:00
|
|
|
void setCurrentIndex(QModelIndex index, bool notifyEffects = true);
|
2017-04-12 16:14:37 +00:00
|
|
|
|
2013-04-04 07:41:18 +00:00
|
|
|
static TabBox *self();
|
|
|
|
static TabBox *create(QObject *parent);
|
|
|
|
|
2013-07-22 14:07:39 +00:00
|
|
|
public Q_SLOTS:
|
2019-02-02 18:17:44 +00:00
|
|
|
/**
|
|
|
|
* Notify effects that the tab box is being shown, and only display the
|
|
|
|
* default tab box QFrame if no effect has referenced the tab box.
|
|
|
|
**/
|
2011-01-30 14:34:42 +00:00
|
|
|
void show();
|
2014-06-02 07:12:14 +00:00
|
|
|
void close(bool abort = false);
|
2015-09-25 06:49:44 +00:00
|
|
|
void accept(bool closeTabBox = true);
|
2011-06-25 16:05:07 +00:00
|
|
|
void slotWalkThroughDesktops();
|
|
|
|
void slotWalkBackThroughDesktops();
|
|
|
|
void slotWalkThroughDesktopList();
|
|
|
|
void slotWalkBackThroughDesktopList();
|
|
|
|
void slotWalkThroughWindows();
|
|
|
|
void slotWalkBackThroughWindows();
|
|
|
|
void slotWalkThroughWindowsAlternative();
|
|
|
|
void slotWalkBackThroughWindowsAlternative();
|
2012-04-25 20:57:48 +00:00
|
|
|
void slotWalkThroughCurrentAppWindows();
|
|
|
|
void slotWalkBackThroughCurrentAppWindows();
|
|
|
|
void slotWalkThroughCurrentAppWindowsAlternative();
|
|
|
|
void slotWalkBackThroughCurrentAppWindowsAlternative();
|
2011-06-25 16:05:07 +00:00
|
|
|
|
2011-07-09 08:32:26 +00:00
|
|
|
void handlerReady();
|
|
|
|
|
2013-03-08 19:17:55 +00:00
|
|
|
bool toggle(ElectricBorder eb);
|
|
|
|
|
2013-07-22 14:07:39 +00:00
|
|
|
Q_SIGNALS:
|
2011-03-06 11:15:16 +00:00
|
|
|
void tabBoxAdded(int);
|
2014-06-02 07:12:14 +00:00
|
|
|
void tabBoxClosed();
|
2011-03-06 11:15:16 +00:00
|
|
|
void tabBoxUpdated();
|
|
|
|
void tabBoxKeyEvent(QKeyEvent*);
|
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
private:
|
2013-04-04 07:41:18 +00:00
|
|
|
explicit TabBox(QObject *parent);
|
2011-01-30 14:34:42 +00:00
|
|
|
void loadConfig(const KConfigGroup& config, TabBoxConfig& tabBoxConfig);
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2011-06-25 16:05:07 +00:00
|
|
|
bool startKDEWalkThroughWindows(TabBoxMode mode); // TabBoxWindowsMode | TabBoxWindowsAlternativeMode
|
|
|
|
bool startWalkThroughDesktops(TabBoxMode mode); // TabBoxDesktopMode | TabBoxDesktopListMode
|
|
|
|
bool startWalkThroughDesktops();
|
|
|
|
bool startWalkThroughDesktopList();
|
2013-09-06 12:57:33 +00:00
|
|
|
void navigatingThroughWindows(bool forward, const QKeySequence &shortcut, TabBoxMode mode); // TabBoxWindowsMode | TabBoxWindowsAlternativeMode
|
2011-06-25 16:05:07 +00:00
|
|
|
void KDEWalkThroughWindows(bool forward);
|
|
|
|
void CDEWalkThroughWindows(bool forward);
|
|
|
|
void walkThroughDesktops(bool forward);
|
|
|
|
void KDEOneStepThroughWindows(bool forward, TabBoxMode mode); // TabBoxWindowsMode | TabBoxWindowsAlternativeMode
|
|
|
|
void oneStepThroughDesktops(bool forward, TabBoxMode mode); // TabBoxDesktopMode | TabBoxDesktopListMode
|
|
|
|
void oneStepThroughDesktops(bool forward);
|
|
|
|
void oneStepThroughDesktopList(bool forward);
|
|
|
|
bool establishTabBoxGrab();
|
|
|
|
void removeTabBoxGrab();
|
2013-09-06 12:57:33 +00:00
|
|
|
template <typename Slot>
|
2013-12-10 08:34:11 +00:00
|
|
|
void key(const char *actionName, Slot slot, const QKeySequence &shortcut = QKeySequence());
|
2011-06-25 16:05:07 +00:00
|
|
|
|
2015-03-12 11:26:01 +00:00
|
|
|
void shadeActivate(AbstractClient *c);
|
2015-02-06 22:10:59 +00:00
|
|
|
|
2017-04-02 16:22:44 +00:00
|
|
|
bool toggleMode(TabBoxMode mode);
|
|
|
|
|
2011-07-13 10:10:52 +00:00
|
|
|
private Q_SLOTS:
|
|
|
|
void reconfigure();
|
2013-09-06 12:57:33 +00:00
|
|
|
void globalShortcutChanged(QAction *action, const QKeySequence &seq);
|
2011-07-13 10:10:52 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
private:
|
|
|
|
TabBoxMode m_tabBoxMode;
|
|
|
|
TabBoxHandlerImpl* m_tabBox;
|
|
|
|
bool m_delayShow;
|
|
|
|
int m_delayShowTime;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2011-06-25 16:05:07 +00:00
|
|
|
QTimer m_delayedShowTimer;
|
|
|
|
int m_displayRefcount;
|
2009-03-03 11:45:39 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
TabBoxConfig m_defaultConfig;
|
|
|
|
TabBoxConfig m_alternativeConfig;
|
2012-04-25 20:57:48 +00:00
|
|
|
TabBoxConfig m_defaultCurrentApplicationConfig;
|
|
|
|
TabBoxConfig m_alternativeCurrentApplicationConfig;
|
2011-01-30 14:34:42 +00:00
|
|
|
TabBoxConfig m_desktopConfig;
|
|
|
|
TabBoxConfig m_desktopListConfig;
|
|
|
|
// false if an effect has referenced the tabbox
|
|
|
|
// true if tabbox is active (independent on showTabbox setting)
|
|
|
|
bool m_isShown;
|
2011-06-25 16:05:07 +00:00
|
|
|
bool m_desktopGrab;
|
|
|
|
bool m_tabGrab;
|
2011-08-21 08:44:09 +00:00
|
|
|
// true if tabbox is in modal mode which does not require holding a modifier
|
|
|
|
bool m_noModifierGrab;
|
2013-09-06 12:57:33 +00:00
|
|
|
QKeySequence m_cutWalkThroughDesktops, m_cutWalkThroughDesktopsReverse;
|
|
|
|
QKeySequence m_cutWalkThroughDesktopList, m_cutWalkThroughDesktopListReverse;
|
|
|
|
QKeySequence m_cutWalkThroughWindows, m_cutWalkThroughWindowsReverse;
|
|
|
|
QKeySequence m_cutWalkThroughWindowsAlternative, m_cutWalkThroughWindowsAlternativeReverse;
|
|
|
|
QKeySequence m_cutWalkThroughCurrentAppWindows, m_cutWalkThroughCurrentAppWindowsReverse;
|
|
|
|
QKeySequence m_cutWalkThroughCurrentAppWindowsAlternative, m_cutWalkThroughCurrentAppWindowsAlternativeReverse;
|
2011-06-25 16:05:07 +00:00
|
|
|
bool m_forcedGlobalMouseGrab;
|
2011-07-09 08:32:26 +00:00
|
|
|
bool m_ready; // indicates whether the config is completely loaded
|
2013-03-08 19:17:55 +00:00
|
|
|
QList<ElectricBorder> m_borderActivate, m_borderAlternativeActivate;
|
2017-04-02 16:22:44 +00:00
|
|
|
QHash<ElectricBorder, QAction *> m_touchActivate;
|
|
|
|
QHash<ElectricBorder, QAction *> m_touchAlternativeActivate;
|
2017-08-18 15:32:31 +00:00
|
|
|
QScopedPointer<X11EventFilter> m_x11EventFilter;
|
2013-04-04 07:41:18 +00:00
|
|
|
|
|
|
|
static TabBox *s_self;
|
2011-01-30 14:34:42 +00:00
|
|
|
};
|
2013-04-04 07:41:18 +00:00
|
|
|
|
|
|
|
inline
|
|
|
|
TabBox *TabBox::self()
|
|
|
|
{
|
|
|
|
return s_self;
|
|
|
|
}
|
|
|
|
|
2009-09-13 11:36:45 +00:00
|
|
|
} // namespace TabBox
|
2007-04-29 17:35:43 +00:00
|
|
|
} // namespace
|
|
|
|
#endif
|