After lowering the message severity for the KWIN_CORE logging category,
it has been found that the Workspace calls the updateDecoration() method
for every mapped popup surface.
Since the XdgPopupClient doesn't implement that method, a warning message
is printed every time a popup is mapped.
Given that XdgToplevelClient updates the decoration when needed, we can
remove the call to the updateDecoration() method.
Currently, if an X11 or Wayland window is damaged, we will schedule a
repaint. This results in some code duplication that this change intends
to get rid of.
When changing the workspace size, clients will need to reposition
themselves. This leaves a short amount of time where strutted clients
(e.g. panels) will be floating in the wrong place.
This change makes it so when the area could not be properly calculated,
we ignore these clients until they start giving us proper values again.
This is a bit of a workaround though, it would make sense to implement
client placement more synchronously so we didn't have weird moments
where everything is wrong.
It's mostly prominent on the phone but it happens elsewhere when you
rotate.
krunner stuff doesn't really belong in kwin, it has nothing to do with
compositing or any other things that are the domain of compositors.
Given that, being as a plugin suits the krunner integration stuff best.
The scripting api is not suitable for implementing all features that
should not be implemented in libkwin. For example, the krunner
integration or screencasting are the things that don't belong to be
compiled right into kwin and yet we don't have any other choice.
This change introduces a quick and dirty plugin infrastructure that
can be used to implement things such as colord integration, krunner
integration, etc.
If Xwayland has crashed, the Workspace will block stacking order updates
and start destroying all X11 clients.
Once stacking order updates are unblocked, the Workspace will mark the X
stacking order as dirty and create a new Xcb::Tree object.
We don't want to create that Xcb::Tree object because accessing it
after the XCB connection has been shut down will lead to a crash.
BUG: 427688
FIXED-IN: 5.20.1
When we destroy all internal clients and override-redirect windows, we
assume that corresponding lists will be implicitly detached.
However, in some cases, that might be not the case. For example, if the
list is not shared, neither begin() nor end() will detach. Therefore, it
is possible to hit invalidated iterators if the list is modified inside
the loop.
This change prevents hitting invalidated iterators by making explicit
list copies.
CCBUG: 427373
If an X11 event filter has been activated and it unregisters another X11
event filter, then the window manager may crash because the foreach macro
in Workspace::workspaceEvent() makes a copy of m_genericEventFilters or
m_eventFilters and we can call the event() method for an already defunct
filter.
With this change, X11 event filters can be safely removed and installed
at any particular moment.
BUG: 423319
This change replaces the remaining usages of the old connect syntax with
the new connect syntax.
Unfortunately, there are still places where we have to use SIGNAL() and
SLOT() macros, for example the stuff that deals with d-bus business.
Clazy was used to create this change. There were a few cases that needed
manual intervention, the majority of those cases were about resolving
ambiguity caused by overloaded signals.
Currently, we do some sort of window placement only for decorated
internal windows, which feels hacky.
With this change, all internal clients will go through the window
placement code, unless it's a popup or the BypassWindowManagerHint
flag is set.
If the BypassWindowManagerHint flag is set, the window must have
valid position.
CCBUG: 400675
The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.
In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
If the Xwayland process crashes, it will bring down the entire session
together with itself. Obviously, we don't want that. At least, Wayland
clients should survive the crash.
This change refactors relevant X11 parts to handle Xwayland crashes in a
less fatal way.
In order to handle Xwayland crashes better, a pair of start() and stop()
methods had been introduced in the Xwayland class to allow starting and
stopping the Xwayland process at any moment.
If we detect that the Xwayland process has crashed, we will immediately
stop the Xwayland server, which in its turn will deactivate the socket
notifier and destroy all connected X11 clients. Unfortunately, a couple
of subtle changes in X11Client::releaseWindow() and Unmanaged::release()
had to be made to ensure that we are left with a valid state after the
Xwayland server has been stopped.
It was called twice once with and without X as our implementation of
setRootInfo() missed some calls.
This was done to avoid a bug as setRootInfo() didn't update everything.
This patch aims to resolve that at the root cause.
I tested the original conditions of the patch with an empty kwinrc and a
file in /etc/xdg/kwinrc setting desktops to 2 and everything loaded
correctly.
Currently the only way for a uuser to invoke corner-tiling is to
manually set shortcuts for them. This patch adds another option: invoke
the existing shortcuts for edge tiling in a combined manner in quick
succession.
For example, hitting Meta+Left and then Meta+Up within a one-second
period will tile the active window into the top left corner. In practice
you hold down the Meta key and then press Left then Up (or Up and then
Left), and I think it feels very natural. Linux Mint's window manager
has this feature and I always missed it when I left Mint for the KDE
world.
Autotests for existing tiling shortcuts are adjusted to not break, and
additional tests for the new tiling options are added.
There are several ways to handle unmapping of a wl_surface. The first
one is to destroy the associated AbstractClient instance. The second one
is to transition the AbstractClient in a special state.
The problem with the second approach is that it makes animations such as
fade out more difficult to handle since effects in kwin are geared more
towards the first approach (destroying AbstractClient).
Summary: Alt + Left Click to move windows has a tendency to conflict with creative workflow apps. While Alt can be changed to Meta in KWin's settings, Alt + Left Click shortcuts often cannot be customized in apps. Rather than making every user who runs into this problem change their settings, we should change our default settings to improve KWin's default usability. The fact that Alt + Left Click to move windows is older does not matter. We are trying to use Meta for global/shell shortcuts anyway.
BUG: 399375
Test Plan: The relevant parts of the relevant tests pass. kwin-testInternalWindow fails, but for unrelated reasons that have something to do with XWayland.
Summary:
On X11, Workspace stores windows in two lists. One with desktop windows
and the other one with all other windows. On Wayland, desktop windows
and normal windows are stored in the same list - m_allClients.
In order to unify scripting on X11 and Wayland, this change makes the
Workspace class store X11 desktop windows and normal X11 windows in the
same list. It's the responsibility of scripts to filter desktop windows.
Reviewers: #kwin, apol
Reviewed By: apol
Subscribers: apol, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D29522
Summary:
This change drops Workspace::sendPingToWindow() in order to better
separate X11-specific and more generic code.
Test Plan: Still able to close X11 windows.
Reviewers: #kwin, apol
Reviewed By: apol
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D29472
In case Xwayland does not use multiple buffers, the currently attached
buffer is going to be destroyed if the frame window is resized. It may
render the previous and the current window pixmap invalid and thus result
in visual artifacts when an X11 client is being interactively resized.
In order to avoid the visual artifacts, this change disables support for
synchronized resizing for X11 clients if the version of Xwayland is less
than the version in which Xwayland started using multiple buffers, i.e.
1.21.
Differential Revision: https://phabricator.kde.org/D29250
Given that we now query the current X11 time stamp on Wayland, we can
enable synchronized resizing for Xwayland clients.
Differential Revision: https://phabricator.kde.org/D29250
Summary: Instead, have KSMServer talk to us directly on DBus.
Test Plan: Depends on D28616
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D28617
Summary:
As is KWin only had 1 Cursor which was a singleton. This made it impossible for
us to properly implement the tablet (as in drawing tablets) support and show where
we're drawing.
This patch makes it possible to have different Cursors in KWin, it makes all the
current code still follow the mouse but the tablet can still render a cursor.
Test Plan: Tests pass, been using it and works as well as before but with beautiful tablet cursors.
Reviewers: #kwin, cblack, davidedmundson
Reviewed By: #kwin, cblack, davidedmundson
Subscribers: davidedmundson, cblack, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D28155
Summary:
Screens is used in screenEdges in a recent refactor
This didn't affect wayland as main_wayland creates screens earlier
itself. We can't move creation into main_x11 as X11's screens uses an
event filter which relies on workspace existing.
BUG: 419178
Test Plan: Restarted on X11
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D28233
Summary:
The new method provides a generic way for destructing clients. Notice
that we can't just delete clients because we may need to discard
temporary window rules, which is usually done in destroyClient().
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D27821
Summary:
Currently, we have only one shell client type - XdgShellClient. We use
it when we are dealing with Wayland clients. But it isn't really a good
idea because we may need to support shell surfaces other than xdg-shell
ones, for example input panel surfaces.
In order to make kwin more extensible, this change replaces all usages
of the XdgShellClient class with the AbstractClient class.
Test Plan: Existing tests pass.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D27778