Summary:
Maximize code was not yet adjusted to support decorations. Code is as
much as possible similar to the X11 Client implementation.
BUG: 370982
Test Plan: Added auto test and run a nested KWin/Wayland with the setting enabled
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3508
Summary:
This brings some more checks from Client to ShellClient. Thus the
states are better adjusted.
Unfortunately the X11 implementation is also slightly adjusted, so could
create regressions in worst case.
BUG: 368393
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3507
Summary:
Currently the configure button is aligned to the win decoration in the
background. This is bound to 40 - the inactive decorations shadow.
This means the configure button ends up in different places across each
item,
looking a bit weird and potentially not even on top of the right
delegate.
This patch aligns the configure button relative to the overall delegate
so that it's in the same place on every item
Test Plan: Looked at KCM
Reviewers: #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3526
BUG: 372685
Summary:
If you're going to have kwin in the service name anyway there's
absolutely no benefit to having clients not use the existing
org.kde.KWin.
Test Plan: Object is still registered.
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: graesslin, plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3357
Summary:
The default constructor shouldn't have been used anyway, but better safe
than sorry.
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3453
Summary:
The effect exports itself to DBus as object "/ColorPicker" and provides
an own interface "org.kde.kwin.ColorPicker".
It has one exported method to DBus "pick" which returns a QColor. When
invoked an interactive position picking selection is started. If it ends
the effect reads the color value at the picked position from the OpenGL
color buffer.
This implements T4568.
Reviewers: #kwin, #plasma_on_wayland, broulik
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3480
Summary:
This change cleans up the screenshot effect a little bit.
* better check whether a screenshot is already being taken
* proper DBus error messages
* less duplication of error message strings
* don't keep the QDBusConnection around
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3493
Summary:
A second interactive selection mode gets added to select a position on
the screen. This is handled by the same input event filter as for the
window selection. Just that instead of returning a window, it returns a
QPoint.
This allows to pick a point on the screen which we need to screenshot
the screen under the mouse cursor and in future for color picking.
The screenshot effect provides two new dbus methods to (interactively)
select a screen or fullscreen. This allows spectacle to screenshot the
(full) screen with still having the user in control.
Reviewers: #kwin, #plasma_on_wayland, bgupta
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3475
Summary:
While investigating a repaint issue I had a hard time to work with the
code and decided to change it to a more modern variant.
Instead of duplicating the same logic for each of the lists it's now
moved into a dedicated templated method which used std::any_of. Which is
exactly the algorithm we need: if there is any window with a non empty
repaints region it should return true.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3397
This is a larger patch rewriting some parts of the config saving functionality
in device.cpp in order to:
1. Make it possible to save ScrollMode as integer instead of using three booleans
2. Simplify the addition of new keys or types in the future
Changes in detail:
a) Adds new ConfigKey ScrollMethod and removed now unnecessary keys per method
b) Adds constructors to the ConfigData struct. This allows to create ConfigData
entries for s_configData without the need of stating empty brackets and the
useage of default values.
c) Use plain member function pointers instead of std::function, in order to
compactify code and have better compile output in case something goes wrong.
c) Cleans up ScrollMethod functions and adds interface methods for transforming
the saved integer into type enum libinput_config_scroll_method.
d) Adjusts auto test for loading the ScrollMethod value from the config file.
Reviewers: #kwin, graesslin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3460
Some small improvements / fixes to the libinput backend:
- Query libinput_device_config_left_handed_get_default
- Write leftHanded property to config file
- When saving the touchpad scroll mode, write false to all other ones.
Otherwise it will always enable the last read entry after reboot.
- Use macro for setLeftHanded(bool) and setNaturalScroll(bool)
Reviewers: #kwin, graesslin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3430
Summary:
It's only needed by the GLX backend, so only find if we have GLX at all
and only link where needed. As it was handled incorrectly before, it's
now using proper ifdef.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3448
Summary:
It's not needed inside libkwinglutils. The only required usage is from
abstract_egl_backend.h where the include is moved to.
This removes an fixx11h.h from a kwin lib.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3447
Summary:
The code for EGL and GLX platform did the same checks, just with the
difference that the EGL check has another check for isGLES.
So let's just do the branching on whether isGLES or GL.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3446
Summary:
For Wayland windows we can have a sequence of window unmapped
(windowHidden signal) followed by a windowClosed way later when the
application quits. This is for example the case with menus.
The result of this was that the fade out animation triggered when the
application quit showing all the already closed menus again.
This change implements a windowShown and windowHidden handler and
triggers the fadeIn/Out animation on it. If the window gets shown
again the existing fadeOut animation gets cancelled, so that it can run
again.
If a window gets closed for which a fade out animation has been run
already, it's not triggered again, thus ensuring that we don't see
zombie windows.
CCBUG: 372622
Reviewers: #kwin, #plasma_on_wayland, hein
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3419
Summary:
The idea behind this mode is to support applications like spectacle
(see T4458). The calling application passes a file descriptor (created
through e.g. a pipe) and the screenshot effect writes the captured image
into that fd.
The advantage over the existing variant which writes to a file in the
/tmp directory is that this is peer-to-peer between the requesting
application and KWin. No other application can get to that image.
The change also includes setting SIGPIPE to ignore. It showed that when
the reading side already cancelled the read prior to KWin writing out
the image we get a SIGPIPE which results in application termination,
which is not what we want in case of a Wayland compositor. The sigpipe
can be ignored as Qt (and libpng) handles that error just fine at
runtime.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3412
Summary:
While taking an interactive screenshot we should inform the user about
what's going on, how to take the screenshot and how to cancel it.
For this the effect creates an EffectFrame with the required
information.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3403
Summary:
The feature has always been considered experimental. Unfortunately it is
completely unmaintained and hasn't seen any commits in years. It
requires kolor-manager to function, but that has not seen a release
based on frameworks yet. This makes it difficult to maintain. In fact I
have never been able from the introduction till now to setup a color
corrected system. One needs kolor-manager and oyranos and especially the
latter is hardly available on any linux distribution (e.g. not on the
Debian/Ubuntu systems).
Due to being unmaintained color correction in KWin did not keep up with
recent changes. Neither did it see any updates during the xlib->xcb
port, nor during the Wayland port. Especially the Wayland port with the
rendering changes make it unlikely to function correctly. E.g. Wayland
introduced a proper per-screen rendering, while color correction did a
"fake" per screen rendering. How that is going to work in combination is
something nobody ever tried. Now after the introduction of proper
per-screen rendering the solution would be to port color correction to
the new api, but that never happened.
Color correction also modified the shaders, but a newer shader API got
introduced some time ago. Whether the color correction shader support
that or not, is unknown to me. Also which shader language versions are
supported. I know it was based on 3d texture support, which back on
introduction was partially lacking in OpenGL ES. Nowadays that changed,
but color correction didn't update.
Last but not least it is completely X11 based and there is no work on
how to make it work with Wayland.
Given all the problems, especially the fact that it is unmaintained and
cannot be setup on my system, means to me that the only solution is to
remove it.
I'm open to having it reintroduced in future, but only if the
availability on Linux distributions gets addressed before. As long as
major linux distributions do not ship this feature, it should not be in
KWin. Given that I must say that it was a mistake to add it in the first
place and I need to point out that I was against the merge back then.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3402
Summary:
The method is supposed to return the AbstractClient's size for a given
client size. That is the size including the window decoration.
The default implementation returned the passed in client size without
adjusting for the decoration. This resulted in ShellClient getting a
wrong size especially when AbstractClient::adjustedClientSize (which
calls sizeForClientSize) was called.
The result of the incorrect size was for example a shrinking of the
window when starting to resize a window.
BUG: 370345
FIXED-IN: 5.8.4
Reviewers: #kwin, #plasma_on_wayland, broulik, subdiff
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3414
Summary:
AbstractClient gains a new pure virtual killWindow method and this gets
implemented in ShellClient.
ShellClient performs the killing by sending a term signal to the
process. This can only work if the client connected through the socket
and didn't get a socketpair fd passed. In that case the pid is KWin's
and KWin doesn't want to terminate. Thus this is special handled to
destroy the connection instead.
In case terminating the process has no effect, the connection gets
destroyed after five seconds.
The KillWindow is adjusted to operate on AbstractClient instead of
Client.
This implements T4463.
Test Plan: Killed windows and auto test
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3370
Summary:
The interactive window selection is implemented in InputRedirection
through a dedicated InputEventFilter. The InputEventFilter so far takes
care of pointer input and keyboard input. In addition it ensures that
keyboard and pointer focus is reset on start and on end.
With this change KillWindow now also works on Wayland, but only for X11
windows, as the Wayland variant is not yet implemented.
Test Plan: Tested in nested setup, auto-tests still needed
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3365
Summary:
EffectsHandler gains a new method to startInteractiveWindowSelection
which just delegates to the one in Platform. That way a window can be
selected and returned to an Effect.
The screenshot effect makes use of this new functionality and provides
an interactive window screenshot mode which saves to a temporary file.
Note that this is not yet the variant intended for use in spectacle.
Test Plan: Took a screenshot on Wayland
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3367
Summary:
Not used anywhere in KWin and annotated that they should be removed. As
we have an ABI break in 5.9 we can remove them now.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3398
Summary:
As there is no difference between egl and glx extensions anymore inside
KWin (both are provided through the OpenGLBackend) there is no need to
have to group boxes and do a manual hide/show based on which platform is
used.
Instead there is now just one group box and it's called "Platform
Extensions".
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3400
Summary:
Instead of having the egl extensions in the global kwinglutils lib it
becomes private to the AbstractEglBackend. Just like on glx the
glxextensions are moved into the platform.
The extensions are queried from initEglAPI, that is as early as possible
after initializing the EGLDisplay. This ensures that any implementing
subclass can access the extensions early enough.
As a note: the EglOnXBackend had a potentially wrong sequence for
initializing the buffer age extension. It is now moved to the correct
place where the result is needed for the first time.
From the global API eglExtensions are removed from hasGLExtension and
the eglExtensions function is dropped. As by that initEGL did not do
anything it is also dropped.
Test Plan:
Tested nested kwin on Wayland, still works, extensions shown
in debug console
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3396
Summary:
Method doesn't do anything. If at some point we want to resolve egl
functions again, it should be done in the Platform, just like
glxResolveFunctions is nowadays done in the platform.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3391
Summary:
It's unused in KWin and absolutely not needed as the call to
eglInitialize, which every platform does, also gives the version for
free. So no need to do any caching in a global method.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3390
Summary:
The interactive window selection is implemented in InputRedirection
through a dedicated InputEventFilter. The InputEventFilter so far takes
care of pointer input and keyboard input. In addition it ensures that
keyboard and pointer focus is reset on start and on end.
With this change KillWindow now also works on Wayland, but only for X11
windows, as the Wayland variant is not yet implemented.
Test Plan: Tested in nested setup, auto-tests still needed
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3365
Summary:
A new virtual method is added to Platform:
startInteractiveWindowSelection
The interactive window selection enters a mode where the user can select
a window through the pointer or keyboard device. The cursor is turned
into a crosshair cursor, unless another cursor name is provided (e.g.
pirate for kill window).
Once a window is selected the provided callback method is invoked with
the selected Toplevel as argument. In case the user cancelled the
selection a nullptr argument is passed in.
Currently it's only implemented by the X11 standalone platform using the
logic from KillWindow. Just instead of killing the window the callback
is invoked.
KillWindow loses the X11 implementation and interacts with the new
functionality in Platform by providing a lambda function for the
killing.
Test Plan: Killing of X11 windows is still possible
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3363
Summary:
A little bit debug information about the current keyboard state is
useful. Thus a new tab is added to show information about xkbcommon.
It shows:
* layouts in the keymap
* currently active layout
* supported modifiers in key map
* currently active modifiers in state
* supported leds in key map
* currently active leds in state
Whenever a key is pressed/released the complete ui is updated to reflect
the latest state. That is pressing/releasing a modifier is directly
reflected in the ui.
This UI can extended as needed for further debug information about the
keymap state.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3379
Summary:
And finally nothing inside libkwineffects, libkwinglutils,
libkwinxrenderutils and kwineffect and kwin core uses KWin::display.
We are finally XLib free!
This change drops KWin::display and removes the include to QX11Info from
kwinglobals.h. And the libraries no longer need to link X11Extras. Due
to that removal a few seeming unrelated changes are required to add the
include where needed and linkage to X11Extras.
The biggest change is to x11 platform plugin which still needs the
display and caches it in the Platform and passes it to various places in
a way that the code doesn't need to be adjusted.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3337
Summary:
KWin still resolves some OpenGL function pointers. For that it needs to
use either eglGetProcAddress or glxGetProcAddress. With other words the
method to resolve needs to know whether it is egl or glx and needs both
a dependency to egl and glx. Especially the dependency to glx is ugly as
that pulls in XLib into our library.
The way so far was to pass an enum value to the initGL method to know
whether it's EGL or GLX. With this change the enum value is removed and
replaced by a function pointer to resolve the methods.
This simplifies the resolve code and allows to completely remove the glx
variant we still had in the library. Thus kwinglutils library is now glx
and XLib free.
Test Plan: nested KWin with OpenGL/EGL still works
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3336
By changing the loading of scripted effect config to interact with
kwinApp we broke the tests which do not use a kwinApp.
This change turns the access to the KSharedConfigPtr go through the
property system, so that the tests can also install a dummy
KSharedConfigPtr. With that scripted effects loader test passes and no
longer crashes and the integration/effects tests also still pass.
Summary:
The effectsConfig is no longer used by any Effect. ScriptedEffects use
KWin's KSharedConfigPtr and the builtin effects all have a kcfg with
kwinrc being hard coded.
The effectsConfig had the big disadvantage that it hardcoded kwinrc
while the rest of kwin uses a KSharedConfigPtr which might not point to
kwinrc.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3384