Summary:
When suspending compositing, SceneOpenGLShadow cannot cleanup cached
decoration shadow textures because the effects handler is already gone.
This sometimes can result in a crash when running kwin_x11 --replace
(we're hitting an assert statement).
To fix that, let's use the scene instead of the effects handler for
making the OpenGL context current.
Test Plan:
No longer hit the assert statement:
ASSERT: "m_cache.isEmpty()" in file /home/vlad/Workspace/KDE/src/kde/workspace/kwin/plugins/scenes/opengl/scene_opengl.cpp, line 2025
Application::crashHandler() called with signal 6; recent crashes: 1
QCoreApplication::applicationFilePath: Please instantiate the QApplication object first
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = kwin_x11 path = /home/vlad/Workspace/KDE/usr/bin pid = 5407
KCrash: Arguments: /home/vlad/Workspace/KDE/usr/bin/kwin_x11 --replace
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17306
Summary:
The idea of opening the compositing kcm was to show a warning. But that
broke quite some time ago without noticing. We had two ways:
* pass through --args command line argument
* use dbus call to already open kcm
Neither of the two ways is working. The kwincompositing doesn't parse
the arguments and the dbus interface doesn't exist any more.
Following the advice to remove functionality nobody noticed that it is
broken, this is removed with this change. This probably broke with
introducing the new KCM which happened IIRC for Plasma 5.0.
BUG: 393845
FIXED-IN: 5.14.0
Reviewers: #kwin, #plasma
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13235
Summary:
The current refresh rate is stored in OutputInterface. Move the getter
therefore in the AbstractOutput class.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16793
Summary: Removes unneeded includes and reorders the code in a sensible way.
Reviewers: #kwin
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16792
Summary:
Set the mode in AbstractOutput and call into the plugin
for final change on hardware.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Maniphest Tasks: T10016
Differential Revision: https://phabricator.kde.org/D16786
Summary:
Wayland output is on protocol level and not dependent on the hardware
platform. Next steps are to do the same for output device and then let
the virtual output call into these initializing functions as well.
Test Plan: Manually and auto test.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16783
Summary: Ensures that we can load the plugin when running only from build dir.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16762
Summary:
Look there, another plugin I didn't remember. The other qml files are
not needed for the aurorae autotest as it's for the svg based themes
instead of qml themes like Plastik.
Test Plan: Further destroyed my system, test failed, with this change passed.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16761
Summary:
So far we didn't know why plastik wasn't loaded. Now we get the error
messages.
Test Plan: Saw error messages while investigating failing KWin test
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16753
Summary: The tests running Aurorae need to be able to pick up the plastik plugin.
Test Plan: Removed system install of plastik plugin, now test passes
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16752
Summary:
This ensures that DontCrashAuroraeDestroyDecoTest can load the plastik
window decoration when run from build directory as it happens on
build.kde.org.
Test Plan: Test passes now when manipulating XDG_DATA_DIRS to hide system install
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16745
Summary:
Ideally KWin would not depend on private headers... but at least we can
remove unused ones.
Test Plan: still builds, I don't see anything requiring the header.
Reviewers: zzag
Reviewed By: zzag
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16655
Summary: This file was required for Qt 5.8. We require 5.11 as minimum version.
Test Plan: Grepped for the file being used in other cmake code, rebuilt KWin without it.
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: kwin, zzag
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16654
Summary:
Qt does not like having no screens. Both Qt XCB and Wayland QPAs have
systems pretend there's always at least 1 screen
present.
Kwin already uses a dummy screen on startup, this patch reinserts the
dummy screen if the platform states that all real screens are removed.
BUG: 399564
Test Plan:
Logged in, everything still worked
Did not reproduce the original bug
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16096
Summary:
QOpenGLContext was changed to call platform->makeCurrent before it
called setCurrentContext.
Because we bind window FBO and ultimately that calls
QOpenGlContext::format we need Qt to know which context is current so it
can tell us the format.
This matches the QtWayland EGL code.
BUG: 399392
Test Plan:
Switched virtual desktop with the OSD (previously reliably crashed)
Now it doesn't
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D15957
Summary:
If the corner shadow tiles(top-left, top-right, and so on) tiles are missing,
then the left/top/right/bottom shadow tiles will overlap.
This diff addresses that problem by changing how the shadow texture
atlas is rendered:
* corner tiles will be drawn in the corners of the atlas(buildQuads
method expects them to be at the corners);
* top, right, bottom, and left tile will be aligned to the top-left
corner of the inner shadow rect.
For majority of desktop themes, the shadow texture atlas looks the same.
For example, here's for Aether:
Before:
{F6190484, layout=center, size=full}
After:
{F6190488, layout=center, size=full}
Depends on D14783
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, abetts, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14784
Summary:
Current implementation of buildQuads assumes that corner shadow tiles
are always present:
const QRectF leftRect(
topLeftRect.bottomLeft(),
bottomLeftRect.topRight());
but that assumption is wrong. For example, if the default panel is on
the bottom screen edge, then the calendar popup won't have the
bottom-left shadow tile(at least on Wayland). Which means that the left
shadow tile won't be visible because
topLeftRect.left() == bottomLeftRect.right().
Corner rectangles only have to influence height of the left/right tile
and width of the top/bottom tile. Width of the left/right tile and
height of the top/bottom tile should not be controlled by corner tiles.
Overall, this is how shadow quads are computed:
* Compute the outer rectangle;
* Compute target rectangle for each corner tile. If some corner tile is
missing, move the target rectangle to the corresponding corner of the
inner shadow rect and set its width and height to 0. We need to do
that to prevent top/right/bottom/left tiles from spanning over
corners:
{F6190219, layout=center, size=full}
We would rather prefer something like this if the top-left tile is
missing:
{F6190233, layout=center, size=full}
* Fix overlaps between corner tiles;
* Compute target rectangles for top, right, bottom, and left tiles;
* Fix overlaps between left/right and top/bottom shadow tiles.
Test Plan:
* Ran tests;
* Resized Konsole to its minimimum size(on X11 and Wayland);
* Opened the calendar popup(on X11 and Wayland):
Before:
{F6190344, layout=center, size=full}
After:
{F6190346, layout=center, size=full}
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: abetts, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14783
Summary: At least one test requires the physical size to be set.
Test Plan:
Lock screen screen edges test is passing again. Without the change the corner
offset in the ScreenEdges class is not calculated correctly via the
physicalDpiX() and physicalDpiY() values of an auxilliary QWidget.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D15183
Summary:
With the new Output class we can set the gamma directly here. This is also
a stepping stone to adjust individual output gamma adjustment later on.
This means any future backend, which aims to support the color correction
frontend needs to use the Output class.
Test Plan: Night Color test still passes.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D11803
Summary:
Let VirtualOutput be a child class of the new generic class Output.
This allows code sharing and a very similar behavior of the Virtual backend
in comparision to the Drm backend.
Test Plan:
Autotests succesful with two exceptions: The decoration input test fails on
testDoubleTap, row topLeft. This is to be expected because now the
ScreenEdgeInputFilter captures the event at position (0,0) before the
DecorationEventFilter can capture it. The autotest was adapted to take this
special case into account.
Also the lockscreen test fails, because the virtual output is currently missing
the physical size yet.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D11789
Summary:
Lift high-level properties into new Screens child class for platform plugins
using the Output class.
Directly make DrmScreens a child class of OutputScreens.
Test Plan: Manually and auto tests with 94%.
Reviewers: #kwin
Differential Revision: https://phabricator.kde.org/D11782
Summary:
In order to separate high-level properties of individual outputs from
hardware-specific ones and access these, introduce a new generic class Output.
Also make the DrmOutput class directly a child class of this generic class.
The long-term goal is to get rid of the Screens global object on Wayland and
instead directly work with Output objects on compositing level.
This should enable us long-term to do direct scanout to hardware planes, what
I predict needs this generic output representation at one point.
Test Plan: Manually.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D11781
Summary:
Weston does something similar
https://cgit.freedesktop.org/wayland/weston/tree/libweston/compositor-fbdev.c#n315
...and it seems that the non-primary framebuffer devices start completely off. (the screen is off on my Displayport device, and the window for the second vga card in qemu is much smaller than the primary one, and all black for my qemu vm) .
In my testing, sending the ioctl FBIOPUT_VSCREENINFO with a *changed* &varinfo allows it to wake up, and turns on the screen.
doing FBIOGET_VSCREENINFO and then FBIOPUT_VSCREENINFO in my testing does not work.
I think really the values that end up getting changed are varinfo.transp.offset and varinfo.transp.length. at least on the qemu system, but in this patch I am aligning all of them for completeness, because the drivers might do it differently for qemu
Test Plan: This causes the window for /dev/fb1 (remote-viewer, and a qemu vm with two "VGA" (bochsdrm) cards) to resize from the smaller size when specifying it as the --fb-device on seat0, and kwin draws on the device.
Reviewers: #kwin, davidedmundson, graesslin
Reviewed By: #kwin, graesslin
Subscribers: zzag, davidedmundson, rkflx, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D9572
Summary:
The kwin code was written to treat scale as non integers, we just need
to switch to the relevant float version of methods.
Test Plan:
Used kscreen-doctor to change this
Konsole resized as appropriate
Plasmashell was all broken, but that's expected until QScreen::size is based on the
xdg-output virtual size
Reviewers: #kwin, mart, graesslin, romangg
Reviewed By: #kwin, mart, graesslin
Subscribers: romangg, zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13616
Summary:
To do so leaves a dangling pointer on our pageFlipHandler
BUG: 396272
Test Plan: Wobbled a window whilst plugging a monitor in and out
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14210
Summary:
We pass the buffer scale of the cursor through QImage::devicePixelRatio.
When copying the cursor with QPainter use Qt's in-built functionality to
handle resizing the cursor pixmap as necessary to match the screen.
As we're now resizing the cursor, the hotspot needs translating from
logical to device co-ordinates.
Test Plan: Used with associated patches
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13605
Test Plan:
Ran kwin_wayland --windowed --scale2
Hovered over deco. Got massive and detailed cursor
Hovered over a wayland client (Qt 5.11 not dev)
Got a massive, but slightly blocky cursor
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13642
Summary:
Workaround QtBug-68997
Deleting of a RenderControl/render controlled window triggers deletion
of other queued deleted items, putting KWin in a corrupt state. See Qt
bug report.
Deleting this queued means we know we don't have anything else going on
in the stack which should make this somewhat safe.
BUG: 395346
Test Plan:
Couldn't reproduce original crash. Based purely on the incomplete backtrace and code reading
Set an Aurorae theme. Closed some windows. Things still worked as before
Reviewers: #kwin, #plasma, mart
Reviewed By: #kwin, #plasma, mart
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13614