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>
|
2012-04-12 09:28:55 +00:00
|
|
|
Copyright (C) 2012 Martin Gräßlin <m.graesslin@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_OPTIONS_H
|
|
|
|
#define KWIN_OPTIONS_H
|
|
|
|
|
2013-06-25 08:39:13 +00:00
|
|
|
#include "main.h"
|
2007-04-29 17:35:43 +00:00
|
|
|
#include "placement.h"
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2013-09-06 07:42:56 +00:00
|
|
|
// Whether to keep all windows mapped when compositing (i.e. whether to have
|
|
|
|
// actively updated window pixmaps).
|
|
|
|
enum HiddenPreviews {
|
|
|
|
// The normal mode with regard to mapped windows. Hidden (minimized, etc.)
|
|
|
|
// and windows on inactive virtual desktops are not mapped, their pixmaps
|
|
|
|
// are only their icons.
|
|
|
|
HiddenPreviewsNever,
|
|
|
|
// Like normal mode, but shown windows (i.e. on inactive virtual desktops)
|
|
|
|
// are kept mapped, only hidden windows are unmapped.
|
|
|
|
HiddenPreviewsShown,
|
|
|
|
// All windows are kept mapped regardless of their state.
|
|
|
|
HiddenPreviewsAlways
|
|
|
|
};
|
|
|
|
|
2013-01-24 14:25:34 +00:00
|
|
|
class Settings;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2015-05-05 15:58:09 +00:00
|
|
|
class KWIN_EXPORT Options : public QObject
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2012-02-21 08:23:18 +00:00
|
|
|
Q_OBJECT
|
|
|
|
Q_ENUMS(FocusPolicy)
|
2013-02-18 22:17:46 +00:00
|
|
|
Q_ENUMS(GlSwapStrategy)
|
2012-02-21 08:23:18 +00:00
|
|
|
Q_ENUMS(MouseCommand)
|
|
|
|
Q_ENUMS(MouseWheelCommand)
|
2014-12-02 09:39:38 +00:00
|
|
|
Q_ENUMS(WindowOperation)
|
2012-02-21 08:23:18 +00:00
|
|
|
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(FocusPolicy focusPolicy READ focusPolicy WRITE setFocusPolicy NOTIFY focusPolicyChanged)
|
|
|
|
Q_PROPERTY(bool nextFocusPrefersMouse READ isNextFocusPrefersMouse WRITE setNextFocusPrefersMouse NOTIFY nextFocusPrefersMouseChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
|
|
|
Whether clicking on a window raises it in FocusFollowsMouse
|
|
|
|
mode or not.
|
|
|
|
*/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(bool clickRaise READ isClickRaise WRITE setClickRaise NOTIFY clickRaiseChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
|
|
|
whether autoraise is enabled FocusFollowsMouse mode or not.
|
|
|
|
*/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(bool autoRaise READ isAutoRaise WRITE setAutoRaise NOTIFY autoRaiseChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
|
|
|
autoraise interval
|
|
|
|
*/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(int autoRaiseInterval READ autoRaiseInterval WRITE setAutoRaiseInterval NOTIFY autoRaiseIntervalChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
|
|
|
delayed focus interval
|
|
|
|
*/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(int delayFocusInterval READ delayFocusInterval WRITE setDelayFocusInterval NOTIFY delayFocusIntervalChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
|
|
|
Whether shade hover is enabled or not
|
|
|
|
*/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(bool shadeHover READ isShadeHover WRITE setShadeHover NOTIFY shadeHoverChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
|
|
|
shade hover interval
|
|
|
|
*/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(int shadeHoverInterval READ shadeHoverInterval WRITE setShadeHoverInterval NOTIFY shadeHoverIntervalChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* whether to see Xinerama screens separately for focus (in Alt+Tab, when activating next client)
|
|
|
|
**/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(bool separateScreenFocus READ isSeparateScreenFocus WRITE setSeparateScreenFocus NOTIFY separateScreenFocusChanged)
|
|
|
|
Q_PROPERTY(int placement READ placement WRITE setPlacement NOTIFY placementChanged)
|
2013-10-18 17:01:04 +00:00
|
|
|
Q_PROPERTY(bool focusPolicyIsReasonable READ focusPolicyIsReasonable NOTIFY focusPolicyIsResonableChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* the size of the zone that triggers snapping on desktop borders
|
|
|
|
*/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(int borderSnapZone READ borderSnapZone WRITE setBorderSnapZone NOTIFY borderSnapZoneChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* the size of the zone that triggers snapping with other windows
|
|
|
|
*/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(int windowSnapZone READ windowSnapZone WRITE setWindowSnapZone NOTIFY windowSnapZoneChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* the size of the zone that triggers snapping on the screen center
|
|
|
|
*/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(int centerSnapZone READ centerSnapZone WRITE setCenterSnapZone NOTIFY centerSnapZoneChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* snap only when windows will overlap
|
|
|
|
*/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(bool snapOnlyWhenOverlapping READ isSnapOnlyWhenOverlapping WRITE setSnapOnlyWhenOverlapping NOTIFY snapOnlyWhenOverlappingChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* whether or not we roll over to the other edge when switching desktops past the edge
|
|
|
|
*/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(bool rollOverDesktops READ isRollOverDesktops WRITE setRollOverDesktops NOTIFY rollOverDesktopsChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* 0 - 4 , see Workspace::allowClientActivation()
|
|
|
|
**/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(int focusStealingPreventionLevel READ focusStealingPreventionLevel WRITE setFocusStealingPreventionLevel NOTIFY focusStealingPreventionLevelChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* support legacy fullscreen windows hack: borderless non-netwm windows with screen geometry
|
|
|
|
*/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(bool legacyFullscreenSupport READ isLegacyFullscreenSupport WRITE setLegacyFullscreenSupport NOTIFY legacyFullscreenSupportChanged)
|
2014-12-08 15:46:54 +00:00
|
|
|
Q_PROPERTY(KWin::Options::WindowOperation operationTitlebarDblClick READ operationTitlebarDblClick WRITE setOperationTitlebarDblClick NOTIFY operationTitlebarDblClickChanged)
|
|
|
|
Q_PROPERTY(KWin::Options::WindowOperation operationMaxButtonLeftClick READ operationMaxButtonLeftClick WRITE setOperationMaxButtonLeftClick NOTIFY operationMaxButtonLeftClickChanged)
|
|
|
|
Q_PROPERTY(KWin::Options::WindowOperation operationMaxButtonMiddleClick READ operationMaxButtonMiddleClick WRITE setOperationMaxButtonMiddleClick NOTIFY operationMaxButtonMiddleClickChanged)
|
|
|
|
Q_PROPERTY(KWin::Options::WindowOperation operationMaxButtonRightClick READ operationMaxButtonRightClick WRITE setOperationMaxButtonRightClick NOTIFY operationMaxButtonRightClickChanged)
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(MouseCommand commandActiveTitlebar1 READ commandActiveTitlebar1 WRITE setCommandActiveTitlebar1 NOTIFY commandActiveTitlebar1Changed)
|
|
|
|
Q_PROPERTY(MouseCommand commandActiveTitlebar2 READ commandActiveTitlebar2 WRITE setCommandActiveTitlebar2 NOTIFY commandActiveTitlebar2Changed)
|
|
|
|
Q_PROPERTY(MouseCommand commandActiveTitlebar3 READ commandActiveTitlebar3 WRITE setCommandActiveTitlebar3 NOTIFY commandActiveTitlebar3Changed)
|
|
|
|
Q_PROPERTY(MouseCommand commandInactiveTitlebar1 READ commandInactiveTitlebar1 WRITE setCommandInactiveTitlebar1 NOTIFY commandInactiveTitlebar1Changed)
|
|
|
|
Q_PROPERTY(MouseCommand commandInactiveTitlebar2 READ commandInactiveTitlebar2 WRITE setCommandInactiveTitlebar2 NOTIFY commandInactiveTitlebar2Changed)
|
|
|
|
Q_PROPERTY(MouseCommand commandInactiveTitlebar3 READ commandInactiveTitlebar3 WRITE setCommandInactiveTitlebar3 NOTIFY commandInactiveTitlebar3Changed)
|
|
|
|
Q_PROPERTY(MouseCommand commandWindow1 READ commandWindow1 WRITE setCommandWindow1 NOTIFY commandWindow1Changed)
|
|
|
|
Q_PROPERTY(MouseCommand commandWindow2 READ commandWindow2 WRITE setCommandWindow2 NOTIFY commandWindow2Changed)
|
|
|
|
Q_PROPERTY(MouseCommand commandWindow3 READ commandWindow3 WRITE setCommandWindow3 NOTIFY commandWindow3Changed)
|
|
|
|
Q_PROPERTY(MouseCommand commandWindowWheel READ commandWindowWheel WRITE setCommandWindowWheel NOTIFY commandWindowWheelChanged)
|
|
|
|
Q_PROPERTY(MouseCommand commandAll1 READ commandAll1 WRITE setCommandAll1 NOTIFY commandAll1Changed)
|
|
|
|
Q_PROPERTY(MouseCommand commandAll2 READ commandAll2 WRITE setCommandAll2 NOTIFY commandAll2Changed)
|
|
|
|
Q_PROPERTY(MouseCommand commandAll3 READ commandAll3 WRITE setCommandAll3 NOTIFY commandAll3Changed)
|
|
|
|
Q_PROPERTY(uint keyCmdAllModKey READ keyCmdAllModKey WRITE setKeyCmdAllModKey NOTIFY keyCmdAllModKeyChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* whether the Geometry Tip should be shown during a window move/resize.
|
|
|
|
*/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(bool showGeometryTip READ showGeometryTip WRITE setShowGeometryTip NOTIFY showGeometryTipChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
2012-10-16 20:42:19 +00:00
|
|
|
* whether the visible name should be condensed
|
|
|
|
*/
|
|
|
|
Q_PROPERTY(bool condensedTitle READ condensedTitle WRITE setCondensedTitle NOTIFY condensedTitleChanged)
|
|
|
|
/**
|
2012-02-21 08:23:18 +00:00
|
|
|
* Whether a window gets maximized when it reaches top screen edge while being moved.
|
|
|
|
*/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(bool electricBorderMaximize READ electricBorderMaximize WRITE setElectricBorderMaximize NOTIFY electricBorderMaximizeChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* Whether a window is tiled to half screen when reaching left or right screen edge while been moved
|
|
|
|
*/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(bool electricBorderTiling READ electricBorderTiling WRITE setElectricBorderTiling NOTIFY electricBorderTilingChanged)
|
2012-09-19 20:48:52 +00:00
|
|
|
/**
|
|
|
|
* Whether a window is tiled to half screen when reaching left or right screen edge while been moved
|
|
|
|
*/
|
|
|
|
Q_PROPERTY(float electricBorderCornerRatio READ electricBorderCornerRatio WRITE setElectricBorderCornerRatio NOTIFY electricBorderCornerRatioChanged)
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(bool borderlessMaximizedWindows READ borderlessMaximizedWindows WRITE setBorderlessMaximizedWindows NOTIFY borderlessMaximizedWindowsChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* timeout before non-responding application will be killed after attempt to close
|
|
|
|
**/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(int killPingTimeout READ killPingTimeout WRITE setKillPingTimeout NOTIFY killPingTimeoutChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* Whether to hide utility windows for inactive applications.
|
|
|
|
**/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(bool hideUtilityWindowsForInactive READ isHideUtilityWindowsForInactive WRITE setHideUtilityWindowsForInactive NOTIFY hideUtilityWindowsForInactiveChanged)
|
|
|
|
Q_PROPERTY(bool inactiveTabsSkipTaskbar READ isInactiveTabsSkipTaskbar WRITE setInactiveTabsSkipTaskbar NOTIFY inactiveTabsSkipTaskbarChanged)
|
|
|
|
Q_PROPERTY(bool autogroupSimilarWindows READ isAutogroupSimilarWindows WRITE setAutogroupSimilarWindows NOTIFY autogroupSimilarWindowsChanged)
|
|
|
|
Q_PROPERTY(bool autogroupInForeground READ isAutogroupInForeground WRITE setAutogroupInForeground NOTIFY autogroupInForegroundChanged)
|
|
|
|
Q_PROPERTY(int compositingMode READ compositingMode WRITE setCompositingMode NOTIFY compositingModeChanged)
|
|
|
|
Q_PROPERTY(bool useCompositing READ isUseCompositing WRITE setUseCompositing NOTIFY useCompositingChanged)
|
|
|
|
Q_PROPERTY(bool compositingInitialized READ isCompositingInitialized WRITE setCompositingInitialized NOTIFY compositingInitializedChanged)
|
|
|
|
Q_PROPERTY(int hiddenPreviews READ hiddenPreviews WRITE setHiddenPreviews NOTIFY hiddenPreviewsChanged)
|
|
|
|
Q_PROPERTY(bool unredirectFullscreen READ isUnredirectFullscreen WRITE setUnredirectFullscreen NOTIFY unredirectFullscreenChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* 0 = no, 1 = yes when transformed,
|
|
|
|
* 2 = try trilinear when transformed; else 1,
|
|
|
|
* -1 = auto
|
|
|
|
**/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(int glSmoothScale READ glSmoothScale WRITE setGlSmoothScale NOTIFY glSmoothScaleChanged)
|
2012-11-13 20:41:02 +00:00
|
|
|
Q_PROPERTY(bool colorCorrected READ isColorCorrected WRITE setColorCorrected NOTIFY colorCorrectedChanged)
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(bool xrenderSmoothScale READ isXrenderSmoothScale WRITE setXrenderSmoothScale NOTIFY xrenderSmoothScaleChanged)
|
2013-03-28 20:53:25 +00:00
|
|
|
Q_PROPERTY(qint64 maxFpsInterval READ maxFpsInterval WRITE setMaxFpsInterval NOTIFY maxFpsIntervalChanged)
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(uint refreshRate READ refreshRate WRITE setRefreshRate NOTIFY refreshRateChanged)
|
2013-03-28 20:53:25 +00:00
|
|
|
Q_PROPERTY(qint64 vBlankTime READ vBlankTime WRITE setVBlankTime NOTIFY vBlankTimeChanged)
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(bool glStrictBinding READ isGlStrictBinding WRITE setGlStrictBinding NOTIFY glStrictBindingChanged)
|
2012-04-28 08:53:55 +00:00
|
|
|
/**
|
|
|
|
* Whether strict binding follows the driver or has been overwritten by a user defined config value.
|
|
|
|
* If @c true @link glStrictBinding is set by the OpenGL Scene during initialization.
|
|
|
|
* If @c false @link glStrictBinding is set from a config value and not updated during scene initialization.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool glStrictBindingFollowsDriver READ isGlStrictBindingFollowsDriver WRITE setGlStrictBindingFollowsDriver NOTIFY glStrictBindingFollowsDriverChanged)
|
2013-03-13 15:21:15 +00:00
|
|
|
Q_PROPERTY(bool glCoreProfile READ glCoreProfile WRITE setGLCoreProfile NOTIFY glCoreProfileChanged)
|
2013-05-22 07:26:04 +00:00
|
|
|
Q_PROPERTY(GlSwapStrategy glPreferBufferSwap READ glPreferBufferSwap WRITE setGlPreferBufferSwap NOTIFY glPreferBufferSwapChanged)
|
2014-12-08 15:29:23 +00:00
|
|
|
Q_PROPERTY(KWin::OpenGLPlatformInterface glPlatformInterface READ glPlatformInterface WRITE setGlPlatformInterface NOTIFY glPlatformInterfaceChanged)
|
2011-01-30 14:34:42 +00:00
|
|
|
public:
|
|
|
|
|
2012-12-29 06:34:38 +00:00
|
|
|
explicit Options(QObject *parent = NULL);
|
2011-01-30 14:34:42 +00:00
|
|
|
~Options();
|
|
|
|
|
2013-08-23 10:36:30 +00:00
|
|
|
void updateSettings();
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
Different focus policies:
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
<li>ClickToFocus - Clicking into a window activates it. This is
|
|
|
|
also the default.
|
|
|
|
|
|
|
|
<li>FocusFollowsMouse - Moving the mouse pointer actively onto a
|
|
|
|
normal window activates it. For convenience, the desktop and
|
|
|
|
windows on the dock are excluded. They require clicking.
|
|
|
|
|
|
|
|
<li>FocusUnderMouse - The window that happens to be under the
|
|
|
|
mouse pointer becomes active. The invariant is: no window can
|
|
|
|
have focus that is not under the mouse. This also means that
|
|
|
|
Alt-Tab won't work properly and popup dialogs are usually
|
|
|
|
unsable with the keyboard. Note that the desktop and windows on
|
|
|
|
the dock are excluded for convenience. They get focus only when
|
|
|
|
clicking on it.
|
|
|
|
|
|
|
|
<li>FocusStrictlyUnderMouse - this is even worse than
|
|
|
|
FocusUnderMouse. Only the window under the mouse pointer is
|
|
|
|
active. If the mouse points nowhere, nothing has the focus. If
|
|
|
|
the mouse points onto the desktop, the desktop has focus. The
|
|
|
|
same holds for windows on the dock.
|
|
|
|
|
|
|
|
Note that FocusUnderMouse and FocusStrictlyUnderMouse are not
|
|
|
|
particulary useful. They are only provided for old-fashined
|
|
|
|
die-hard UNIX people ;-)
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
*/
|
|
|
|
enum FocusPolicy { ClickToFocus, FocusFollowsMouse, FocusUnderMouse, FocusStrictlyUnderMouse };
|
2012-02-20 09:25:13 +00:00
|
|
|
FocusPolicy focusPolicy() const {
|
|
|
|
return m_focusPolicy;
|
|
|
|
}
|
|
|
|
bool isNextFocusPrefersMouse() const {
|
|
|
|
return m_nextFocusPrefersMouse;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Whether clicking on a window raises it in FocusFollowsMouse
|
|
|
|
mode or not.
|
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
bool isClickRaise() const {
|
|
|
|
return m_clickRaise;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
whether autoraise is enabled FocusFollowsMouse mode or not.
|
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
bool isAutoRaise() const {
|
|
|
|
return m_autoRaise;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
autoraise interval
|
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
int autoRaiseInterval() const {
|
|
|
|
return m_autoRaiseInterval;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
delayed focus interval
|
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
int delayFocusInterval() const {
|
|
|
|
return m_delayFocusInterval;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Whether shade hover is enabled or not
|
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
bool isShadeHover() const {
|
|
|
|
return m_shadeHover;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
shade hover interval
|
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
int shadeHoverInterval() {
|
|
|
|
return m_shadeHoverInterval;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
// whether to see Xinerama screens separately for focus (in Alt+Tab, when activating next client)
|
2012-02-20 09:25:13 +00:00
|
|
|
bool isSeparateScreenFocus() const {
|
|
|
|
return m_separateScreenFocus;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2012-02-20 09:25:13 +00:00
|
|
|
Placement::Policy placement() const {
|
|
|
|
return m_placement;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
bool focusPolicyIsReasonable() {
|
2012-02-20 09:25:13 +00:00
|
|
|
return m_focusPolicy == ClickToFocus || m_focusPolicy == FocusFollowsMouse;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* the size of the zone that triggers snapping on desktop borders
|
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
int borderSnapZone() const {
|
|
|
|
return m_borderSnapZone;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* the size of the zone that triggers snapping with other windows
|
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
int windowSnapZone() const {
|
|
|
|
return m_windowSnapZone;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* the size of the zone that triggers snapping on the screen center
|
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
int centerSnapZone() const {
|
|
|
|
return m_centerSnapZone;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* snap only when windows will overlap
|
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
bool isSnapOnlyWhenOverlapping() const {
|
|
|
|
return m_snapOnlyWhenOverlapping;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* whether or not we roll over to the other edge when switching desktops past the edge
|
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
bool isRollOverDesktops() const {
|
|
|
|
return m_rollOverDesktops;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
// 0 - 4 , see Workspace::allowClientActivation()
|
2012-02-20 09:25:13 +00:00
|
|
|
int focusStealingPreventionLevel() const {
|
|
|
|
return m_focusStealingPreventionLevel;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* support legacy fullscreen windows hack: borderless non-netwm windows with screen geometry
|
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
bool isLegacyFullscreenSupport() const {
|
|
|
|
return m_legacyFullscreenSupport;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2014-12-02 09:39:38 +00:00
|
|
|
enum WindowOperation {
|
|
|
|
MaximizeOp = 5000,
|
|
|
|
RestoreOp,
|
|
|
|
MinimizeOp,
|
|
|
|
MoveOp,
|
|
|
|
UnrestrictedMoveOp,
|
|
|
|
ResizeOp,
|
|
|
|
UnrestrictedResizeOp,
|
|
|
|
CloseOp,
|
|
|
|
OnAllDesktopsOp,
|
|
|
|
ShadeOp,
|
|
|
|
KeepAboveOp,
|
|
|
|
KeepBelowOp,
|
|
|
|
OperationsOp,
|
|
|
|
WindowRulesOp,
|
|
|
|
ToggleStoreSettingsOp = WindowRulesOp, ///< @obsolete
|
|
|
|
HMaximizeOp,
|
|
|
|
VMaximizeOp,
|
|
|
|
LowerOp,
|
|
|
|
FullScreenOp,
|
|
|
|
NoBorderOp,
|
|
|
|
NoOp,
|
|
|
|
SetupWindowShortcutOp,
|
|
|
|
ApplicationRulesOp,
|
|
|
|
RemoveTabFromGroupOp, // Remove from group
|
|
|
|
CloseTabGroupOp, // Close the group
|
|
|
|
ActivateNextTabOp, // Move left in the group
|
|
|
|
ActivatePreviousTabOp, // Move right in the group
|
|
|
|
TabDragOp,
|
|
|
|
};
|
|
|
|
|
2012-02-20 11:29:59 +00:00
|
|
|
WindowOperation operationTitlebarDblClick() const {
|
2011-01-30 14:34:42 +00:00
|
|
|
return OpTitlebarDblClick;
|
|
|
|
}
|
2014-12-02 08:43:24 +00:00
|
|
|
WindowOperation operationMaxButtonLeftClick() const {
|
|
|
|
return opMaxButtonLeftClick;
|
|
|
|
}
|
|
|
|
WindowOperation operationMaxButtonRightClick() const {
|
|
|
|
return opMaxButtonRightClick;
|
|
|
|
}
|
|
|
|
WindowOperation operationMaxButtonMiddleClick() const {
|
|
|
|
return opMaxButtonMiddleClick;
|
|
|
|
}
|
|
|
|
WindowOperation operationMaxButtonClick(Qt::MouseButtons button) const;
|
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
enum MouseCommand {
|
|
|
|
MouseRaise, MouseLower, MouseOperationsMenu, MouseToggleRaiseAndLower,
|
|
|
|
MouseActivateAndRaise, MouseActivateAndLower, MouseActivate,
|
|
|
|
MouseActivateRaiseAndPassClick, MouseActivateAndPassClick,
|
|
|
|
MouseMove, MouseUnrestrictedMove,
|
|
|
|
MouseActivateRaiseAndMove, MouseActivateRaiseAndUnrestrictedMove,
|
|
|
|
MouseResize, MouseUnrestrictedResize,
|
|
|
|
MouseShade, MouseSetShade, MouseUnsetShade,
|
|
|
|
MouseMaximize, MouseRestore, MouseMinimize,
|
|
|
|
MouseNextDesktop, MousePreviousDesktop,
|
|
|
|
MouseAbove, MouseBelow,
|
|
|
|
MouseOpacityMore, MouseOpacityLess,
|
2012-01-12 06:42:55 +00:00
|
|
|
MouseClose, MousePreviousTab, MouseNextTab, MouseDragTab,
|
2011-01-30 14:34:42 +00:00
|
|
|
MouseNothing
|
|
|
|
};
|
|
|
|
|
|
|
|
enum MouseWheelCommand {
|
|
|
|
MouseWheelRaiseLower, MouseWheelShadeUnshade, MouseWheelMaximizeRestore,
|
|
|
|
MouseWheelAboveBelow, MouseWheelPreviousNextDesktop,
|
2012-01-12 06:42:55 +00:00
|
|
|
MouseWheelChangeOpacity, MouseWheelChangeCurrentTab,
|
2011-01-30 14:34:42 +00:00
|
|
|
MouseWheelNothing
|
2007-04-29 17:35:43 +00:00
|
|
|
};
|
|
|
|
|
2012-02-20 11:29:59 +00:00
|
|
|
MouseCommand operationTitlebarMouseWheel(int delta) const {
|
2011-01-30 14:34:42 +00:00
|
|
|
return wheelToMouseCommand(CmdTitlebarWheel, delta);
|
|
|
|
}
|
2012-02-20 11:29:59 +00:00
|
|
|
MouseCommand operationWindowMouseWheel(int delta) const {
|
2011-01-30 14:34:42 +00:00
|
|
|
return wheelToMouseCommand(CmdAllWheel, delta);
|
|
|
|
}
|
|
|
|
|
2012-02-20 11:29:59 +00:00
|
|
|
MouseCommand commandActiveTitlebar1() const {
|
2011-01-30 14:34:42 +00:00
|
|
|
return CmdActiveTitlebar1;
|
|
|
|
}
|
2012-02-20 11:29:59 +00:00
|
|
|
MouseCommand commandActiveTitlebar2() const {
|
2011-01-30 14:34:42 +00:00
|
|
|
return CmdActiveTitlebar2;
|
|
|
|
}
|
2012-02-20 11:29:59 +00:00
|
|
|
MouseCommand commandActiveTitlebar3() const {
|
2011-01-30 14:34:42 +00:00
|
|
|
return CmdActiveTitlebar3;
|
|
|
|
}
|
2012-02-20 11:29:59 +00:00
|
|
|
MouseCommand commandInactiveTitlebar1() const {
|
2011-01-30 14:34:42 +00:00
|
|
|
return CmdInactiveTitlebar1;
|
|
|
|
}
|
2012-02-20 11:29:59 +00:00
|
|
|
MouseCommand commandInactiveTitlebar2() const {
|
2011-01-30 14:34:42 +00:00
|
|
|
return CmdInactiveTitlebar2;
|
|
|
|
}
|
2012-02-20 11:29:59 +00:00
|
|
|
MouseCommand commandInactiveTitlebar3() const {
|
2011-01-30 14:34:42 +00:00
|
|
|
return CmdInactiveTitlebar3;
|
|
|
|
}
|
2012-02-20 11:29:59 +00:00
|
|
|
MouseCommand commandWindow1() const {
|
2011-01-30 14:34:42 +00:00
|
|
|
return CmdWindow1;
|
|
|
|
}
|
2012-02-20 11:29:59 +00:00
|
|
|
MouseCommand commandWindow2() const {
|
2011-01-30 14:34:42 +00:00
|
|
|
return CmdWindow2;
|
|
|
|
}
|
2012-02-20 11:29:59 +00:00
|
|
|
MouseCommand commandWindow3() const {
|
2011-01-30 14:34:42 +00:00
|
|
|
return CmdWindow3;
|
|
|
|
}
|
2012-02-20 11:29:59 +00:00
|
|
|
MouseCommand commandWindowWheel() const {
|
2011-01-30 14:34:42 +00:00
|
|
|
return CmdWindowWheel;
|
|
|
|
}
|
2012-02-20 11:29:59 +00:00
|
|
|
MouseCommand commandAll1() const {
|
2011-01-30 14:34:42 +00:00
|
|
|
return CmdAll1;
|
|
|
|
}
|
2012-02-20 11:29:59 +00:00
|
|
|
MouseCommand commandAll2() const {
|
2011-01-30 14:34:42 +00:00
|
|
|
return CmdAll2;
|
|
|
|
}
|
2012-02-20 11:29:59 +00:00
|
|
|
MouseCommand commandAll3() const {
|
2011-01-30 14:34:42 +00:00
|
|
|
return CmdAll3;
|
|
|
|
}
|
2012-02-20 11:29:59 +00:00
|
|
|
uint keyCmdAllModKey() const {
|
2011-01-30 14:34:42 +00:00
|
|
|
return CmdAllModKey;
|
|
|
|
}
|
2016-02-17 16:04:11 +00:00
|
|
|
Qt::KeyboardModifier commandAllModifier() const {
|
|
|
|
switch (CmdAllModKey) {
|
|
|
|
case Qt::Key_Alt:
|
|
|
|
return Qt::AltModifier;
|
|
|
|
case Qt::Key_Meta:
|
|
|
|
return Qt::MetaModifier;
|
|
|
|
default:
|
|
|
|
Q_UNREACHABLE();
|
|
|
|
}
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
static WindowOperation windowOperation(const QString &name, bool restricted);
|
|
|
|
static MouseCommand mouseCommand(const QString &name, bool restricted);
|
|
|
|
static MouseWheelCommand mouseWheelCommand(const QString &name);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @returns true if the Geometry Tip should be shown during a window move/resize.
|
|
|
|
*/
|
2012-02-20 11:29:59 +00:00
|
|
|
bool showGeometryTip() const;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2012-10-16 20:42:19 +00:00
|
|
|
/**
|
|
|
|
* returns whether the user prefers his caption clean
|
|
|
|
*/
|
|
|
|
bool condensedTitle() const;
|
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
/**
|
|
|
|
* @returns true if a window gets maximized when it reaches top screen edge
|
|
|
|
* while being moved.
|
|
|
|
*/
|
|
|
|
bool electricBorderMaximize() const {
|
|
|
|
return electric_border_maximize;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @returns true if window is tiled to half screen when reaching left or
|
|
|
|
* right screen edge while been moved
|
|
|
|
*/
|
|
|
|
bool electricBorderTiling() const {
|
|
|
|
return electric_border_tiling;
|
|
|
|
}
|
2012-09-19 20:48:52 +00:00
|
|
|
/**
|
|
|
|
* @returns the factor that determines the corner part of the edge (ie. 0.1 means tiny corner)
|
|
|
|
*/
|
|
|
|
float electricBorderCornerRatio() const {
|
|
|
|
return electric_border_corner_ratio;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
bool borderlessMaximizedWindows() const {
|
|
|
|
return borderless_maximized_windows;
|
|
|
|
}
|
|
|
|
|
|
|
|
// timeout before non-responding application will be killed after attempt to close
|
2012-02-20 09:25:13 +00:00
|
|
|
int killPingTimeout() const {
|
|
|
|
return m_killPingTimeout;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
// Whether to hide utility windows for inactive applications.
|
2012-02-20 09:25:13 +00:00
|
|
|
bool isHideUtilityWindowsForInactive() const {
|
|
|
|
return m_hideUtilityWindowsForInactive;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2012-02-20 09:25:13 +00:00
|
|
|
bool isInactiveTabsSkipTaskbar() const {
|
|
|
|
return m_inactiveTabsSkipTaskbar;
|
|
|
|
}
|
|
|
|
bool isAutogroupSimilarWindows() const {
|
|
|
|
return m_autogroupSimilarWindows;
|
|
|
|
}
|
|
|
|
bool isAutogroupInForeground() const {
|
|
|
|
return m_autogroupInForeground;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
// Desktop effects
|
|
|
|
double animationTimeFactor() const;
|
|
|
|
|
|
|
|
//----------------------
|
|
|
|
// Compositing settings
|
2011-02-27 22:39:32 +00:00
|
|
|
void reloadCompositingSettings(bool force = false);
|
2012-02-20 09:25:13 +00:00
|
|
|
CompositingType compositingMode() const {
|
|
|
|
return m_compositingMode;
|
|
|
|
}
|
|
|
|
void setCompositingMode(CompositingType mode) {
|
|
|
|
m_compositingMode = mode;
|
|
|
|
}
|
|
|
|
// Separate to mode so the user can toggle
|
2016-05-09 14:41:37 +00:00
|
|
|
bool isUseCompositing() const;
|
2012-02-20 09:25:13 +00:00
|
|
|
bool isCompositingInitialized() const {
|
|
|
|
return m_compositingInitialized;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
// General preferences
|
2012-02-20 09:25:13 +00:00
|
|
|
HiddenPreviews hiddenPreviews() const {
|
|
|
|
return m_hiddenPreviews;
|
|
|
|
}
|
2016-05-09 14:41:37 +00:00
|
|
|
bool isUnredirectFullscreen() const;
|
2011-01-30 14:34:42 +00:00
|
|
|
// OpenGL
|
2012-02-20 09:25:13 +00:00
|
|
|
// 0 = no, 1 = yes when transformed,
|
2011-01-30 14:34:42 +00:00
|
|
|
// 2 = try trilinear when transformed; else 1,
|
|
|
|
// -1 = auto
|
2012-02-20 09:25:13 +00:00
|
|
|
int glSmoothScale() const {
|
|
|
|
return m_glSmoothScale;
|
|
|
|
}
|
2012-11-13 20:41:02 +00:00
|
|
|
bool isColorCorrected() const {
|
|
|
|
return m_colorCorrected;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
// XRender
|
2012-02-20 09:25:13 +00:00
|
|
|
bool isXrenderSmoothScale() const {
|
|
|
|
return m_xrenderSmoothScale;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2013-03-28 20:53:25 +00:00
|
|
|
qint64 maxFpsInterval() const {
|
2012-02-20 09:25:13 +00:00
|
|
|
return m_maxFpsInterval;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
// Settings that should be auto-detected
|
2012-02-20 09:25:13 +00:00
|
|
|
uint refreshRate() const {
|
|
|
|
return m_refreshRate;
|
|
|
|
}
|
2013-03-28 20:53:25 +00:00
|
|
|
qint64 vBlankTime() const {
|
2012-03-29 20:11:28 +00:00
|
|
|
return m_vBlankTime;
|
|
|
|
}
|
2012-02-20 09:25:13 +00:00
|
|
|
bool isGlStrictBinding() const {
|
|
|
|
return m_glStrictBinding;
|
|
|
|
}
|
2012-04-28 08:53:55 +00:00
|
|
|
bool isGlStrictBindingFollowsDriver() const {
|
|
|
|
return m_glStrictBindingFollowsDriver;
|
|
|
|
}
|
2013-03-13 15:21:15 +00:00
|
|
|
bool glCoreProfile() const {
|
|
|
|
return m_glCoreProfile;
|
|
|
|
}
|
2014-04-22 07:30:08 +00:00
|
|
|
OpenGLPlatformInterface glPlatformInterface() const {
|
|
|
|
return m_glPlatformInterface;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2013-02-18 22:17:46 +00:00
|
|
|
enum GlSwapStrategy { NoSwapEncourage = 0, CopyFrontBuffer = 'c', PaintFullScreen = 'p', ExtendDamage = 'e', AutoSwapStrategy = 'a' };
|
|
|
|
GlSwapStrategy glPreferBufferSwap() const {
|
|
|
|
return m_glPreferBufferSwap;
|
|
|
|
}
|
|
|
|
|
Add support for modifier only shortcuts on Wayland
On popular demand!
This change tracks how modifiers are used and detects a modifier only
key press/release. That is:
* no other key is pressed when the modifier gets pressed
* no other key gets pressed before the modifier gets released
If such a press/release is detected, we call a configurable dbus call.
The possible shortcuts can be configured in kwinrc, group
"ModifierOnlyShortcuts". The following keys are supported:
* Shift
* Control
* Alt
* Meta
As value it takes a QStringList (comma seperated string) with
service,path,interface,method,additionalargs
E.g. to invoke Desktop Grid effect on Meta key:
[ModifierOnlyShortcuts]
Meta=org.kde.kglobalaccel,/component/kwin/,org.kde.kglobalaccel.Component,invokeShortcut,ShowDesktopGrid
I do not intend to add a config interface for it. Let's keep it a hidden
way.
REVIEW: 124954
2015-08-27 15:56:28 +00:00
|
|
|
QStringList modifierOnlyDBusShortcut(Qt::KeyboardModifier mod) const;
|
|
|
|
|
2012-04-12 06:34:46 +00:00
|
|
|
// setters
|
|
|
|
void setFocusPolicy(FocusPolicy focusPolicy);
|
|
|
|
void setNextFocusPrefersMouse(bool nextFocusPrefersMouse);
|
|
|
|
void setClickRaise(bool clickRaise);
|
|
|
|
void setAutoRaise(bool autoRaise);
|
|
|
|
void setAutoRaiseInterval(int autoRaiseInterval);
|
|
|
|
void setDelayFocusInterval(int delayFocusInterval);
|
|
|
|
void setShadeHover(bool shadeHover);
|
|
|
|
void setShadeHoverInterval(int shadeHoverInterval);
|
|
|
|
void setSeparateScreenFocus(bool separateScreenFocus);
|
|
|
|
void setPlacement(int placement);
|
|
|
|
void setBorderSnapZone(int borderSnapZone);
|
|
|
|
void setWindowSnapZone(int windowSnapZone);
|
|
|
|
void setCenterSnapZone(int centerSnapZone);
|
|
|
|
void setSnapOnlyWhenOverlapping(bool snapOnlyWhenOverlapping);
|
|
|
|
void setRollOverDesktops(bool rollOverDesktops);
|
|
|
|
void setFocusStealingPreventionLevel(int focusStealingPreventionLevel);
|
|
|
|
void setLegacyFullscreenSupport(bool legacyFullscreenSupport);
|
|
|
|
void setOperationTitlebarDblClick(WindowOperation operationTitlebarDblClick);
|
2014-12-02 08:43:24 +00:00
|
|
|
void setOperationMaxButtonLeftClick(WindowOperation op);
|
|
|
|
void setOperationMaxButtonRightClick(WindowOperation op);
|
|
|
|
void setOperationMaxButtonMiddleClick(WindowOperation op);
|
2012-04-12 06:34:46 +00:00
|
|
|
void setCommandActiveTitlebar1(MouseCommand commandActiveTitlebar1);
|
|
|
|
void setCommandActiveTitlebar2(MouseCommand commandActiveTitlebar2);
|
|
|
|
void setCommandActiveTitlebar3(MouseCommand commandActiveTitlebar3);
|
|
|
|
void setCommandInactiveTitlebar1(MouseCommand commandInactiveTitlebar1);
|
|
|
|
void setCommandInactiveTitlebar2(MouseCommand commandInactiveTitlebar2);
|
|
|
|
void setCommandInactiveTitlebar3(MouseCommand commandInactiveTitlebar3);
|
|
|
|
void setCommandWindow1(MouseCommand commandWindow1);
|
|
|
|
void setCommandWindow2(MouseCommand commandWindow2);
|
|
|
|
void setCommandWindow3(MouseCommand commandWindow3);
|
|
|
|
void setCommandWindowWheel(MouseCommand commandWindowWheel);
|
|
|
|
void setCommandAll1(MouseCommand commandAll1);
|
|
|
|
void setCommandAll2(MouseCommand commandAll2);
|
|
|
|
void setCommandAll3(MouseCommand commandAll3);
|
|
|
|
void setKeyCmdAllModKey(uint keyCmdAllModKey);
|
|
|
|
void setShowGeometryTip(bool showGeometryTip);
|
2012-10-16 20:42:19 +00:00
|
|
|
void setCondensedTitle(bool condensedTitle);
|
2012-04-12 06:34:46 +00:00
|
|
|
void setElectricBorderMaximize(bool electricBorderMaximize);
|
|
|
|
void setElectricBorderTiling(bool electricBorderTiling);
|
2012-09-19 20:48:52 +00:00
|
|
|
void setElectricBorderCornerRatio(float electricBorderCornerRatio);
|
2012-04-12 06:34:46 +00:00
|
|
|
void setBorderlessMaximizedWindows(bool borderlessMaximizedWindows);
|
|
|
|
void setKillPingTimeout(int killPingTimeout);
|
|
|
|
void setHideUtilityWindowsForInactive(bool hideUtilityWindowsForInactive);
|
|
|
|
void setInactiveTabsSkipTaskbar(bool inactiveTabsSkipTaskbar);
|
|
|
|
void setAutogroupSimilarWindows(bool autogroupSimilarWindows);
|
|
|
|
void setAutogroupInForeground(bool autogroupInForeground);
|
|
|
|
void setCompositingMode(int compositingMode);
|
|
|
|
void setUseCompositing(bool useCompositing);
|
|
|
|
void setCompositingInitialized(bool compositingInitialized);
|
|
|
|
void setHiddenPreviews(int hiddenPreviews);
|
|
|
|
void setUnredirectFullscreen(bool unredirectFullscreen);
|
|
|
|
void setGlSmoothScale(int glSmoothScale);
|
|
|
|
void setXrenderSmoothScale(bool xrenderSmoothScale);
|
2013-03-28 20:53:25 +00:00
|
|
|
void setMaxFpsInterval(qint64 maxFpsInterval);
|
2012-04-12 06:34:46 +00:00
|
|
|
void setRefreshRate(uint refreshRate);
|
2013-03-28 20:53:25 +00:00
|
|
|
void setVBlankTime(qint64 vBlankTime);
|
2012-04-12 06:34:46 +00:00
|
|
|
void setGlStrictBinding(bool glStrictBinding);
|
2012-04-28 08:53:55 +00:00
|
|
|
void setGlStrictBindingFollowsDriver(bool glStrictBindingFollowsDriver);
|
2013-03-13 15:21:15 +00:00
|
|
|
void setGLCoreProfile(bool glCoreProfile);
|
2013-02-18 22:17:46 +00:00
|
|
|
void setGlPreferBufferSwap(char glPreferBufferSwap);
|
2014-04-22 07:30:08 +00:00
|
|
|
void setGlPlatformInterface(OpenGLPlatformInterface interface);
|
2012-04-12 06:34:46 +00:00
|
|
|
|
2012-04-12 07:24:14 +00:00
|
|
|
// default values
|
|
|
|
static WindowOperation defaultOperationTitlebarDblClick() {
|
|
|
|
return MaximizeOp;
|
|
|
|
}
|
2014-12-02 08:43:24 +00:00
|
|
|
static WindowOperation defaultOperationMaxButtonLeftClick() {
|
|
|
|
return MaximizeOp;
|
|
|
|
}
|
|
|
|
static WindowOperation defaultOperationMaxButtonRightClick() {
|
|
|
|
return HMaximizeOp;
|
|
|
|
}
|
|
|
|
static WindowOperation defaultOperationMaxButtonMiddleClick() {
|
|
|
|
return VMaximizeOp;
|
|
|
|
}
|
2012-04-12 07:24:14 +00:00
|
|
|
static MouseCommand defaultCommandActiveTitlebar1() {
|
|
|
|
return MouseRaise;
|
|
|
|
}
|
|
|
|
static MouseCommand defaultCommandActiveTitlebar2() {
|
|
|
|
return MouseDragTab;
|
|
|
|
}
|
|
|
|
static MouseCommand defaultCommandActiveTitlebar3() {
|
|
|
|
return MouseOperationsMenu;
|
|
|
|
}
|
|
|
|
static MouseCommand defaultCommandInactiveTitlebar1() {
|
|
|
|
return MouseActivateAndRaise;
|
|
|
|
}
|
|
|
|
static MouseCommand defaultCommandInactiveTitlebar2() {
|
|
|
|
return MouseDragTab;
|
|
|
|
}
|
|
|
|
static MouseCommand defaultCommandInactiveTitlebar3() {
|
|
|
|
return MouseOperationsMenu;
|
|
|
|
}
|
|
|
|
static MouseCommand defaultCommandWindow1() {
|
|
|
|
return MouseActivateRaiseAndPassClick;
|
|
|
|
}
|
|
|
|
static MouseCommand defaultCommandWindow2() {
|
|
|
|
return MouseActivateAndPassClick;
|
|
|
|
}
|
|
|
|
static MouseCommand defaultCommandWindow3() {
|
|
|
|
return MouseActivateAndPassClick;
|
|
|
|
}
|
|
|
|
static MouseCommand defaultCommandWindowWheel() {
|
|
|
|
return MouseNothing;
|
|
|
|
}
|
|
|
|
static MouseCommand defaultCommandAll1() {
|
|
|
|
return MouseUnrestrictedMove;
|
|
|
|
}
|
|
|
|
static MouseCommand defaultCommandAll2() {
|
|
|
|
return MouseToggleRaiseAndLower;
|
|
|
|
}
|
|
|
|
static MouseCommand defaultCommandAll3() {
|
|
|
|
return MouseUnrestrictedResize;
|
|
|
|
}
|
|
|
|
static MouseWheelCommand defaultCommandTitlebarWheel() {
|
|
|
|
return MouseWheelChangeCurrentTab;
|
|
|
|
}
|
|
|
|
static MouseWheelCommand defaultCommandAllWheel() {
|
|
|
|
return MouseWheelNothing;
|
|
|
|
}
|
|
|
|
static uint defaultKeyCmdAllModKey() {
|
|
|
|
return Qt::Key_Alt;
|
|
|
|
}
|
|
|
|
static bool defaultAutogroupInForeground() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
static CompositingType defaultCompositingMode() {
|
|
|
|
return OpenGLCompositing;
|
|
|
|
}
|
|
|
|
static bool defaultUseCompositing() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
static bool defaultCompositingInitialized() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
static HiddenPreviews defaultHiddenPreviews() {
|
|
|
|
return HiddenPreviewsShown;
|
|
|
|
}
|
|
|
|
static bool defaultUnredirectFullscreen() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
static int defaultGlSmoothScale() {
|
|
|
|
return 2;
|
|
|
|
}
|
2012-11-13 20:41:02 +00:00
|
|
|
static bool defaultColorCorrected() {
|
|
|
|
return false;
|
|
|
|
}
|
2012-04-12 07:24:14 +00:00
|
|
|
static bool defaultXrenderSmoothScale() {
|
|
|
|
return false;
|
|
|
|
}
|
2013-03-28 20:53:25 +00:00
|
|
|
static qint64 defaultMaxFpsInterval() {
|
|
|
|
return (1 * 1000 * 1000 * 1000) /60.0; // nanoseconds / Hz
|
2012-04-12 07:24:14 +00:00
|
|
|
}
|
|
|
|
static int defaultMaxFps() {
|
|
|
|
return 60;
|
|
|
|
}
|
|
|
|
static uint defaultRefreshRate() {
|
|
|
|
return 0;
|
|
|
|
}
|
2012-03-29 20:11:28 +00:00
|
|
|
static uint defaultVBlankTime() {
|
2013-03-28 20:53:25 +00:00
|
|
|
return 6000; // 6ms
|
2012-03-29 20:11:28 +00:00
|
|
|
}
|
2012-04-12 07:24:14 +00:00
|
|
|
static bool defaultGlStrictBinding() {
|
|
|
|
return true;
|
|
|
|
}
|
2012-04-28 08:53:55 +00:00
|
|
|
static bool defaultGlStrictBindingFollowsDriver() {
|
|
|
|
return true;
|
|
|
|
}
|
2013-03-13 15:21:15 +00:00
|
|
|
static bool defaultGLCoreProfile() {
|
|
|
|
return false;
|
|
|
|
}
|
2013-02-18 22:17:46 +00:00
|
|
|
static GlSwapStrategy defaultGlPreferBufferSwap() {
|
|
|
|
return AutoSwapStrategy;
|
|
|
|
}
|
2014-04-22 07:30:08 +00:00
|
|
|
static OpenGLPlatformInterface defaultGlPlatformInterface() {
|
|
|
|
return kwinApp()->shouldUseWaylandForCompositing() ? EglPlatformInterface : GlxPlatformInterface;
|
|
|
|
};
|
2012-04-12 07:24:14 +00:00
|
|
|
static int defaultAnimationSpeed() {
|
|
|
|
return 3;
|
|
|
|
}
|
2012-04-12 17:42:49 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Performs loading all settings except compositing related.
|
|
|
|
**/
|
2013-08-23 10:36:30 +00:00
|
|
|
void loadConfig();
|
2012-04-12 17:42:49 +00:00
|
|
|
/**
|
|
|
|
* Performs loading of compositing settings which do not depend on OpenGL.
|
|
|
|
**/
|
|
|
|
bool loadCompositingConfig(bool force);
|
|
|
|
void reparseConfiguration();
|
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
//----------------------
|
2012-02-21 08:23:18 +00:00
|
|
|
Q_SIGNALS:
|
2012-04-12 06:34:46 +00:00
|
|
|
// for properties
|
|
|
|
void focusPolicyChanged();
|
2013-10-18 17:01:04 +00:00
|
|
|
void focusPolicyIsResonableChanged();
|
2012-04-12 06:34:46 +00:00
|
|
|
void nextFocusPrefersMouseChanged();
|
|
|
|
void clickRaiseChanged();
|
|
|
|
void autoRaiseChanged();
|
|
|
|
void autoRaiseIntervalChanged();
|
|
|
|
void delayFocusIntervalChanged();
|
|
|
|
void shadeHoverChanged();
|
|
|
|
void shadeHoverIntervalChanged();
|
2012-11-20 16:26:50 +00:00
|
|
|
void separateScreenFocusChanged(bool);
|
2012-04-12 06:34:46 +00:00
|
|
|
void placementChanged();
|
|
|
|
void borderSnapZoneChanged();
|
|
|
|
void windowSnapZoneChanged();
|
|
|
|
void centerSnapZoneChanged();
|
|
|
|
void snapOnlyWhenOverlappingChanged();
|
2012-11-16 07:23:47 +00:00
|
|
|
void rollOverDesktopsChanged(bool enabled);
|
2012-04-12 06:34:46 +00:00
|
|
|
void focusStealingPreventionLevelChanged();
|
|
|
|
void legacyFullscreenSupportChanged();
|
|
|
|
void operationTitlebarDblClickChanged();
|
2014-12-02 08:43:24 +00:00
|
|
|
void operationMaxButtonLeftClickChanged();
|
|
|
|
void operationMaxButtonRightClickChanged();
|
|
|
|
void operationMaxButtonMiddleClickChanged();
|
2012-04-12 06:34:46 +00:00
|
|
|
void commandActiveTitlebar1Changed();
|
|
|
|
void commandActiveTitlebar2Changed();
|
|
|
|
void commandActiveTitlebar3Changed();
|
|
|
|
void commandInactiveTitlebar1Changed();
|
|
|
|
void commandInactiveTitlebar2Changed();
|
|
|
|
void commandInactiveTitlebar3Changed();
|
|
|
|
void commandWindow1Changed();
|
|
|
|
void commandWindow2Changed();
|
|
|
|
void commandWindow3Changed();
|
|
|
|
void commandWindowWheelChanged();
|
|
|
|
void commandAll1Changed();
|
|
|
|
void commandAll2Changed();
|
|
|
|
void commandAll3Changed();
|
|
|
|
void keyCmdAllModKeyChanged();
|
|
|
|
void showGeometryTipChanged();
|
2012-10-16 20:42:19 +00:00
|
|
|
void condensedTitleChanged();
|
2012-04-12 06:34:46 +00:00
|
|
|
void electricBorderMaximizeChanged();
|
|
|
|
void electricBorderTilingChanged();
|
2012-09-19 20:48:52 +00:00
|
|
|
void electricBorderCornerRatioChanged();
|
2012-04-12 06:34:46 +00:00
|
|
|
void borderlessMaximizedWindowsChanged();
|
|
|
|
void killPingTimeoutChanged();
|
|
|
|
void hideUtilityWindowsForInactiveChanged();
|
|
|
|
void inactiveTabsSkipTaskbarChanged();
|
|
|
|
void autogroupSimilarWindowsChanged();
|
|
|
|
void autogroupInForegroundChanged();
|
|
|
|
void compositingModeChanged();
|
|
|
|
void useCompositingChanged();
|
|
|
|
void compositingInitializedChanged();
|
|
|
|
void hiddenPreviewsChanged();
|
|
|
|
void unredirectFullscreenChanged();
|
|
|
|
void glSmoothScaleChanged();
|
2012-11-13 20:41:02 +00:00
|
|
|
void colorCorrectedChanged();
|
2012-04-12 06:34:46 +00:00
|
|
|
void xrenderSmoothScaleChanged();
|
|
|
|
void maxFpsIntervalChanged();
|
|
|
|
void refreshRateChanged();
|
2012-03-29 20:11:28 +00:00
|
|
|
void vBlankTimeChanged();
|
2012-04-12 06:34:46 +00:00
|
|
|
void glStrictBindingChanged();
|
2012-04-28 08:53:55 +00:00
|
|
|
void glStrictBindingFollowsDriverChanged();
|
2013-03-13 15:21:15 +00:00
|
|
|
void glCoreProfileChanged();
|
2013-02-18 22:17:46 +00:00
|
|
|
void glPreferBufferSwapChanged();
|
2014-04-22 07:30:08 +00:00
|
|
|
void glPlatformInterfaceChanged();
|
2012-04-12 06:34:46 +00:00
|
|
|
|
2014-12-02 08:51:52 +00:00
|
|
|
void configChanged();
|
|
|
|
|
2012-12-16 08:30:50 +00:00
|
|
|
public Q_SLOTS:
|
|
|
|
void setColorCorrected(bool colorCorrected = false);
|
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
private:
|
2012-04-12 06:34:46 +00:00
|
|
|
void setElectricBorders(int borders);
|
2013-01-24 14:25:34 +00:00
|
|
|
void syncFromKcfgc();
|
|
|
|
QScopedPointer<Settings> m_settings;
|
2012-02-20 09:25:13 +00:00
|
|
|
FocusPolicy m_focusPolicy;
|
|
|
|
bool m_nextFocusPrefersMouse;
|
|
|
|
bool m_clickRaise;
|
|
|
|
bool m_autoRaise;
|
|
|
|
int m_autoRaiseInterval;
|
|
|
|
int m_delayFocusInterval;
|
|
|
|
bool m_shadeHover;
|
|
|
|
int m_shadeHoverInterval;
|
|
|
|
bool m_separateScreenFocus;
|
|
|
|
Placement::Policy m_placement;
|
|
|
|
int m_borderSnapZone;
|
|
|
|
int m_windowSnapZone;
|
|
|
|
int m_centerSnapZone;
|
|
|
|
bool m_snapOnlyWhenOverlapping;
|
|
|
|
bool m_rollOverDesktops;
|
|
|
|
int m_focusStealingPreventionLevel;
|
|
|
|
bool m_legacyFullscreenSupport;
|
|
|
|
int m_killPingTimeout;
|
|
|
|
bool m_hideUtilityWindowsForInactive;
|
|
|
|
bool m_inactiveTabsSkipTaskbar;
|
|
|
|
bool m_autogroupSimilarWindows;
|
|
|
|
bool m_autogroupInForeground;
|
|
|
|
|
|
|
|
CompositingType m_compositingMode;
|
|
|
|
bool m_useCompositing;
|
|
|
|
bool m_compositingInitialized;
|
|
|
|
HiddenPreviews m_hiddenPreviews;
|
|
|
|
bool m_unredirectFullscreen;
|
|
|
|
int m_glSmoothScale;
|
2012-11-13 20:41:02 +00:00
|
|
|
bool m_colorCorrected;
|
2012-02-20 09:25:13 +00:00
|
|
|
bool m_xrenderSmoothScale;
|
2013-03-28 20:53:25 +00:00
|
|
|
qint64 m_maxFpsInterval;
|
2012-02-20 09:25:13 +00:00
|
|
|
// Settings that should be auto-detected
|
|
|
|
uint m_refreshRate;
|
2013-03-28 20:53:25 +00:00
|
|
|
qint64 m_vBlankTime;
|
2012-02-20 09:25:13 +00:00
|
|
|
bool m_glStrictBinding;
|
2012-04-28 08:53:55 +00:00
|
|
|
bool m_glStrictBindingFollowsDriver;
|
2013-03-13 15:21:15 +00:00
|
|
|
bool m_glCoreProfile;
|
2013-02-18 22:17:46 +00:00
|
|
|
GlSwapStrategy m_glPreferBufferSwap;
|
2014-04-22 07:30:08 +00:00
|
|
|
OpenGLPlatformInterface m_glPlatformInterface;
|
2012-02-20 09:25:13 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
WindowOperation OpTitlebarDblClick;
|
2014-12-02 08:43:24 +00:00
|
|
|
WindowOperation opMaxButtonRightClick = defaultOperationMaxButtonRightClick();
|
|
|
|
WindowOperation opMaxButtonMiddleClick = defaultOperationMaxButtonMiddleClick();
|
|
|
|
WindowOperation opMaxButtonLeftClick = defaultOperationMaxButtonRightClick();
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
// mouse bindings
|
|
|
|
MouseCommand CmdActiveTitlebar1;
|
|
|
|
MouseCommand CmdActiveTitlebar2;
|
|
|
|
MouseCommand CmdActiveTitlebar3;
|
|
|
|
MouseCommand CmdInactiveTitlebar1;
|
|
|
|
MouseCommand CmdInactiveTitlebar2;
|
|
|
|
MouseCommand CmdInactiveTitlebar3;
|
|
|
|
MouseWheelCommand CmdTitlebarWheel;
|
|
|
|
MouseCommand CmdWindow1;
|
|
|
|
MouseCommand CmdWindow2;
|
|
|
|
MouseCommand CmdWindow3;
|
|
|
|
MouseCommand CmdWindowWheel;
|
|
|
|
MouseCommand CmdAll1;
|
|
|
|
MouseCommand CmdAll2;
|
|
|
|
MouseCommand CmdAll3;
|
|
|
|
MouseWheelCommand CmdAllWheel;
|
|
|
|
uint CmdAllModKey;
|
|
|
|
|
|
|
|
bool electric_border_maximize;
|
|
|
|
bool electric_border_tiling;
|
2012-09-19 20:48:52 +00:00
|
|
|
float electric_border_corner_ratio;
|
2011-01-30 14:34:42 +00:00
|
|
|
bool borderless_maximized_windows;
|
|
|
|
bool show_geometry_tip;
|
2012-10-16 20:42:19 +00:00
|
|
|
bool condensed_title;
|
2011-01-30 14:34:42 +00:00
|
|
|
int animationSpeed; // 0 - instant, 5 - very slow
|
|
|
|
|
Add support for modifier only shortcuts on Wayland
On popular demand!
This change tracks how modifiers are used and detects a modifier only
key press/release. That is:
* no other key is pressed when the modifier gets pressed
* no other key gets pressed before the modifier gets released
If such a press/release is detected, we call a configurable dbus call.
The possible shortcuts can be configured in kwinrc, group
"ModifierOnlyShortcuts". The following keys are supported:
* Shift
* Control
* Alt
* Meta
As value it takes a QStringList (comma seperated string) with
service,path,interface,method,additionalargs
E.g. to invoke Desktop Grid effect on Meta key:
[ModifierOnlyShortcuts]
Meta=org.kde.kglobalaccel,/component/kwin/,org.kde.kglobalaccel.Component,invokeShortcut,ShowDesktopGrid
I do not intend to add a config interface for it. Let's keep it a hidden
way.
REVIEW: 124954
2015-08-27 15:56:28 +00:00
|
|
|
QHash<Qt::KeyboardModifier, QStringList> m_modifierOnlyShortcuts;
|
|
|
|
|
2012-02-20 11:29:59 +00:00
|
|
|
MouseCommand wheelToMouseCommand(MouseWheelCommand com, int delta) const;
|
2011-01-30 14:34:42 +00:00
|
|
|
};
|
|
|
|
|
2015-05-05 15:58:09 +00:00
|
|
|
extern KWIN_EXPORT Options* options;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
2014-12-02 09:39:38 +00:00
|
|
|
Q_DECLARE_METATYPE(KWin::Options::WindowOperation)
|
2014-12-08 15:29:23 +00:00
|
|
|
Q_DECLARE_METATYPE(KWin::OpenGLPlatformInterface)
|
2014-12-02 09:39:38 +00:00
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
#endif
|