Summary:
Original code (copied from Aurorae) created a QMouseEvent for
QHoverEvents. Whilst it apparently worked, it's technically wrong.
It's safer to have an explicit type check given we come from a downcast
QEvent* and then build the correct event.
Test Plan: Hovered some icons
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D25207
Summary:
Removes a tonne of complex code, means any future improvements to our
QtQuick integration only need to be in one place.
QML logic remains in Aurorae as it does complex things. All other
aurorae specialties remain.
Only functional difference is that we now use a shared GL context
between window frames, which Plasma::FrameSVG will make use of.
Test Plan:
kcmshell5 kwindecoration
ran some aurorrae themes on my kwin. Look the same as master
Reviewers: #kwin, mart
Reviewed By: mart
Subscribers: mart, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D25206
Summary:
Compositing in X11 was done time shifted, meaning that we paint first, then
wait one vblank interval length and present on prepareRenderingFrame the
previous paint result. This is supposed to make sure we don't miss the vblank
and in case of block till retrace be able to continue issuing commands and
only shortly before next vblank present.
This is counter-intuitiv, not how we do it on Wayland or even on MESA with X.
The reason seems to be that the GLX backend was in the beginning written
against Nvidia proprietary driver which needed this but nowadays even this
driver defaults to non-blocking behavior on buffer swap.
Therefore remove this legacy anomaly fully and directly present after paint.
We then wait one refresh cycle and in the future can optimize this by delaying
the paint and present till shortly before vsync.
Test Plan: kwin_x11 tested on i915 and Nvidia proprietary driver.
Reviewers: #kwin
Subscribers: zzag, alexeymin, kwin
Tags: #kwin
Maniphest Tasks: T11071
Differential Revision: https://phabricator.kde.org/D23514
Summary:
Selecting not to vsync does not make sense for an X11 compositor. In the end
we want clients to be able to present async if they want to but the compositor
is supposed to send swaps with vsync to the XServer in order to not generate
tearing artifacts.
There was also a detection logic which did some questionable things in case
vsync was not available. I don't think this is necessary at all since we can
just always run a timer to present with or without vsync.
Test Plan: kwin_x11 tested on i915.
Reviewers: #kwin, zzag
Subscribers: zzag, kwin
Tags: #kwin
Maniphest Tasks: T11071
Differential Revision: https://phabricator.kde.org/D23511
Summary:
Current hardware should suppport either GLX_EXT_swap_control or
GLX_MESA_swap_control. To simplify code remove the usage of SGI extensions.
Test Plan: kwin_x11 tested on i915.
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: davidedmundson, kwin
Tags: #kwin
Maniphest Tasks: T11071
Differential Revision: https://phabricator.kde.org/D23510
Summary:
It is not clear what the advantage of triple buffering is for KWin. An X11
compositor is meant to swap buffers once every monitor cycle. For that triple
buffering is not necessary.
The functionality is not maintained, does not reliably work as displayed by
the existence of an environment variable to force some behavior, pollutes
our code and every compositing-related problem that might be mitigated with
triple buffering should find a simpler and more fitting solution with other
means.
There is one caveat which is if we shall block for retrace. We set it
currently according to the result of the swap profiler and in the most common
case with double buffering it is set to true. But on Nvidia systems this might
be actual the wrong behavior. Instead of trying to work around this ignore
the issue for now and move the overall architecture to something less complex
by presenting after paint how we do it in the Wayland DRM backend and with
double buffering on GLX (although this is at the moment also borken because
we actually present then twice).
Test Plan: kwin_x11 tested on i915.
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: zzag, fredrik, kwin
Tags: #kwin
Maniphest Tasks: T11071
Differential Revision: https://phabricator.kde.org/D23504
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:
We support the stable xdg-shell protocol nowadays. So use this one instead of
version 6 unstable.
Test Plan:
Runs with other recent patches in KWin nested. In Weston nested session still
not yet working.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D25129
Summary:
Per protocol a zero-size can be sent indicating that the client should resize
its surface to its liking. For now change the code such that it at least sends
the ack-configure back and leaves the current size untouched.
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D25128
Summary:
After setting the xdg-surface role an initial commit must be sent per
protocol description.
This fixes Wayland nested session after commit 84de8d135d made this
requirement explicit.
Test Plan: Launched Wayland nested session.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D25127
Summary:
When a plasma session quits, the order of plasmashell and clients quitting is undetermined.
This looks bad as our desktop background disappears quite early. Rather than changing the real order, we can have kwin reference the last pixmap of any desktop and hold on to it.
Lasting till the compositor quits means it stays on the X frontbuffer till X quits and the experience is seamless.
Test Plan: Logged out (with relevant other ksmserver patches)
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24864
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:
Won't make things go much faster since everything that was
being passed by value is refcounted but still const & is a bit faster
than refcounting
For shared pointers instead of adding const & we move them into the
destination variable saving some cpu usage but at the same time making
clear the pointer is being stored by not being const &
Reviewers: zzag
Reviewed By: zzag
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D25022
Summary:
This change adds detection support for virgl (Mesa gallium virtio guest driver).
Results in proper detection in supportInformation and debug console.
Test Plan: Modified test passes, run KWin_Wayland in kvm with virgl and verified supportInformation
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D25056
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:
Otherwise the combobox containing the switching effects escapes from the page. Same fix
as D24885.
BUG: 403151
FIXED-IN: 5.17.2
Test Plan:
Checkbox text now elides when the window is made very narrow, and combobox no longer gets
cut off.
Reviewers: #kwin, zzag, davidedmundson
Reviewed By: #kwin, zzag, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24988
Summary: sizeForClientSize checks the minimum and the maximum size.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24473
Summary:
This code has been commented for more than a decade. Given that no any
useful comment is provided along the commented code, it's difficult to
say what exactly we need to fix. From the other side, the commented
code does nothing.
Reviewers: #kwin, romangg
Reviewed By: #kwin, romangg
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24472
Summary:
If no conversion functions are provided for a QObject-subclass, then
QScriptEngine will use QScriptEngine::newQObject() method without any
special options to convert an instance of that QObject-subclass to a
QScriptValue. However, it's very important that every client object is
wrapped with PreferExistingWrapperObject option. We need that option
because a script may set a property on a client object and that property
must remain until it's deleted by the script.
BUG: 413044
FIXED-IN: 5.17.2
Test Plan: New test.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24944
Summary:
With recent Mesa updates (19.2.1), MESA_EGL_NO_X11_HEADERS doesn't have
any effect. So, let's include fixx11h.h instead.
Test Plan: I am able to build kwin once again.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24840
Summary:
when unmap notify is followed by a map, the old Unmanaged will get released and never be managed again. by checking if there is a pending release operation, we can safely re-manage the window again.
BUG: 413350
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: zzag, kwin, scao
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24878
Otherwise the layout explodes.
Unfortunately it seems Layouts don't shrink the items within even if there's not enough room at all, so I need this fillWidth + maximumWidth workaround.
Differential Revision: https://phabricator.kde.org/D24885