Summary:
It can happen that startAnimation is invoked multiple times for a
window. In case it was invoked a second time the previous animation was
not cancelled. This resulted in the set-animation to never end. When
closing a window, it would stay around as a translucent, non-interactive
window zombie.
This change ensures that existing animations get cancelled.
BUG: 342716
FIXED-IN: 5.8.3
Test Plan: Tested through autotest and manually.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3190
Summary:
When the decoration size changes the textures get recreated and need to
be properly filled. So far KWin used the scheduled repaint geometry in
this situation. If the decoration didn't schedule the complete geometry
for repain there will be an empty area in the decoration texture.
This change ensures that the complete texture gets repainted when they
are recreated. Thus the decoration rendering is more fault tolerant
towards potential bugs in the decoration. With no-compositing and XRender
compositing this problem was not reproducable and already fault tolerant,
so OpenGL just catches up with the other modes.
BUG: 371735
FIXED-IN: 5.8.3
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3186
Summary:
Client::updateInputWindow operates with the decoration size. The method
gets called from various points when changing the window geometry. If at
that moment the decoration has not updated yet, the borders might be at
a wrong position.
This behavior could be triggered when a window requested to change the
state to maximized. During maximization the decoration still had the
wrong size when updateInputWindow was called, thus an interactive area
inside the window was created.
To circumvent this problem updateInputWindow is now also called whenever
the window decoration changes.
As a note: that a maximized window has resize only borders is wrong. Kwin
should be protected against that.
BUG: 371284
FIXED-IN: 5.8.3
Test Plan: Checked xwininfo for the deco extends window
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3151
This test case simulates a condition of the translucency effect
modifying windows of certain types (e.g. dialogs).
In case the effect got activated for a window it does not end after the
window gets closed and creates a non-interactive zombie window.
CCBUG: 342716
On build.kde.org the autotests started to crash on tear down due to a
newer Wayland library. The reason is that the KWayland::Client::Outputs
are destroyed after the internal Wayland connection is destroyed.
This change parents the created Outputs to the Registry like the other
objects. To ensure that the KWin::QPA::Screen doesn't have a problem
with that, it is changed to a QPointer - nullptr checks are already in
place.
Hopefully that will fix the crashes on build.kde.org, but there is a
chance that more errors are hidden.
Summary:
In order to have a proper window icon for kcmshell5 on Wayland KWin
needs to pass a desktop file name as command line argument.
The desktop file of kwinfocus is used as it uses the
preferences-system-windows icon which is also the icon on X11.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3162
Summary:
The shader self test uses GLRenderTarget and restores the viewport. Due
to the setVirtualScreenGeometry not being set the calculated viewport is
incorrect and any rendering breaks. This is a regression introduced with
1708278a45 which only affects Wayland
backends which do not perform per screen rendering.
The glxbackend was not affected as it sets the viewport on screen
geometry change.
Reviewers: bshah, #plasma_on_wayland, #kwin
Reviewed By: bshah, #plasma_on_wayland, #kwin
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3155
Summary:
With nouveau driver it can happen that KWin gets frozen when first trying
to render with OpenGL. This results in a freeze of the complete desktop
as the compositor is non functional.
Our OpenGL breakage detection is only able to detect crashes, but not
freezes. This change improves it by also added a freeze protection.
In the PreInit stage a thread is started with a QTimer of 15 sec. If the
timer fires, qFatal is triggered to terminate KWin. This can only happen
if the creation of the OpenGL compositor takes longer than said 15 sec.
In the PostInit stage the timer gets deleted and the thread stopeed
again.
Thus if a freeze is detected the OpenGL unsafe protection is written into
the config. KWin aborts and gets restarted by DrKonqui. The new KWin
instance will no longer try to activate the freezing OpenGL as the
protection is set.
If KWin doesn't freeze the protection is removed from the config as
we are used to.
Check for freezes for the first n frames, not just the first
This patch changes the freeze detection code to detect freezes in the
first 30 frames (by default, users can change that with the
KWIN_MAX_FRAMES_TESTED environment variable). This detects
successfully the freezes associated to nouveau drivers
in https://bugzilla.suse.com/show_bug.cgi?id=1005323
Reviewers: davidedmundson, #plasma, #kwin, graesslin
Reviewed By: #plasma, #kwin, graesslin
Subscribers: luebking, graesslin, kwin, plasma-devel, davidedmundson
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3132
Summary:
So far the tracking for cursor shape was done incorrectly on Wayland by
only listening to X11 cursor changes. That's from a time when
KWin/Wayland was still run on top of an X server.
Nowadays the Platform tracks cursor shape changes and emits changes to
it. Xwayland cursor changes go through the normal Wayland way so it's
just one way to get it on Wayland.
This change adds the required connect and changes the signal signature
in Cursor by dropping the serial argument. No user of the signal uses
the argument and on Wayland we don't have a serial for the cursor. So it
can be dropped.
Test Plan: Zoom effect updates cursor shape correctly on Wayland
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3095
Summary:
There are several effects (screenshot, zoom) which need access to the
cursor image and cursor hotspot. So far these effects used X11
unconditionally to get the cursor which obviously does not work on
Wayland.
This change adds a new class PlatformCursorImage to kwinglobals which
wraps what a cursor is (image and hotspot) and adds a new virtual method
to Platform to provide such a PlatformCursorImage. By default it's the
cursor image the Platform tracks. On X11/standalone platform this new
virtual method is overriden and provides a PlatformCursorImage from X11
using the code previously used in screenshot effect.
Screenshot effect and zoom are adjusted to use the new API instead of
X11.
Test Plan:
Zoom effect tested on Wayland, now gets the proper cursor icon.
X11 functionality not yet tested.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3093
Summary:
The glCopyTex(Sub)Image calls are adjusted to take the per output
rendering into account. In addition contrast effect sets the model view
projection matrix in each call to ensure it's on the correct screen.
Blur probably needs more changes for the cached texture to work, but
it's a start.
Test Plan: Blur and Background contrast work on multi-screen wayland
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3101
Summary:
A simple way to get the current per-output geometry. It's also needed by
effects using render targets.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3100
Summary:
The viewport needs adjustment in the per-output rendering case. This
change ensures the viewport is setup like in the platforms which do per
output rendering. For the X11 case (multiple outputs in one render pass)
the values are the same as previously.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3099
Summary:
On X11 one needs to force activate a panel to pass it focus. This change
implements something similar for Wayland but a little bit more stateful
by using a request on the PlasmaShellSurface. If set KWin will activate
the panel.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3037
Summary:
This change implements auto-hide support for Wayland panels. To properly
test the screenedgeshowtest is reworked to support both X11 and Wayland
windows.
Reviewers: #kwin, #plasma_on_wayland, bshah
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3080
Summary:
Adjusts the screenshot effect to mutliple output rendering. In that case
the blit from framebuffer can only get one output. Thus the effect needs
to blit every output and combine the rendering result.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3059
Summary:
On Wayland per output rendering is performed and paintScreen is invoked
for every output. Some effects need the information which output is
currently being rendered as otherwise e.g. FBO access could fail.
This change adds the current output geometry to ScreenPaintData. On X11
(all outputs one geometry) this information is not set and a null rect
is returned. That way the effects can also easily check which rendering
mode is used.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3058
Summary:
This is similar to ff6e042c7f just for
GLRenderTarget instead of GLVertexBuffer. The reasoning is the same: on
Wayland KWin has one native window per screen and needs to adjust the
blit target depending on the area.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3056
Summary: This allows to pass also Xwayland icons to the task manager.
Reviewers: #kwin, #plasma_on_wayland, hein
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3050
Summary:
On Wayland the QtExtendedSurface is used to pass the path to the color
scheme using the generic window property. To support this ShellClient
installs an event filter on the extended surface and listens for dynamic
property change events.
As the color scheme is KDE specific anyway it is not a problem that a Qt
specific interface is being used. For other toolkits just passing the
name to KDE's color scheme isn't sufficient anyway. If at some point we
find a way to support this for e.g. GTK+ we would need to come up with a
dedicated interface.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3047
Summary:
For X windows KWin uses the generic X icon if no icon is found. Thus
KWin should use the generic Wayland icon if no icon is found for a
Wayland client.
With this change applications with incorrect desktop file name at least
get a generic icon instead of no icon.
Test Plan: Started Qt assistant on Wayland and it had icon.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3023
Summary:
The TabBox performs the scrolling of the items by itself in order to
support wheel events even if the mouse is not on the TabBox. For that
KWin grabs pointer events on X11 (on Wayland an input filter is used)
and forwards them to the TabBox.
Qt uses Xinput2 for scrolling on the QQuickWindow. Due to that KWin
does not get any xcb core button press/release events when scrolling
inside the QQuickWindow and thus scrolling doesn't work.
There are three possible approaches to fix this:
1. Implement scrolling support in each of the QML switchers
2. Add an xinput2 filter to TabBox
3. Intercept the QWheelEvents on the QQuickWindow
The first approach has the disadvantage that all themes need
adjustment and that there might be behaviorial difference whether one
scrolls on the TabBox window or outside the window.
The second approach would be most in line with the other filters, but
is difficult due to the nature of xinput2 (no xcb bindings, etc).
Thus the third approach might be the best solution. Wheel events are
only delivered to the QQuickWindow if the native events were not already
intercepted, thus we know it won't have side effects for the case that
Wayland is used or xinput2 is not supported.
The implementation installs an event filter on the QQuickWindow which
gets created when showing the TabBox and inside the filter waits till
there is an angleDelta of +/-120 and scrolls by one per every 120 angle
delta as described in the QWheelEvent documentation.
BUG: 369661
FIXED-IN: 5.8.2
Test Plan: Scrolled with touchpad and mouse wheel.
Reviewers: #kwin, #plasma, broulik
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D2953
Summary:
A shortcut with e.g. shift+w could not be triggered as shift is
considered as consumed. It transforms the keysym to an uppercase variant
thus it is consumed.
This change checks for the condition that shift is pressed and is the
only consumed modifier. If the current keysym is a letter the shift is
removed from the consumed modifier again to still support the shortcut.
BUG: 370341
FIXED-IN: 5.8.2
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3015
Summary:
Window tabs which are required for autogroup are currently not supported
in KWin. Thus exposing autogroup related window rules does not make any
sense.
This change hides the options again in the hope that we can bring the
feature back in future.
BUG: 370301
FIXED-IN: 5.8.2
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D2996
Summary:
The Xkb implementation starts to track the state of the LEDs in the
keymap and emits a signal whenever the LEDs change. This signal is
connected to a method in LibInput::Connection which updates the led
state on all devices and uses it to init the state of the led when a new
device gets connected.
BUG: 369214
FIXED-IN: 5.8.2
Test Plan: Connected a keyboard with LEDs and enabled NumLock and ScrollLock.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2943
Summary:
For windows the screenshot effect already delayed the rendering into the
next cycle. But for the fullscreen variants which save to a file the
Screenshot effect did try to take the shot directly.
This can be problematic as e.g. the OpenGL context might not be bound at
all. Also this makes it impossible to screenshot multiple screens
together in the Wayland case.
This change delays the DBus replies, schedules the geometry and takes
the screenshot in the next rendering pass. It does not fix the
multiscreen wayland problem yet.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3052
Summary:
If KWin interacts with Libinput the RelativePointerManager interface
gets created on the Wayland server. The ForwardInputEventFilter does
forward the relative motion events in addition to the normal motion
events.
In order to properly support the relative motion events as they are
expected by the Wayland protocol the handling of pointer motion events
got slightly adjusted:
* Libinput Pointer event extended by the additional data points
* Libinput Pointer event carries the delta as a QSizeF instead of
QPointF
* PointerInputRedirection adjusted to take a pointer motion event with
more arguments
* Custom QMouseEvent subclass adjusted to carry the additional members
The DebugConsole is adjusted to show the relative motion events in
addition to the global position.
Test Plan:
Verified the manager object is created and verified the
events in DebugConsole. Unfortunately not aware of any test application.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2979
Summary:
This implements the hideClient for ShellClient which was previously
not implmented. Also autotest for same is added.
Test Plan: ran autotest
Reviewers: graesslin, #plasma
Reviewed By: graesslin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3022
Summary:
The modifier-only-shortcuts break as soon as KWin grabs the keyboard
(e.g. alt+tab, present windows, etc.). The investigation shows that in
that case KWin does not get any raw key events any more and thus gets
confused about the state of the hold modifiers. E.g. alt+tab has the
alt key pressed, but we miss the release as the keyboard is grabbed.
This change addresses the problem by installing an additional event
filter for key press and release event which only filters for key events
on the root window. That way we can be sure that it only operates when
KWin grabbed the keyboard on the root window.
Note: the problem only exists when grabbing on the root window. If the
grab is on another window (e.g. moving a window) we still do get all
events.
The problem also seems to not happen if another application grabbed
keys on the root window. E.g. for key combinations grabbed by
kglobalaccel the correct sequence of key press/release as raw events
are reported. Also while the screen is locked the evemts are reported
and kscreenlocker grabs the keyboard on the root window.
Test Plan:
Used Alt+Tab and Present Windows and tried to activate launcher
afterwards.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D2980
Summary: Adds screen edge handling in minimize all script.
Test Plan:
With a hacked KCM, setting the option works perfectly and updates correctly
adding/removing the edge bindings as appropriate.
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D2263
Summary:
Modify the kwinscreenedges KCM to also list scripts which support screen
edge activation and read/write the appropriate value in the script's
config.
In order to only show relevant scripts an additional .desktop metadata
field is added.
Test Plan:
Opened KCM set a hot corner for minimize all.
Tested it
unset it, and set on another corner
Tested again
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: graesslin, plasma-devel, kwin
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2972