Currently, we use glFinish() to ensure that stream consumers don't see
corrupted or rather incomplete buffers. This is a serious issue because
glFinish() not only prevents the gpu from processing new GL commands,
but it also blocks the compositor.
This change addresses the blocking issue by using native fences. With
the proposed change, after finishing recording a frame, a fence is
inserted in the command stream. When the native fence is signaled, the
pending pipewire buffer will be enqueued.
If the EGL_ANDROID_native_fence_sync extension is not supported, we'll
fall back to using glFinish().
VirtualKeyboard class does not implement the relevant VirtualKeyboard
protocol but rather implements the InputMethod protcol and can in theory
be used by other input method like e.g. ibus.
Make class name consistent with what it does to avoid confusion in
future.
For now only rename of main class is done and dbus service is kept as-is
to provide retro-compatibility, when input method protocol is
implemented fully, we can think of what to do wrt the dbus interface
later when we fully implement zwp_input_method_unstable_v1 protocol.
This change introduces a shell integration class for input panel
surfaces. This effectively breaks the direct dependency between our
virtual keyboard component in kwin and the input_panel protocol,
which means that an input method server could use the layer-shell
protocol instead of the input_panel protocol.
The layer-shell protocol allows wayland clients to create surfaces that
can be used for building desktop environment components such as panels,
notifications, etc.
The support for the plasma-shell protocol will be dropped once plasma in
all its entirety is ported to the layer-shell protocol.
in XdgSurfaceClient setFrameGeometry is async,
so we can't rely on it having the final value immediately.
make setVirtualKeyboardGeometry a virtual.
in the implementation on setVirtualKeyboardGeometry
use requestedFrameGeometry() instead of frameGeometry()
When the Xwayland process crashes, we will print a warning message, but
that warning message won't show up anywhere in the terminal because the
current message severity for KWIN_XWL is way too high.
This patch lowers the message severity for the KWIN_XWL logging category
so warning messages can be seen from the terminal.
Currently in order to load an Xcursor theme, kwin uses libwayland api,
which looks really awkward because of the way how the compositor talks
to itself via the internal connection.
The main motivation behind this change is to limit the usage of kwayland
client api in kwin.
- The name of tty devices is different; put detection into
the CMakeLists and pass that as a define when building
virtual_terminal.cpp -- this means no ifdeffery for the path.
- The name of dri devices is different; FreeBSD just has one.
- On FreeBSD epoll.h if provided through a library (from a port, epoll-shim)
that emulates the Linux behavior. Make a CMake module for it to hide
differences in systems behind a module.
- Find epoll on FreeBSD and link to it
Now on FreeBSD, tries to compile virtual_terminal.cpp, which will fail because
that needs more patches.
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:
This change splits the XdgShellClient class to better match existing
abstractions in the xdg-shell protocol and fix a few issues related to
sending configure events.
In the new client classes, configure events are handled differently.
Instead of blocking configure events, we try to send them as late as
possible. Delaying configure events will let us merge changeMaximize()
for X11 clients and Wayland clients and it also fixes the bug where
we don't send the final configure event when user has finished resizing
a window.
Given that configure events are not sent immediately, XdgSurfaceClient
keeps the last requested frame geometry and the last requested client
geometry.
This patch doesn't intend to fix all issues in kwin's implementation of
the xdg-shell protocol. For example, we still handle surface unmapping
very poorly.
Test Plan: Tests pass.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D27861
Currently, the focus tracking functionality in the zoom effect does not
work because it relies on kaccessibleapp, which is dead. Luckily for us,
there is a library called libqaccessibilityclient that provides a way
to monitor focus changes.
BUG: 421234
Sub-surface contribute to the window quads cache. So, we must re-build
it, if any sub-surface has been changed.
Differential Revision: https://phabricator.kde.org/D29131
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: Recent changes prevented it to build on KDE Neon.
Test Plan: Built it on Neon
Reviewers: #kwin, bshah, davidedmundson
Reviewed By: #kwin, bshah, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D28511
Summary:
We build some objects several times which makes it uncomfortable to develop KWin
since every time we modify something a lot of things get rebuilt. This should
help a bit although it doesn't solve all the problems.
Test Plan: Builds, tests pass
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: davidedmundson, zzag, anthonyfieroni, iasensio, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D28445
Summary:
Uses the tablet classes introduced in kwayland.
Depends on D26858
Test Plan:
Scratched my tablet with a magic stick and it did things depending on the pressure.
https://youtu.be/GGx0TlNJlzs
Reviewers: #kwin, #plasma, zzag, davidedmundson
Reviewed By: #kwin, #plasma, zzag, davidedmundson
Subscribers: davidedmundson, zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D26859
Summary: No need to keep them around for no reason.
Test Plan: Tested the plugins I thought could be affected. Have been using it for a couple of days without problems
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D28062
Summary:
This functionality will instead be implemented in KScreen such that manual and
automatic output rotation can be used and configured through a single UI in
unison together.
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson, zzag
Reviewed By: #kwin, zzag
Subscribers: kwin, bshah, davidedmundson, zzag
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D26036
Test Plan:
KScreen now shows "Dell Inc." instead of DEL and
"Eizo Nano Corporation" instead of ENC in output names, which
matches closer to what's written on my monitors.
Reviewers: graesslin, davidedmundson, #plasma
Reviewed By: davidedmundson, #plasma
Subscribers: apol, feverfew, ngraham, davidedmundson, mart, kwin, sebas
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D10041
Summary:
To successfully build kwin needs 13e6459a3baeebe6a7b594efd995b88f6dd7524e
in kdecoration. Otherwise it fails with: "previewclient.h:93:11: error:
'QSize KDecoration2::Preview::PreviewClient::size() const' marked
'override', but does not override QSize size() const override;"
So this is not a new requirement but just an update to the build system
to reflect the actual requirements.
Test Plan: Builds fine with the newly required version
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D27242
Summary:
This wasn't used on startup (ksmserver calls KProcess)
Nor for the rules dialog (kwin invokes it with QProcess)
We may as well simplify the code and drop the dependency
See also T12140
Test Plan:
Restarted
Opened the rules dialog
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D26835
Summary:
The ClockSkewNotifier provides a convenient way for monitoring system
clock changes. One of the key ideas was to hide platform details from
users of the class. This allows us to add a QTimer fallback path for
operating systems that don't provide anything to detect system clock
changes.
In long term, I would like to move the new class to Frameworks.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D25962
Summary:
This includes support for them on libinput and turns it into fake
pointer actions.
This doesn't implement zwp_tablet, this will have to happen in an
iteration later.
Test Plan:
Been playing around with it, see video.
https://www.youtube.com/watch?v=GF1WbO8FVvU
Reviewers: #plasma, #kwin, romangg
Reviewed By: #plasma, #kwin, romangg
Subscribers: zzag, davidedmundson, romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D25663
Summary:
This allows devs to run: "make clang-format" and format all files easily
using the preset KDE clang format style
This patch adds support so devs can easily test the intended formatting
now, it doesn't change the code yet.
Doing an initial run to commit everything will happen later.
Test Plan:
Ran script
git diff was full of amazingly cleaned code
See D25134
Summary:
Currently kwin opens a second ICE connection to ksmserver in order to
tell the state of kwin's whether we're logging out and saving clients or
not.
This requires that kwin launches after ksmserver to have the connection
which is a dependency I want to break.
Practically this code is already ksmserver specific as it relies on some
custom code that sends the first saveState request to kwin first.
Instead we can replace it with a bespoke IPC over DBus and siplify the
code both end. This will allow several other future enhancements that we
want with regards to handling the session state, as well as make an
effort platform agnostic session management, as well as cleaning up some
complex code.
Ksmserver calls into kwin, rather than having kwin watch ksmserver state
to allow us make sure it's race free.
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: romangg, zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24862
Summary:
The EGL platform might go away at any time through reconfiguration or because
of a graphic error. KWin then resets the graphics. The dmabuf implementation
must respect that and recover from a graphics reset by recreating all EGL
images for existing buffer.
This assumes that we won't change our graphics API mid-session and that
supported plane and modifier configuration stays constant.
In practise we remember all current dmabufs in a single map and only remove
them if the client did destroy the resource.
BUG: 411980
CCBUG: 413403
FIXED-IN: 5.17.2
Test Plan: Applied screenedge configuration without crash.
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: fvogt, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24954
Summary:
Currently each managed X11 client is represented with an instance of
Client class, however the name of that class is very generic and the
only reason why it's called that way is because historically kwin
was created as an x11 window manager, so "Client" was a sensible choice.
With introduction of wayland support, things had changed and therefore
Client needs to be renamed to X11Client in order to better reflect what
that class stands for.
Renaming of Client to X11Client was agreed upon during the last KWin
sprint.
Test Plan: Compiles, the test suite is still green.
Reviewers: #kwin, romangg
Reviewed By: #kwin, romangg
Subscribers: romangg, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24184
Summary:
Rename ShellClient to XdgShellClient in order to reflect that it
represents only xdg-shell clients.
Test Plan: Compiles, tests still pass.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23589
We have lots of inconsistency at the moment in CMakeLists.txt files. Most
of it is due to kwin being a very old project. This change hopefully fixes
all of it.
Summary:
Currently component names and filenames are partially sorted. This makes adding
new items and finding existing items more difficult.
Test Plan: Compiles.
Reviewers: #kwin, gladhorn
Reviewed By: #kwin, gladhorn
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24018
Summary:
This has been commented out since 2014, I doubt it will come back.
This is a big amount of code, maintenance will be easier without it.
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: romangg, graesslin, kwin
Tags: #kwin, #documentation
Differential Revision: https://phabricator.kde.org/D23069
Summary:
This allows all the section headers to always have the same look and feel and be
adjusted in just one place.
Depends on D23049
Test Plan: {F7181776}
Reviewers: #vdg, kwin, GB_2, #kwin
Reviewed By: #vdg, GB_2
Tags: #kwin
Maniphest Tasks: T10384
Differential Revision: https://phabricator.kde.org/D23055
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
Configuration macro HAVE_SCHED_RESET_ON_FORK is not reflecting availability of SCHED_RESET_ON_FORK
in config-kwin.h because that feature is detected after file is already generated.
Fix this by moving config-kwin.h generation after feature detection.
Differential Revision: https://phabricator.kde.org/D22337
Summary:
The screenlock fails on X11 if it can't grab the keyboard.
We can't nicely solve the generic case. We can solve the common case of
a kwin effect being active.
It's not critical, arguably not even desirable to have these effects
persist after the screen is locked through an external trigger. We can
just close the effect early.
Key grabs have to be relased early before the close animation completes
so that the locker doesn't have a race based on animation times.
It's not ideal, but no worse than the current state for not much work.
BUG: 234153
Test Plan:
locked screen on a timer
opened various effects
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: ngraham, zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D20890
Summary:
Represent outputs in the X11 session via AbstractOutput. For that we
move all Wayland specific parts of AbstractOutput into a new subclass
AbstractWaylandOutput and let the outputs of our Wayland backends inherit
from there.
This should allow us to get rid of the Screens class later on.
Test Plan: Manually in X session.
Reviewers: #kwin, zzag, davidedmundson
Reviewed By: #kwin, zzag, davidedmundson
Subscribers: ngraham, zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19208
Summary:
Kwin has a mandatory dependency on kscreenlocker, we can use the
screensaver interface definition installed from there.
Test Plan: Compiles
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D20764
Summary:
This is the initial implementation of a DRM backend based on the EGLDevice,
EGLOutput, and EGLStream extensions, supporting NVIDIA graphics hardware using
their proprietary driver. The new backend will be used if the environment
variable KWIN_DRM_USE_EGL_STREAMS is set. On initialization, it will attempt to
create an EGLDevice based on the DRM device currently in use and create
EGLOutputs and EGLStreams for any attached displays. These are used to control
presentation of the final composited frame. Additionally, it will register the
wl_eglstream_controller Wayland interface so that native EGL windows created by
clients can be attached to an EGLStream allowing buffer contents to be shared
with the compositor as a GL texture.
At this time there are two known bugs in the NVIDIA driver's EGL implementation
affecting desktop functionality. The first can result in tooltip windows drawn
by plasmashell to contain incorrect contents. The second prevents KWayland from
being able to query the format of EGLStream-backed buffers which interferes
with the blur effect. Fixes for both of these are currently in development and
should appear in an upcoming NVIDIA driver release.
Additionally, hardware cursors are currently not supported with this backend.
Enabling them causes the desktop to intermittently hang for several seconds.
This is also likely a bug in the NVIDIA DRM-KMS implementation but the root
cause is still under investigation.
Test Plan:
On a system with an NVIDIA graphics card running a recent release of their
proprietary driver
* Ensure the nvidia_drm kernel module is loaded with the option "modeset=1"
("# cat /sys/module/nvidia_drm/parameters/modeset" should print "Y")
* Ensure EGL external platform support is installed
https://github.com/NVIDIA/eglexternalplatform
* Ensure KWin was build with the CMake option
KWIN_BUILD_EGL_STREAM_BACKEND=ON (this is the default)
* Start a plasma wayland session with the environment variable
KWIN_DRM_USE_EGL_STREAMS set
* Ensure output from KWin OpenGL initialization indicates the NVIDIA EGL
driver is in use (as opposed to Mesa / llvmpipe).
* Desktop should be fully functional and perform smoothly.
Reviewers: #kwin, romangg, davidedmundson
Reviewed By: #kwin, romangg, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18570
Summary:
Package structure plugins are not that special so move them to
the corresponding directory.
Test Plan: Compiles.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18685
Summary:
Most of the functionality which is special to internal clients is moved
from ShellClient to InternalClient. As KWin's qpa is still bound to the
Wayland protocol InternalClient inherits from ShellClient. Due to that
some aspects in ShellClient are "weird". ShellClient still detects
whether it's an internal client and uses the variable m_internal to
capture the state. This is required as we cannot use the isInternal
method. Most of m_internal usage is in init which is called from
constructor of ShellClient. Thus it's not possible to call into virtual
methods of InternalClient.
Also some of the code is duplicated and some methods are temporarily
marked as virtual.
The next step will be to remove ShmBuffer for internal windows which
should decouple the two implementations further with the long term goal
of having InternalClient inherit AbstractClient directly.
Test Plan:
Run nested KWin, triggered outline (OpenGL case) and debug console (shm case).
InternalWindow unit test still passes.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18569
Summary:
Building upon the generic X Selection support this patch establishes another
selection class representing the XDND selection and provides interfaces
to communicate drags originating from Xwayland windows to the Wayland
server KWin and drags originating from Wayland native drags to Xwayland.
For Wayland native drags KWin will claim the XDND selection as owner and
will simply translate all relevant events to the XDND protocol and receive
alike messages by X clients.
When an X client claims the XDND selection KWin is notified via the X protocol
and it decides if it allows the X drag to transcend into the Wayland protocol.
If this is the case the mouse position is tracked and on entering a Wayland
native window a proxy X Window is mapped to the top of the window stack. This
proxy window acts as a drag destination for the drag origin window and again
X messages will be translated into respective Wayland protocol calls. If the
cursor leaves the Wayland window geometry before a drop is registered, the
proxy window is unmapped, what triggers a subsequent drag leave event.
In both directions the necessary core integration is minimal. There is a single
call to be done in the drag and drop event filter through the Xwayland
interface class.
From my tests this patch facilitates drags between any Qt/KDE apps. What needs
extra care are the browsers, which use target formats, that are not directly
compatible with the Wayland protocol's MIME representation. For Chromium an
additional integration step must be done in order to provide it with a net
window stack containing the proxy window.
Test Plan: Manually. Auto tests planned.
Reviewers: #kwin
Subscribers: zzag, kwin, alexde
Tags: #kwin
Maniphest Tasks: T4611
Differential Revision: https://phabricator.kde.org/D15627
Summary: Adds an interface class to access Xwayland members from within KWin core.
Reviewers: #kwin, davidedmundson, zzag
Subscribers: zzag, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D15419