Summary:
From feedback we got it seems that not all users agree to games and
other applications blocking compositing. Some users prefer to have
compositing always on even if this gives a small performance penelity.
This change introduces a dedicated config option to specify whether games
are allowed to block compositing. By default this option is enabled.
The setting can be overwritten with a window specific rule. So usecases
like all windows except this very specific one are supported.
In the user interface the config option is shown where previously the
unredirect fullscreen option was shown.
Test Plan:
Run a game which should block compositing, verified it blocks.
Changed the setting, run the game again, verified it doesn't block. And
once more for with allowing to block.
Reviewers: #kwin, #plasma_on_wayland, #vdg
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2584
Summary:
Rational: unredirect fullscreen windows is a weird beast. It's intended
to make fullscreen windows "faster" by not compositing that screen. But
that doesn't really work as KWin jumps out of that condition pretty
quickly. E.g. whenever a tooltip window is shown. KWin itself has a
better functionality by supporting to block compositing completely.
The complete code was full of hacks around it to try to ensure that
things don't break.
Overall unredirect fullscreen has always been the odd one. We had it
because a compositor needs to have it, but it never got truly integrated.
E.g. effects don't interact with it properly so that some things randomly
work, others don't. Will it trigger the screenedge, probably yes, but
will it show the highlight: properly no.
By removing the functionality we finally acknowledge that this mode is
not maintained and has not been maintained for years and that we do not
intend to support it better in future. Over the years we tried to make
it more and more hidden: it's disabled for Intel GPUs, because it used
to crash KWin. It's marked as an "expert" option, etc.
It's clearly something we tried to hide from the user that it exists.
For Wayland the whole unredirect infrastructure doesn't make sense
either. There is no such thing as "unredirecting". We might make use
of passing buffers directly to the underlying stack, but that will be
done automatically when we know it can be done, not by some magic is
this a window of specific size.
Test Plan:
Compiles, cannot really test as I am an Intel user who never
had that working.
Reviewers: #kwin, #plasma, #vdg
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D2180
Summary:
CompositingPrefs is only relevant for X11 standalone. It had some
"hacks" to make it not block Compositing on Wayland. Thus it was in
its current form not really useful.
Now all the functionality is provided through Platform with a default
implementation which is sensible for Wayland platforms.
The X11 standalone platform implements the new methods with the
Wayland checks removed.
In addition all calls to CompositingPrefs now go through the platform
directly and CompositingPrefs is completely dropped.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1576
Summary:
This change reduces the windowing system specific code pathes. Instead
of checking whether we are on X11 or Wayland to decide whether
compositing is required, we just ask the Platform.
The default is true, only x11 standalone allows to not require
compositing.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1575
So far it was bound to whether we build for GLES. But this is
semantically wrong. It might be possible that even on desktop gl
epoxy is built without GLX support, thus we need to reflect this.
This change ensures that epoxy/glx.h is only included if available,
that relevant code is bound to it and that checks are in place to
enforce EGL if not build with glx support.
In addtion the glxbackend.cpp is now only included in the build set
if available.
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
It doesn't make much sense any more as we do no longer link EGL since the
switch to epoxy. And epoxy pulls it in at runtime if needed.
Even more on Wayland it's just plain stupid to have EGL disabled. So
removing the option just simplifies our code base without any
disadvantages.
REVIEW: 124695
ScreenInfo::rate is reporting 50Hz (on at least nvidia)
... AGAIN! * sigh*
In addition we check for __GL_SYNC_DISPLAY_DEVICE to pick
the rate of the screen that the driver will actually sync to
(hopefully...)
The patch is limited to nvidia systems for 5.3, applied everywhere
in master (ie. will be in 5.4 unless there's some problem)
BUG: 347360
REVIEW: 123693
Was only used as fallback for older NVIDIA drivers. At the same time
also drop the call to nvidia-settings which was also only used as
a fallback for refresh rate detection.
REVIEW: 122423
A new config option "GLPlatformInterface" is added to the Compositing
settings group. Valid values are "glx" and "egl". This config option is
honored by the Scene to decide which backend to create.
The setting gets sanitized by the operation mode (egl for Wayland),
the environment variable KWIN_OPENGL_INTERFACE and the compile time
support. These switches are removed from the Scene to not have them
duplicated.
Most is just switched to the ::read(). That should be enough for all the
Effects which have a KSharedConfig::Ptr underneath. If not we just need
to find a good place to put the reload.
KWin already has a de facto OpenGL 2 dependency through QML. Combined
with the fact that the OpenGL 1 backend is basically unmaintained and
also unused, it's better to remove it for the new major release.
This change includes:
* Removal of cmake option KWIN_BUILD_OPENGL_1_COMPOSITING
* Removal of KWIN_HAVE_OPENGL_1 compile option and all code
ifdef'ed with it (partially removal of if-else constructs)
* Removal of CompositingType::OpenGL1Compositing (flags are kept
as a core flag should get introduced)
* Driver recommendation for OpenGL1Compositing changed to XRender
(should be evaluated whether the drivers can provide GL2)
* Removal of configuration option "GLLegacy"
* Removal of fooMatrix function in kwinglutils
* Removal of ARBBlurShader
* Removal of legacy code path in GLVertexBuffer
* Removal of GLShaderManager::disable
* if-blocks with ShaderManager::instance()->isValid() removed
REVIEW: 116042
This compositor uses only the QPainter API to perform rendering. The
window's X Pixmap is mapped to a QImage using XShm. As rendering backend
a QImage is used.
The new compositing type "QPainterCompositing" is introduced. Effects
need to be adjusted to explicitly check the compositing type and no
longer assume the compositing type is XRender if it's not OpenGL.
This compositor can be selected with using "Q" as the value for
KWIN_COMPOSE env variable or setting the config value to "QPainter".
The GUI is not yet adjusted to select this compositor.
The QPainter scene provides currently the following features:
* 2D transformations (translation and scalation)
* opacity modifications
* rendering of decorations (new PaintRedirector sub class)
* rendering of shadows
* rendering of effect frames
* rendering to a Wayland surface
The following features are currently not provided:
* saturation changes
* brightness changes
* 3D transformations
* rendering to X Overlay window
* offscreen rendering (e.g. needed for screen shot effect)
* custom rendering in the effects to the current back buffer
The main purpose of the opengl testapp was to set the environment
variable LIBGL_ALWAYS_INDIRECT if direct rendering is not supported
before glx gets initialized.
With Qt5 we may no longer set this environment variable. QtQuick
requires direct rendering. On IvyBridge QtQuick is crashing if the
variable is set. Thus we are no longer allowed to set it and thus the
complete test becomes pointless.
The test app basically whitelisted most drivers anyway, the only
drivers which were problematic are the proprietary Catalyst drivers.
It that's still a problem we can also disable OpenGL compositing on
those drivers through the recommendation in the GLPlatform.
This also means that the KWIN_DIRECT_GL variable is no longer useful.
The configChanged() signal was declared in both KDecorationOptions and
Options, while Options recently became derived from KDecorationOptions.
This created confusion for QMetaObjectPrivate which was spitting a
couple of error messages.
Remove configChanged() signal declaration from Options, rely on the one
from the base class Options.
Create a special notify signal for focusPolicyIsResonableChanged,
directly connected to the configChanged() signal.
REVIEW: 113336
For this KDecorationOptions becomes a QObject. The changed flags from
updateSettings are removed. Instead the method just emits the proper
changed signals.
This should allow better handling in the Factories.
The changed mask is going to be replaced by more specific signals so
we don't need to calculate the change mask in KWin core anymore.
We still need to call reset in the decoration plugin to check whether
a new decoration library needs to be loaded.
Used to include quite a bit no longer needed. In order to get rid of
the utils.h inclusion one enum is moved to options (where it actually
belongs to).
enforce to "e" (cheap) when driver is still unknown after
detection must be assumed to have run, so a sane value is available
when the context is up
BUG: 322355
FIXED-IN: 4.11
REVIEW: 111548
* "" needs to be wrapped in QStringLiteral
* QString::fromUtf8 needed for const char* and QByteArray
* QByteArray::constData() needed to get to the const char*
the only thing it does on these systems is cause users
trouble because usually when there's a client where
unredirection makes sense, that uses OpenGL - and then
things break in the driver.
CCBUG: 252817
REVIEW: 111476
* don't execute OpenGL test app if user selected XRender
* don't execute OpenGL test app if user forces to EGL
If a user selected XRender because OpenGL is failing badly it might not
be the best idea to call an OpenGL application.
If the user enforces EGL it's kind of pointless to call a testapp which
uses GLX.
REVIEW: 110659
This changes the default refresh rate (which KWin uses if it cannot get the rate from the screen) from 50Hz to 60Hz.
There are two reasons for this:
- When plugging out the last active screen, even without calling xrandr the X server changes the screen geometry to some built-in minimum (320x200), with, of course, no information about the refresh rate. As a result, KWin assumes 50Hz and restarts the compositor to accommodate for this change, only to change it again soon thereafter when there's a screen again.
- I know of nobody using a 50Hz screen. Most people use 60Hz, some use 120Hz, but 50Hz seems pretty rare to me.
REVIEW: 110454
Following the approaches of other split out functionality Screens is a
singleton class created by Workspace.
The class takes over the responsibility for:
* screenChanged signal delayed by timer
* number of screens
* geometry of given screen
* active screen
* config option for active screen follows mouse
The class contains a small abstraction layer and has a concrete subclass
wrapping around QDesktopWidget, but the idea is to go more low level and
interact with XRandR directly to get more detailed information.
All over KWin the usage from QDesktopWidget is ported over to the new
Screens class.
REVIEW: 109839
either by
- forcing fullrepaints unconditionally
- turning a repaint to a full one beyond a threshhold
- completing the the backbuffer from the frontbuffer after the paint
BUG: 307965
FIXED-IN: 4.10
REVIEW: 107198
The new class FocusChain manages two different kind of focus chains.
First of all there is a most recently used focus chain which is primarily
used for TabBox.
Then there is one focus chain per virtual desktop. These chains are used
to determine which Client needs to be activated when e.g. switching to a
virtual desktop.
The individual chains are implemented as a simple QList of Client* with
the most recently used Client as the last element. That way one can see
it as a LIFO like structure.
The desktop focus chains are internally represented as a hash with the id
of the virtual desktop as the key and a list as described as the value.
FocusChain is a singleton which provides some methods to manipulate the
chains and to get a specific Client for a task (e.g. TabBox).
While splitting out the code some unused code inside TabBox got removed
as well as some activities related code (windows cannot be moved while
switching activities).
REVIEW: 107494
For the time being the current design of Options is more or less kept to
not have to adjust KWin code all over the place. Also for some parts the
generated class from KConfigXT cannot be used due to inter-settings
dependencies defined in the setters.
Options now holds a pointer to a Settings object which is generated from
KConfigXT and uses it to read the default values and the individual
settings. This means the static default value methods are dropped and the
variables are initialized with a normal default value (all int 0, all
boolean false and so on) in the initializer list. Afterwards the values
are set to the correct default value through KConfigXT.
So far for the first step only Windows category is using KConfigXT.
REVIEW: 108572
This rewrite is mostly motivated by the need to handle multi screen
setups correctly. That is have edges per screen and not for the combined
geometry. Also porting from XLib to XCB has been a motivation for the
rewrite.
The design of the new ScreenEdge handling is described in the
documentation of ScreenEdges in screenedge.h.
In addition the following changes have been performed:
* move configuration from Options to ScreenEdge
* add screen edge information to Workspace::supportInformation (obviously
replaces what had been read from Options)
* have Workspace hold a pointer to ScreenEdges instead of an object
* forward declaration of ScreenEdges in workspaces.h, this explains the
seemingly unrelated changes of just another include in some files
BUG: 290887
FIXED-IN: 4.11