Summary:
The takeDevice method calls dup, but that syscall removes the O_CLOEXEC flag
as a side-effect. This resulted in all child processes of kwin_wayland having
an open file descriptor for those devices.
Test Plan:
Looked at the open FDs of the startplasma script. Before, all
/dev/input/eventX files and /dev/dri/card0 were open. Now, none of those
are part of /proc/PID/fd/
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: kwin, plasma-devel, #kwin
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D8887
Summary:
In some cases, it's possible that libinput wrote device added events to
the file descriptor before the connection to handle those events was
in-place. This resulted in a compositor without any input devices.
Test Plan:
Ran a wayland session. In about 60% of all cases, no input was
possible. kwin_libinput showed the enumeration of all devices correctly,
but KWin::LibInput::Context did not have any m_devices.
After this change, this did not appear anymore.
Reviewers: #plasma, graesslin, davidedmundson
Reviewed By: #plasma, graesslin, davidedmundson
Subscribers: anthonyfieroni, ngraham, kwin, #kwin, plasma-devel
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8888
Summary: Fixes the build with D8705
Test Plan: Just adds includes, I wonder if it should go into Plasma/5.8 and /5.11 too
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: graesslin, plasma-devel, kwin, #kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8706
Summary:
Commit 5d9027b110 introduced a regression in TabBox by using the generic
framework inside KWin to test for same application. What I did not
consider was that the code in TabBox was "broken by design". It didn't
use the generic check as that is too strict and considers windows from
different processes as not belonging to the same application. But this
is not wanted in the case of TabBox.
On the other hand the change itself is an improvement to also support
Wayland in a better way and not have special handling situations. Thus
just reverting would not help.
Instead this change addresses the problem by extending the internal API
and to allow more adjustements. So far there was already an
"active_hack" boolean flag. This is extended to proper flags with an
additional flag to allow cross application checks.
The checks in Client which would filter out different applications check
for this flag and are skipped if set. In addition ShellClient also adds
support for this flag and compares for the desktop file name.
Thus we get in TabBox the same behavior as before with the advantage of
having a better shared code base working on both X11 and Wayland.
BUG: 386043
FIXED-IN: 5.11.4
Test Plan:
Started two kwrite processes on X11, clicked new in one of them,
used Alt+` and verified that there are three windows shown.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8661
Summary:
On X11 modifier+mouse button on the window decoration triggers the
"special" handling thus as unrestricted move instead of passing the click
to the decoration. Of course on Wayland we want to have the same
functionality.
BUG: 386708
FIXED-IN: 5.11.4
Test Plan: New test case added. PointerInputTest still passes.
Reviewers: #kwin, #plasma, broulik
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8758
Summary:
This is meant to address Bug 372114. The problem here is that the KConfig
object (and its derivatives), that the freeze detection thread needs to
record the freeze, are not thread safe. When it happens that the main
thread is in fact not frozen, it is possible that the two stomp on each
other's KConfig object.
The solution applied here is to use the KSharedConfig::openConfig
function, which is thread safe, on the freeze detection thread. As was
mentioned by Martin Flöser in the discussion, the thread needs to obey
the name of the main config file of KWin, which can change in the future.
As a secondary issue, this patch also turns off KCrash reporting for
aborts due to a freeze being detected. IMO it is not very user friendly
to still show a crash report to the user, even after this bug is fixed,
for the deliberate SIGABRT. Maybe a less intrusive notification could be
used to tell the user why effects are suddenly disabled?
I've been using kwin with this change for several weeks now and it makes
the restarts of kwin due to freezes unobtrusive. However, most (I would
say almost all) of these freezes are actually instances where the system
is being slow after eg. screen resolution is changed.
BUG: 372114
FIXED-IN: 5.11.3
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: ngraham, graesslin, anthonyfieroni, cfeck, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8356
Summary:
Rendering subsurfaces in the OpenGL compositor has always resulted in
flickering when a subsurface gets repainted and there is a window on top
of it. Looking at the code this is rather obvious: the clipping of the
main window is ignored and the complete subsurface is rendered as is and
thus also rendering above windows where it should not render.
This change passes the clip region and whether hardware clipping is used
to the rendering of subsurfaces which in turn uses it for rendering the
texture.
BUG: 385924
FIXED-IN: 5.11.3
Test Plan:
Opened systemsettings, went to decoration KCM, put a window
partially above and scrolled. Without change: strong flicker, with change:
no flicker.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8369
Summary: D8479 fixes viewport for real hardware, but there is still problem with screenshots. This patch fixes that.
Test Plan:
- Have three monitors (like in bug 385655)
- Press PrtSc and then Enter
- Screenshot is ok
Before:
{F5450056}
After:
{F5450058}
Reviewers: #kwin, #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: davidedmundson, plasma-devel, kwin, #kwin
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D8485
Summary:
glScissor works on window co-ordinates. i.e not scaled by the viewport
We need to multiply by the scale there.
This fixes a minor visual glitch in animations when using hardware
clipping.
Test Plan:
Hardcoded my minimise animation to be really slow.
Now every frame looks perfect
Reviewers: #kwin
Subscribers: kpiwowarski, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8490
Summary:
We want to translate by the monitor position, so that needs to be
the negative of the position.
But Kwin/KScreen treats 0 as the top of all monitors. GL treats 0 as
bottom, so that all needs inverting.
Hence this should be a positive y value for the viewport.
BUG: 386099
BUG: 385655
Test Plan:
Had two monitors
Side by side was - fine
Stacked vertically - still fine
Modded X code to extend in y instead of x.
3 monitors worked fine.
Nested wayland only seems to support one screen?
Reviewers: #plasma
Subscribers: plasma-devel, kwin, #kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8479
Summary:
When clicking the maximize button without moving the mouse, the maximize
button stayed in hover state till the mouse moved. The reason for this
is that the PointerInputRedirection does not perform an update on the
geometry change of a window.
BUG: 385140
FIXED-IN: 5.11
Test Plan: Manual testing
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8016
Summary:
This fixes the following problem:
1. Have two windows maximized
2. Click minimize button on first window
3. Click minimize button on second window
What happened:
Second click was ignored as the pointer was not updated.
BUG: 378704
FIXED-IN: 5.11
Test Plan:
Nested KWin/Wayland, added two maximized windows, minimized
both without moving the mouse
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8145
Summary:
In 47343fb we made GBM buffer shared.
What we wanted to do was:
Unbox the shared_pointer<GBMSurface> to give us a GBMSurface* object
Call the gbm_surface*() on that operator
Then cast that to a void* for eglCreatePlatformWindowSurfaceEXT
What we did:
Cast the std::shared_ptr<GBMSurface> to a gbm_surface* then cast that
to void*.
This is just a garbage value and it crashes in Mesa when we do our first
paint.
I've replaced that with an explicit method then we can use shared_ptr's
-> operator rather than get() which does the right thing in a readable
way.
Test Plan:
It crashed after rebasing to master (for Aleix too)
No longer crashes
Reviewers: #plasma
Subscribers: plasma-devel, kwin, #kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8251
Summary:
The gbm_surface is owned by the EglGbmBackend, but it's not the only one
using it. The DrmSurfaceBuffer is also using it and needs it to destroy
the gbm_bo. Now this can become a problem in the following situation:
* a page flip is still pending
* the EglGbmBackend destroys the gbm_surface
-> when the page flip happens the DrmSurfaceBuffer will try to destroy
the gbm_bo and crash as the gbm_surface is no longer valid. This
situation can happen when switching screens or when switching compositing
backend (OpenGL 2 -> OpenGL 3).
To address this problem a class GbmSurface is added which wrapps the
gbm_surface pointer. The EglGbmBackend creates and holds a shared pointer
to the GbmSurface and passes that one to the DrmSurfaceBuffer. So when
cleaning up the gbm_surface only the shared pointer is reset and in case
the DrmSurfaceBuffer still needs it, it can access it without problems.
BUG: 385372
FIXED-IN: 5.11.0
Test Plan: Not yet
Reviewers: #kwin, #plasma, subdiff
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8152
With the new Wayland only mode we start too fast and it can happen that
the initWithWorkspace is called before the client connection is fully
setup. This would result in a crash in the idletime plugin once it tries
to create a seat.
To prevent this problem the code is split out into a dedicated method
and only invoked if all interfaces have been announced on the internal
connection.
BUG: 385397
FIXED-IN: 5.11.1
guix (like nix) used a separate prefix for each package. Thus the header
files for
qtdeclarative are in /gnu/store/…-qtdeclarative-5.9.1/include/qt5/ while
the ones for
qtbase are in /gnu/store/…-base-5.9.1/include/qt5/. This means that
*each* dependency's include directory must be specified. This is in
contrast to a "normal" Unix-system, where all includes end up in
/usr/include/qt5 and missing to defined some include-dependencies does
often not raise an error.
Differential Revision: https://phabricator.kde.org/D8112
Summary:
So far the method only operated on X11 clients. So when the last desktop
got removed Wayland clients were still on it. As the auto test showed:
this results in a crash.
Credits go to code coverage as it showed that area as red, which made me
look on it and realize this must be broken.
Test Plan: New test case added
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8082
Summary:
Instead of calling reconfigure() on screen size changes, which deletes
and recreates the effect, we can just update the one texture that's mapped to
the screen size.
---
From the wayland commit.
>What surprises me is that BlurManager recreates for Output changes.
>That sounds like a bug in KWin (or an area which could be improved).
I had thought the same and wrote this (though wanted to have kwayland fixed first)
Test Plan:
Logged in and out (my screen resizes on startup due to scaling)
Tested on my X machine by turning a screen off. Nothing broke, plasma
panels looked the same.
Note: Eike tried this patch last week and claimed kwin still crashed.
We don't have a backtrace so it could have been something unrelated,
applied wrong or that he was deliberately lying to wind me up.
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: graesslin, plasma-devel, kwin, #kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7877
Summary:
Similar to the Blur patch. Arguably rven less reason as this doesn't
have a texture the size of the workspace.
We don't need to delete and recreate the entire effect every time the
screen changes; This deletes the wayland global which causes quite a bit
of extra work for the clients.
Test Plan:
Changed resolution under X, and scale under wayland
Panel looked the same and nothing exploded
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: graesslin, plasma-devel, kwin, #kwin
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D7937
Summary:
Creating the X11Filter directly on startup caused a regression as the
filter got too early in the chain and stole events from the
XInputIntegrationFilter. We don't need the filter all the time, but only
when we have established the TabBox grab. Likewise we can destroy the
filter again when releasing the TabBox grab. So it's much more
encapsulated now.
BUG: 385032
Test Plan: Only compile tested, I'm on Wayland
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7997
Summary:
It was possible that we performed an early exit when the caption changes
and this results in the visible name being wrong. E.g if we have two
windows called foo, the second one has the visible name "foo <2>". After
changing that to "bar" the bug resulted in it still being the foo
variant instead of getting cleared.
BUG: 384760
FIXED-IN: 5.11.0
Test Plan: Created new test case exposing the problem
Reviewers: #kwin, #plasma, hein
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7871
Summary:
Deleting the lanczos filter deletes it's GLShader, this calls
glDeleteProgram
glFooBar always needs to have an openGL context, we don't know we have
this on a screen changed event as it is called from outside the normal
render methods.
BUG: 384884
Test Plan:
Ran on my wayland session. Switched geometry a lot, couldn't reproduce the crash.
Ran on my desktop session, seemed the same as before
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: graesslin, plasma-devel, kwin, #kwin
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D7888
Summary:
In the DRM plugin the cursor is currently is drawn at the native size
given.
Therefore we don't want to scale the icon offset as that leads to it
being drawn every so slightly off-sync.
BUG: 384769
Fixed-in: 5.11.0
Test Plan:
Kate now selects lines based on the middle of the cursor, not the top left.
I'd previously gotten so used to it, I hadn't realised it was actually a bug :/
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: plasma-devel, kwin, #kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7868
No idea why the code compiles on my system. This change is based on the
output on build.kde.org.
CMakeFiles/testXRandRScreens.dir/__/plugins/platforms/x11/standalone/screens_xrandr.cpp.o:
In function `KWin::XRandRScreens::event(xcb_generic_event_t*)':
/home/jenkins/workspace/Plasma kwin kf5-qt5 SUSEQt5.9/plugins/platforms/x11/standalone/screens_xrandr.cpp:210:
undefined reference to `KWin::Options::currentRefreshRate()'
...
Summary:
CXX_STANDARD is only available since 3.1.
$ git show 913394af2: cmTarget: Add CXX_STANDARD and CXX_EXTENSION...
$ git tag --contains 913394af2 | head -n: v3.1.0
3.1 also has CMakePackageConfigHelpers (available since 3.0),
allowing to drop ECMPackageConfigHelpers (it actually fixes a CMake
warning when requiring >=3.0).
Furthermore move cmake_minimum_required(VERSION 3.1 FATAL_ERROR) to
the top of CMakeLists.txt like suggested by CMake's documentation.
Test Plan: cmake .. & ninja
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7784
Summary:
Several effects announce a support property atom on the root window. This
change forwards the KWin::Application's signal that the xcbConnection
changed to the EffectsHandler so that the effects can respond to it.
All effects which announce a support property connect to this new signal
and re-announce the property. In case the xcb connection died (future
XWayland crashing case) it is set to XCB_ATOM_NONE by that. In case the
xcb connection got created (future delayed XWayland startup) the atom is
set to the proper value.
In addition all usages of the support properties are guarded, so that no
nonesense actions are performed if the support property is XCB_ATOM_NONE.
Test Plan: Only compile tested as we don't have XFree KWin yet
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7761