2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 1999, 2000 Matthias Ettrich <ettrich@kde.org>
|
|
|
|
SPDX-FileCopyrightText: 2003 Lubos Lunak <l.lunak@kde.org>
|
|
|
|
SPDX-FileCopyrightText: 2012 Martin Gräßlin <m.graesslin@kde.org>
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
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"
|
|
|
|
|
2019-09-25 13:31:48 +00:00
|
|
|
#include <KConfigWatcher>
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
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
|
|
|
|
};
|
|
|
|
|
2020-08-27 09:05:28 +00:00
|
|
|
/**
|
|
|
|
* This enum type specifies whether the Xwayland server must be restarted after a crash.
|
|
|
|
*/
|
|
|
|
enum XwaylandCrashPolicy {
|
|
|
|
Stop,
|
|
|
|
Restart,
|
|
|
|
};
|
|
|
|
|
Introduce RenderLoop
At the moment, our frame scheduling infrastructure is still heavily
based on Xinerama-style rendering. Specifically, we assume that painting
is driven by a single timer, etc.
This change introduces a new type - RenderLoop. Its main purpose is to
drive compositing on a specific output, or in case of X11, on the
overlay window.
With RenderLoop, compositing is synchronized to vblank events. It
exposes the last and the next estimated presentation timestamp. The
expected presentation timestamp can be used by effects to ensure that
animations are synchronized with the upcoming vblank event.
On Wayland, every outputs has its own render loop. On X11, per screen
rendering is not possible, therefore the platform exposes the render
loop for the overlay window. Ideally, the Scene has to expose the
RenderLoop, but as the first step towards better compositing scheduling
it's good as is for the time being.
The RenderLoop tries to minimize the latency by delaying compositing as
close as possible to the next vblank event. One tricky thing about it is
that if compositing is too close to the next vblank event, animations
may become a little bit choppy. However, increasing the latency reduces
the choppiness.
Given that, there is no any "silver bullet" solution for the choppiness
issue, a new option has been added in the Compositing KCM to specify the
amount of latency. By default, it's "Medium," but if a user is not
satisfied with the upstream default, they can tweak it.
2020-11-19 08:52:29 +00:00
|
|
|
/**
|
|
|
|
* This enum type specifies the latency level configured by the user.
|
|
|
|
*/
|
|
|
|
enum LatencyPolicy {
|
|
|
|
LatencyExteremelyLow,
|
|
|
|
LatencyLow,
|
|
|
|
LatencyMedium,
|
|
|
|
LatencyHigh,
|
|
|
|
LatencyExtremelyHigh,
|
|
|
|
};
|
|
|
|
|
2020-11-28 15:12:38 +00:00
|
|
|
/**
|
|
|
|
* This enum type specifies the method for estimating the expected render time.
|
|
|
|
*/
|
|
|
|
enum RenderTimeEstimator {
|
|
|
|
RenderTimeEstimatorMinimum,
|
|
|
|
RenderTimeEstimatorMaximum,
|
|
|
|
RenderTimeEstimatorAverage,
|
|
|
|
};
|
|
|
|
|
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
|
2020-08-27 09:05:28 +00:00
|
|
|
Q_ENUMS(XwaylandCrashPolicy)
|
Introduce RenderLoop
At the moment, our frame scheduling infrastructure is still heavily
based on Xinerama-style rendering. Specifically, we assume that painting
is driven by a single timer, etc.
This change introduces a new type - RenderLoop. Its main purpose is to
drive compositing on a specific output, or in case of X11, on the
overlay window.
With RenderLoop, compositing is synchronized to vblank events. It
exposes the last and the next estimated presentation timestamp. The
expected presentation timestamp can be used by effects to ensure that
animations are synchronized with the upcoming vblank event.
On Wayland, every outputs has its own render loop. On X11, per screen
rendering is not possible, therefore the platform exposes the render
loop for the overlay window. Ideally, the Scene has to expose the
RenderLoop, but as the first step towards better compositing scheduling
it's good as is for the time being.
The RenderLoop tries to minimize the latency by delaying compositing as
close as possible to the next vblank event. One tricky thing about it is
that if compositing is too close to the next vblank event, animations
may become a little bit choppy. However, increasing the latency reduces
the choppiness.
Given that, there is no any "silver bullet" solution for the choppiness
issue, a new option has been added in the Compositing KCM to specify the
amount of latency. By default, it's "Medium," but if a user is not
satisfied with the upstream default, they can tweak it.
2020-11-19 08:52:29 +00:00
|
|
|
Q_ENUMS(LatencyPolicy)
|
2020-11-28 15:12:38 +00:00
|
|
|
Q_ENUMS(RenderTimeEstimator)
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(FocusPolicy focusPolicy READ focusPolicy WRITE setFocusPolicy NOTIFY focusPolicyChanged)
|
2020-08-27 09:05:28 +00:00
|
|
|
Q_PROPERTY(XwaylandCrashPolicy xwaylandCrashPolicy READ xwaylandCrashPolicy WRITE setXwaylandCrashPolicy NOTIFY xwaylandCrashPolicyChanged)
|
|
|
|
Q_PROPERTY(int xwaylandMaxCrashCount READ xwaylandMaxCrashCount WRITE setXwaylandMaxCrashCount NOTIFY xwaylandMaxCrashCountChanged)
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(bool nextFocusPrefersMouse READ isNextFocusPrefersMouse WRITE setNextFocusPrefersMouse NOTIFY nextFocusPrefersMouseChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Whether clicking on a window raises it in FocusFollowsMouse
|
|
|
|
* mode or not.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
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
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Whether autoraise is enabled FocusFollowsMouse mode or not.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
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
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Autoraise interval.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
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
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Delayed focus interval.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
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
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Whether shade hover is enabled or not.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
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
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Shade hover interval.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
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
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Whether to see Xinerama screens separately for focus (in Alt+Tab, when activating next client)
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
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
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* The size of the zone that triggers snapping on desktop borders.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
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
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* The size of the zone that triggers snapping with other windows.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
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
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* The size of the zone that triggers snapping on the screen center.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
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
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Snap only when windows will overlap.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
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
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Whether or not we roll over to the other edge when switching desktops past the edge.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
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()
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(int focusStealingPreventionLevel READ focusStealingPreventionLevel WRITE setFocusStealingPreventionLevel NOTIFY focusStealingPreventionLevelChanged)
|
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
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Whether the Geometry Tip should be shown during a window move/resize.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
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
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Whether the visible name should be condensed.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-10-16 20:42:19 +00:00
|
|
|
Q_PROPERTY(bool condensedTitle READ condensedTitle WRITE setCondensedTitle NOTIFY condensedTitleChanged)
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Whether a window gets maximized when it reaches top screen edge while being moved.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
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
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Whether a window is tiled to half screen when reaching left or right screen edge while been moved.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
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
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Whether a window is tiled to half screen when reaching left or right screen edge while been moved.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-09-19 20:48:52 +00:00
|
|
|
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
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* timeout before non-responding application will be killed after attempt to close.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
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.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(bool hideUtilityWindowsForInactive READ isHideUtilityWindowsForInactive WRITE setHideUtilityWindowsForInactive NOTIFY hideUtilityWindowsForInactiveChanged)
|
|
|
|
Q_PROPERTY(int compositingMode READ compositingMode WRITE setCompositingMode NOTIFY compositingModeChanged)
|
|
|
|
Q_PROPERTY(bool useCompositing READ isUseCompositing WRITE setUseCompositing NOTIFY useCompositingChanged)
|
|
|
|
Q_PROPERTY(int hiddenPreviews READ hiddenPreviews WRITE setHiddenPreviews NOTIFY hiddenPreviewsChanged)
|
2012-02-21 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* 0 = no, 1 = yes when transformed,
|
|
|
|
* 2 = try trilinear when transformed; else 1,
|
|
|
|
* -1 = auto
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-04-12 06:34:46 +00:00
|
|
|
Q_PROPERTY(int glSmoothScale READ glSmoothScale WRITE setGlSmoothScale NOTIFY glSmoothScaleChanged)
|
|
|
|
Q_PROPERTY(bool xrenderSmoothScale READ isXrenderSmoothScale WRITE setXrenderSmoothScale NOTIFY xrenderSmoothScaleChanged)
|
|
|
|
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.
|
2019-01-12 10:31:32 +00:00
|
|
|
* If @c true glStrictBinding is set by the OpenGL Scene during initialization.
|
|
|
|
* If @c false glStrictBinding is set from a config value and not updated during scene initialization.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-04-28 08:53:55 +00:00
|
|
|
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)
|
2016-08-26 06:56:42 +00:00
|
|
|
Q_PROPERTY(bool windowsBlockCompositing READ windowsBlockCompositing WRITE setWindowsBlockCompositing NOTIFY windowsBlockCompositingChanged)
|
Introduce RenderLoop
At the moment, our frame scheduling infrastructure is still heavily
based on Xinerama-style rendering. Specifically, we assume that painting
is driven by a single timer, etc.
This change introduces a new type - RenderLoop. Its main purpose is to
drive compositing on a specific output, or in case of X11, on the
overlay window.
With RenderLoop, compositing is synchronized to vblank events. It
exposes the last and the next estimated presentation timestamp. The
expected presentation timestamp can be used by effects to ensure that
animations are synchronized with the upcoming vblank event.
On Wayland, every outputs has its own render loop. On X11, per screen
rendering is not possible, therefore the platform exposes the render
loop for the overlay window. Ideally, the Scene has to expose the
RenderLoop, but as the first step towards better compositing scheduling
it's good as is for the time being.
The RenderLoop tries to minimize the latency by delaying compositing as
close as possible to the next vblank event. One tricky thing about it is
that if compositing is too close to the next vblank event, animations
may become a little bit choppy. However, increasing the latency reduces
the choppiness.
Given that, there is no any "silver bullet" solution for the choppiness
issue, a new option has been added in the Compositing KCM to specify the
amount of latency. By default, it's "Medium," but if a user is not
satisfied with the upstream default, they can tweak it.
2020-11-19 08:52:29 +00:00
|
|
|
Q_PROPERTY(LatencyPolicy latencyPolicy READ latencyPolicy WRITE setLatencyPolicy NOTIFY latencyPolicyChanged)
|
2020-11-28 15:12:38 +00:00
|
|
|
Q_PROPERTY(RenderTimeEstimator renderTimeEstimator READ renderTimeEstimator WRITE setRenderTimeEstimator NOTIFY renderTimeEstimatorChanged)
|
2011-01-30 14:34:42 +00:00
|
|
|
public:
|
|
|
|
|
Use nullptr everywhere
Summary:
Because KWin is a very old project, we use three kinds of null pointer
literals: 0, NULL, and nullptr. Since C++11, it's recommended to use
nullptr keyword.
This change converts all usages of 0 and NULL literal to nullptr. Even
though it breaks git history, we need to do it in order to have consistent
code as well to ease code reviews (it's very tempting for some people to
add unrelated changes to their patches, e.g. converting NULL to nullptr).
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson, romangg
Reviewed By: #kwin, davidedmundson, romangg
Subscribers: romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23618
2019-09-19 14:46:54 +00:00
|
|
|
explicit Options(QObject *parent = nullptr);
|
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
|
|
|
~Options() override;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2013-08-23 10:36:30 +00:00
|
|
|
void updateSettings();
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2019-02-02 18:17:44 +00:00
|
|
|
/**
|
|
|
|
* This enum type is used to specify the focus policy.
|
|
|
|
*
|
|
|
|
* Note that FocusUnderMouse and FocusStrictlyUnderMouse are not
|
|
|
|
* particulary useful. They are only provided for old-fashined
|
|
|
|
* die-hard UNIX people ;-)
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2019-02-02 18:17:44 +00:00
|
|
|
enum FocusPolicy {
|
|
|
|
/**
|
|
|
|
* Clicking into a window activates it. This is also the default.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2019-02-02 18:17:44 +00:00
|
|
|
ClickToFocus,
|
|
|
|
/**
|
|
|
|
* 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.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2019-02-02 18:17:44 +00:00
|
|
|
FocusFollowsMouse,
|
|
|
|
/**
|
|
|
|
* 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.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2019-02-02 18:17:44 +00:00
|
|
|
FocusUnderMouse,
|
|
|
|
/**
|
|
|
|
* 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.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2019-02-02 18:17:44 +00:00
|
|
|
FocusStrictlyUnderMouse
|
|
|
|
};
|
2020-11-18 14:06:54 +00:00
|
|
|
Q_ENUM(FocusPolicy)
|
2019-02-02 18:17:44 +00:00
|
|
|
|
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
|
|
|
|
2020-08-27 09:05:28 +00:00
|
|
|
XwaylandCrashPolicy xwaylandCrashPolicy() const {
|
|
|
|
return m_xwaylandCrashPolicy;
|
|
|
|
}
|
|
|
|
int xwaylandMaxCrashCount() const {
|
|
|
|
return m_xwaylandMaxCrashCount;
|
|
|
|
}
|
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Whether clicking on a window raises it in FocusFollowsMouse
|
|
|
|
* mode or not.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
bool isClickRaise() const {
|
|
|
|
return m_clickRaise;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Whether autoraise is enabled FocusFollowsMouse mode or not.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
bool isAutoRaise() const {
|
|
|
|
return m_autoRaise;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Autoraise interval
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
int autoRaiseInterval() const {
|
|
|
|
return m_autoRaiseInterval;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Delayed focus interval.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
int delayFocusInterval() const {
|
|
|
|
return m_delayFocusInterval;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Whether shade hover is enabled or not.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
bool isShadeHover() const {
|
|
|
|
return m_shadeHover;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Shade hover interval.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
int shadeHoverInterval() {
|
|
|
|
return m_shadeHoverInterval;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2019-02-02 18:17:44 +00:00
|
|
|
/**
|
|
|
|
* Whether to see Xinerama screens separately for focus (in Alt+Tab, when activating next client)
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
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
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* The size of the zone that triggers snapping on desktop borders.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
int borderSnapZone() const {
|
|
|
|
return m_borderSnapZone;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* The size of the zone that triggers snapping with other windows.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
int windowSnapZone() const {
|
|
|
|
return m_windowSnapZone;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* The size of the zone that triggers snapping on the screen center.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
int centerSnapZone() const {
|
|
|
|
return m_centerSnapZone;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Snap only when windows will overlap.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
bool isSnapOnlyWhenOverlapping() const {
|
|
|
|
return m_snapOnlyWhenOverlapping;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Whether or not we roll over to the other edge when switching desktops past the edge.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
bool isRollOverDesktops() const {
|
|
|
|
return m_rollOverDesktops;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2019-02-02 18:17:44 +00:00
|
|
|
/**
|
|
|
|
* Returns the focus stealing prevention level.
|
|
|
|
*
|
|
|
|
* @see allowClientActivation
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
int focusStealingPreventionLevel() const {
|
|
|
|
return m_focusStealingPreventionLevel;
|
|
|
|
}
|
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,
|
|
|
|
};
|
2020-11-18 14:06:54 +00:00
|
|
|
Q_ENUM(WindowOperation)
|
2014-12-02 09:39:38 +00:00
|
|
|
|
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,
|
2019-09-14 08:58:12 +00:00
|
|
|
MouseClose,
|
2011-01-30 14:34:42 +00:00
|
|
|
MouseNothing
|
|
|
|
};
|
2020-11-18 14:06:54 +00:00
|
|
|
Q_ENUM(MouseCommand)
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
enum MouseWheelCommand {
|
|
|
|
MouseWheelRaiseLower, MouseWheelShadeUnshade, MouseWheelMaximizeRestore,
|
|
|
|
MouseWheelAboveBelow, MouseWheelPreviousNextDesktop,
|
2019-09-14 08:58:12 +00:00
|
|
|
MouseWheelChangeOpacity,
|
2011-01-30 14:34:42 +00:00
|
|
|
MouseWheelNothing
|
2007-04-29 17:35:43 +00:00
|
|
|
};
|
2020-11-18 14:06:54 +00:00
|
|
|
Q_ENUM(MouseWheelCommand)
|
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;
|
|
|
|
}
|
2020-06-23 16:26:36 +00:00
|
|
|
MouseWheelCommand commandAllWheel() const {
|
|
|
|
return CmdAllWheel;
|
|
|
|
}
|
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);
|
|
|
|
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @returns true if the Geometry Tip should be shown during a window move/resize.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
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
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* Returns whether the user prefers his caption clean.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-10-16 20:42:19 +00:00
|
|
|
bool condensedTitle() const;
|
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @returns true if a window gets maximized when it reaches top screen edge
|
|
|
|
* while being moved.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2011-01-30 14:34:42 +00:00
|
|
|
bool electricBorderMaximize() const {
|
|
|
|
return electric_border_maximize;
|
|
|
|
}
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @returns true if window is tiled to half screen when reaching left or
|
|
|
|
* right screen edge while been moved.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2011-01-30 14:34:42 +00:00
|
|
|
bool electricBorderTiling() const {
|
|
|
|
return electric_border_tiling;
|
|
|
|
}
|
2012-09-19 20:48:52 +00:00
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @returns the factor that determines the corner part of the edge (ie. 0.1 means tiny corner)
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-09-19 20:48:52 +00:00
|
|
|
float electricBorderCornerRatio() const {
|
|
|
|
return electric_border_corner_ratio;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
bool borderlessMaximizedWindows() const {
|
|
|
|
return borderless_maximized_windows;
|
|
|
|
}
|
|
|
|
|
2019-02-02 18:17:44 +00:00
|
|
|
/**
|
|
|
|
* Timeout before non-responding application will be killed after attempt to close.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
int killPingTimeout() const {
|
|
|
|
return m_killPingTimeout;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2019-02-02 18:17:44 +00:00
|
|
|
/**
|
|
|
|
* Whether to hide utility windows for inactive applications.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-02-20 09:25:13 +00:00
|
|
|
bool isHideUtilityWindowsForInactive() const {
|
|
|
|
return m_hideUtilityWindowsForInactive;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2019-02-02 18:17:44 +00:00
|
|
|
/**
|
|
|
|
* Returns the animation time factor for desktop effects.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2011-01-30 14:34:42 +00:00
|
|
|
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;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
// General preferences
|
2012-02-20 09:25:13 +00:00
|
|
|
HiddenPreviews hiddenPreviews() const {
|
|
|
|
return m_hiddenPreviews;
|
|
|
|
}
|
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;
|
|
|
|
}
|
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
|
|
|
|
|
|
|
// Settings that should be auto-detected
|
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
|
|
|
|
2021-01-07 08:09:47 +00:00
|
|
|
enum GlSwapStrategy { CopyFrontBuffer = 'c', PaintFullScreen = 'p', ExtendDamage = 'e', AutoSwapStrategy = 'a' };
|
2020-11-18 14:06:54 +00:00
|
|
|
Q_ENUM(GlSwapStrategy)
|
2013-02-18 22:17:46 +00:00
|
|
|
GlSwapStrategy glPreferBufferSwap() const {
|
|
|
|
return m_glPreferBufferSwap;
|
|
|
|
}
|
|
|
|
|
2016-08-26 06:56:42 +00:00
|
|
|
bool windowsBlockCompositing() const
|
|
|
|
{
|
|
|
|
return m_windowsBlockCompositing;
|
|
|
|
}
|
|
|
|
|
2020-10-20 20:15:46 +00:00
|
|
|
bool moveMinimizedWindowsToEndOfTabBoxFocusChain() const {
|
|
|
|
return m_MoveMinimizedWindowsToEndOfTabBoxFocusChain;
|
|
|
|
}
|
|
|
|
|
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;
|
Introduce RenderLoop
At the moment, our frame scheduling infrastructure is still heavily
based on Xinerama-style rendering. Specifically, we assume that painting
is driven by a single timer, etc.
This change introduces a new type - RenderLoop. Its main purpose is to
drive compositing on a specific output, or in case of X11, on the
overlay window.
With RenderLoop, compositing is synchronized to vblank events. It
exposes the last and the next estimated presentation timestamp. The
expected presentation timestamp can be used by effects to ensure that
animations are synchronized with the upcoming vblank event.
On Wayland, every outputs has its own render loop. On X11, per screen
rendering is not possible, therefore the platform exposes the render
loop for the overlay window. Ideally, the Scene has to expose the
RenderLoop, but as the first step towards better compositing scheduling
it's good as is for the time being.
The RenderLoop tries to minimize the latency by delaying compositing as
close as possible to the next vblank event. One tricky thing about it is
that if compositing is too close to the next vblank event, animations
may become a little bit choppy. However, increasing the latency reduces
the choppiness.
Given that, there is no any "silver bullet" solution for the choppiness
issue, a new option has been added in the Compositing KCM to specify the
amount of latency. By default, it's "Medium," but if a user is not
satisfied with the upstream default, they can tweak it.
2020-11-19 08:52:29 +00:00
|
|
|
LatencyPolicy latencyPolicy() const;
|
2020-11-28 15:12:38 +00:00
|
|
|
RenderTimeEstimator renderTimeEstimator() const;
|
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
|
|
|
|
2012-04-12 06:34:46 +00:00
|
|
|
// setters
|
|
|
|
void setFocusPolicy(FocusPolicy focusPolicy);
|
2020-08-27 09:05:28 +00:00
|
|
|
void setXwaylandCrashPolicy(XwaylandCrashPolicy crashPolicy);
|
|
|
|
void setXwaylandMaxCrashCount(int maxCrashCount);
|
2012-04-12 06:34:46 +00:00
|
|
|
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 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 setCompositingMode(int compositingMode);
|
|
|
|
void setUseCompositing(bool useCompositing);
|
|
|
|
void setHiddenPreviews(int hiddenPreviews);
|
|
|
|
void setGlSmoothScale(int glSmoothScale);
|
|
|
|
void setXrenderSmoothScale(bool xrenderSmoothScale);
|
|
|
|
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);
|
2016-08-26 06:56:42 +00:00
|
|
|
void setWindowsBlockCompositing(bool set);
|
2020-10-20 20:15:46 +00:00
|
|
|
void setMoveMinimizedWindowsToEndOfTabBoxFocusChain(bool set);
|
Introduce RenderLoop
At the moment, our frame scheduling infrastructure is still heavily
based on Xinerama-style rendering. Specifically, we assume that painting
is driven by a single timer, etc.
This change introduces a new type - RenderLoop. Its main purpose is to
drive compositing on a specific output, or in case of X11, on the
overlay window.
With RenderLoop, compositing is synchronized to vblank events. It
exposes the last and the next estimated presentation timestamp. The
expected presentation timestamp can be used by effects to ensure that
animations are synchronized with the upcoming vblank event.
On Wayland, every outputs has its own render loop. On X11, per screen
rendering is not possible, therefore the platform exposes the render
loop for the overlay window. Ideally, the Scene has to expose the
RenderLoop, but as the first step towards better compositing scheduling
it's good as is for the time being.
The RenderLoop tries to minimize the latency by delaying compositing as
close as possible to the next vblank event. One tricky thing about it is
that if compositing is too close to the next vblank event, animations
may become a little bit choppy. However, increasing the latency reduces
the choppiness.
Given that, there is no any "silver bullet" solution for the choppiness
issue, a new option has been added in the Compositing KCM to specify the
amount of latency. By default, it's "Medium," but if a user is not
satisfied with the upstream default, they can tweak it.
2020-11-19 08:52:29 +00:00
|
|
|
void setLatencyPolicy(LatencyPolicy policy);
|
2020-11-28 15:12:38 +00:00
|
|
|
void setRenderTimeEstimator(RenderTimeEstimator estimator);
|
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() {
|
2019-09-14 08:58:12 +00:00
|
|
|
return MouseNothing;
|
2012-04-12 07:24:14 +00:00
|
|
|
}
|
|
|
|
static MouseCommand defaultCommandActiveTitlebar3() {
|
|
|
|
return MouseOperationsMenu;
|
|
|
|
}
|
|
|
|
static MouseCommand defaultCommandInactiveTitlebar1() {
|
|
|
|
return MouseActivateAndRaise;
|
|
|
|
}
|
|
|
|
static MouseCommand defaultCommandInactiveTitlebar2() {
|
2019-09-14 08:58:12 +00:00
|
|
|
return MouseNothing;
|
2012-04-12 07:24:14 +00:00
|
|
|
}
|
|
|
|
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() {
|
2019-09-14 08:58:12 +00:00
|
|
|
return MouseWheelNothing;
|
2012-04-12 07:24:14 +00:00
|
|
|
}
|
|
|
|
static MouseWheelCommand defaultCommandAllWheel() {
|
|
|
|
return MouseWheelNothing;
|
|
|
|
}
|
|
|
|
static uint defaultKeyCmdAllModKey() {
|
|
|
|
return Qt::Key_Alt;
|
|
|
|
}
|
|
|
|
static CompositingType defaultCompositingMode() {
|
|
|
|
return OpenGLCompositing;
|
|
|
|
}
|
|
|
|
static bool defaultUseCompositing() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
static HiddenPreviews defaultHiddenPreviews() {
|
|
|
|
return HiddenPreviewsShown;
|
|
|
|
}
|
|
|
|
static int defaultGlSmoothScale() {
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
static bool defaultXrenderSmoothScale() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
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;
|
2019-09-14 07:54:54 +00:00
|
|
|
}
|
2020-08-27 09:05:28 +00:00
|
|
|
static XwaylandCrashPolicy defaultXwaylandCrashPolicy() {
|
|
|
|
return XwaylandCrashPolicy::Restart;
|
|
|
|
}
|
|
|
|
static int defaultXwaylandMaxCrashCount() {
|
|
|
|
return 3;
|
|
|
|
}
|
Introduce RenderLoop
At the moment, our frame scheduling infrastructure is still heavily
based on Xinerama-style rendering. Specifically, we assume that painting
is driven by a single timer, etc.
This change introduces a new type - RenderLoop. Its main purpose is to
drive compositing on a specific output, or in case of X11, on the
overlay window.
With RenderLoop, compositing is synchronized to vblank events. It
exposes the last and the next estimated presentation timestamp. The
expected presentation timestamp can be used by effects to ensure that
animations are synchronized with the upcoming vblank event.
On Wayland, every outputs has its own render loop. On X11, per screen
rendering is not possible, therefore the platform exposes the render
loop for the overlay window. Ideally, the Scene has to expose the
RenderLoop, but as the first step towards better compositing scheduling
it's good as is for the time being.
The RenderLoop tries to minimize the latency by delaying compositing as
close as possible to the next vblank event. One tricky thing about it is
that if compositing is too close to the next vblank event, animations
may become a little bit choppy. However, increasing the latency reduces
the choppiness.
Given that, there is no any "silver bullet" solution for the choppiness
issue, a new option has been added in the Compositing KCM to specify the
amount of latency. By default, it's "Medium," but if a user is not
satisfied with the upstream default, they can tweak it.
2020-11-19 08:52:29 +00:00
|
|
|
static LatencyPolicy defaultLatencyPolicy() {
|
|
|
|
return LatencyMedium;
|
|
|
|
}
|
2020-11-28 15:12:38 +00:00
|
|
|
static RenderTimeEstimator defaultRenderTimeEstimator() {
|
|
|
|
return RenderTimeEstimatorMaximum;
|
|
|
|
}
|
2012-04-12 17:42:49 +00:00
|
|
|
/**
|
|
|
|
* Performs loading all settings except compositing related.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
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.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-04-12 17:42:49 +00:00
|
|
|
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();
|
2020-08-27 09:05:28 +00:00
|
|
|
void xwaylandCrashPolicyChanged();
|
|
|
|
void xwaylandMaxCrashCountChanged();
|
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 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 compositingModeChanged();
|
|
|
|
void useCompositingChanged();
|
|
|
|
void hiddenPreviewsChanged();
|
|
|
|
void glSmoothScaleChanged();
|
|
|
|
void xrenderSmoothScaleChanged();
|
|
|
|
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();
|
2016-08-26 06:56:42 +00:00
|
|
|
void windowsBlockCompositingChanged();
|
2019-09-25 13:31:48 +00:00
|
|
|
void animationSpeedChanged();
|
Introduce RenderLoop
At the moment, our frame scheduling infrastructure is still heavily
based on Xinerama-style rendering. Specifically, we assume that painting
is driven by a single timer, etc.
This change introduces a new type - RenderLoop. Its main purpose is to
drive compositing on a specific output, or in case of X11, on the
overlay window.
With RenderLoop, compositing is synchronized to vblank events. It
exposes the last and the next estimated presentation timestamp. The
expected presentation timestamp can be used by effects to ensure that
animations are synchronized with the upcoming vblank event.
On Wayland, every outputs has its own render loop. On X11, per screen
rendering is not possible, therefore the platform exposes the render
loop for the overlay window. Ideally, the Scene has to expose the
RenderLoop, but as the first step towards better compositing scheduling
it's good as is for the time being.
The RenderLoop tries to minimize the latency by delaying compositing as
close as possible to the next vblank event. One tricky thing about it is
that if compositing is too close to the next vblank event, animations
may become a little bit choppy. However, increasing the latency reduces
the choppiness.
Given that, there is no any "silver bullet" solution for the choppiness
issue, a new option has been added in the Compositing KCM to specify the
amount of latency. By default, it's "Medium," but if a user is not
satisfied with the upstream default, they can tweak it.
2020-11-19 08:52:29 +00:00
|
|
|
void latencyPolicyChanged();
|
2014-12-02 08:51:52 +00:00
|
|
|
void configChanged();
|
2020-11-28 15:12:38 +00:00
|
|
|
void renderTimeEstimatorChanged();
|
2014-12-02 08:51:52 +00:00
|
|
|
|
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;
|
2019-09-25 13:31:48 +00:00
|
|
|
KConfigWatcher::Ptr m_configWatcher;
|
|
|
|
|
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;
|
|
|
|
int m_killPingTimeout;
|
|
|
|
bool m_hideUtilityWindowsForInactive;
|
2020-08-27 09:05:28 +00:00
|
|
|
XwaylandCrashPolicy m_xwaylandCrashPolicy;
|
|
|
|
int m_xwaylandMaxCrashCount;
|
Introduce RenderLoop
At the moment, our frame scheduling infrastructure is still heavily
based on Xinerama-style rendering. Specifically, we assume that painting
is driven by a single timer, etc.
This change introduces a new type - RenderLoop. Its main purpose is to
drive compositing on a specific output, or in case of X11, on the
overlay window.
With RenderLoop, compositing is synchronized to vblank events. It
exposes the last and the next estimated presentation timestamp. The
expected presentation timestamp can be used by effects to ensure that
animations are synchronized with the upcoming vblank event.
On Wayland, every outputs has its own render loop. On X11, per screen
rendering is not possible, therefore the platform exposes the render
loop for the overlay window. Ideally, the Scene has to expose the
RenderLoop, but as the first step towards better compositing scheduling
it's good as is for the time being.
The RenderLoop tries to minimize the latency by delaying compositing as
close as possible to the next vblank event. One tricky thing about it is
that if compositing is too close to the next vblank event, animations
may become a little bit choppy. However, increasing the latency reduces
the choppiness.
Given that, there is no any "silver bullet" solution for the choppiness
issue, a new option has been added in the Compositing KCM to specify the
amount of latency. By default, it's "Medium," but if a user is not
satisfied with the upstream default, they can tweak it.
2020-11-19 08:52:29 +00:00
|
|
|
LatencyPolicy m_latencyPolicy;
|
2020-11-28 15:12:38 +00:00
|
|
|
RenderTimeEstimator m_renderTimeEstimator;
|
2012-02-20 09:25:13 +00:00
|
|
|
|
|
|
|
CompositingType m_compositingMode;
|
|
|
|
bool m_useCompositing;
|
|
|
|
HiddenPreviews m_hiddenPreviews;
|
|
|
|
int m_glSmoothScale;
|
|
|
|
bool m_xrenderSmoothScale;
|
|
|
|
// Settings that should be auto-detected
|
|
|
|
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;
|
2016-08-26 06:56:42 +00:00
|
|
|
bool m_windowsBlockCompositing;
|
2020-10-20 20:15:46 +00:00
|
|
|
bool m_MoveMinimizedWindowsToEndOfTabBoxFocusChain;
|
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
|
|
|
|
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
|