Summary:
InputRedirection has a workaround to add a connect on a QAction which
is used for a global shortcut. This is specific to the X11 platform as
the xtime needs to be updated.
This change adds a new virtual method to the Platform and moves the
implementation into the X11 standalone platform. Thus it does no longer
gets called on Wayland.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D4168
Summary: This way they can be properly listed by Discover
Reviewers: graesslin, #plasma
Reviewed By: graesslin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3765
Summary: Enums taken from hardware/hwcomposer_defs.h header file
Test Plan: builds
Reviewers: #kwin, graesslin, mart
Reviewed By: mart
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3699
Summary:
HWcomposer version 1.4 introduced setPowerMode, which replaces the
blank(). This adds support for it. There are various code paths
possible,
- If KWin is built against hwcomposer 1.3 headers, then setPowerMode
code is not compiled in, and it will use blank to turn display off.
- If KWin is built against hwcomposer 1.4 headers, it will have
setPowerMode code path compiled in. It will be used only on devices with
1.4 and 1.5 version of hwcomposer.
This is slightly insane, because Android can report hwcomposer 1.5 even
when headers are of 1.4 version..
Test Plan: Tested this on Nexus 5X which reports 1.5 version of hwcomposer
Reviewers: graesslin, #plasma
Reviewed By: graesslin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3686
Summary:
This supports "grabbing" the pointer on right ctrl key just like on X11.
If the Wayland server supports pointer constraints protocol, the nested
Wayland compositor creates a confined pointer if the right ctrl key is
pressed.
On another right ctrl press the (active) constraint gets removed again.
To indicate the current state the window title gets updated. This also
implements window title support for the first time.
This change implement T4604.
Test Plan: Tested with a modified KWin with server-side pointer constraints support
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3488
Summary:
It's only needed by the GLX backend, so only find if we have GLX at all
and only link where needed. As it was handled incorrectly before, it's
now using proper ifdef.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3448
Summary:
Instead of having the egl extensions in the global kwinglutils lib it
becomes private to the AbstractEglBackend. Just like on glx the
glxextensions are moved into the platform.
The extensions are queried from initEglAPI, that is as early as possible
after initializing the EGLDisplay. This ensures that any implementing
subclass can access the extensions early enough.
As a note: the EglOnXBackend had a potentially wrong sequence for
initializing the buffer age extension. It is now moved to the correct
place where the result is needed for the first time.
From the global API eglExtensions are removed from hasGLExtension and
the eglExtensions function is dropped. As by that initEGL did not do
anything it is also dropped.
Test Plan:
Tested nested kwin on Wayland, still works, extensions shown
in debug console
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3396
Summary:
A new virtual method is added to Platform:
startInteractiveWindowSelection
The interactive window selection enters a mode where the user can select
a window through the pointer or keyboard device. The cursor is turned
into a crosshair cursor, unless another cursor name is provided (e.g.
pirate for kill window).
Once a window is selected the provided callback method is invoked with
the selected Toplevel as argument. In case the user cancelled the
selection a nullptr argument is passed in.
Currently it's only implemented by the X11 standalone platform using the
logic from KillWindow. Just instead of killing the window the callback
is invoked.
KillWindow loses the X11 implementation and interacts with the new
functionality in Platform by providing a lambda function for the
killing.
Test Plan: Killing of X11 windows is still possible
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3363
Summary:
And finally nothing inside libkwineffects, libkwinglutils,
libkwinxrenderutils and kwineffect and kwin core uses KWin::display.
We are finally XLib free!
This change drops KWin::display and removes the include to QX11Info from
kwinglobals.h. And the libraries no longer need to link X11Extras. Due
to that removal a few seeming unrelated changes are required to add the
include where needed and linkage to X11Extras.
The biggest change is to x11 platform plugin which still needs the
display and caches it in the Platform and passes it to various places in
a way that the code doesn't need to be adjusted.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3337
Summary:
KWin still resolves some OpenGL function pointers. For that it needs to
use either eglGetProcAddress or glxGetProcAddress. With other words the
method to resolve needs to know whether it is egl or glx and needs both
a dependency to egl and glx. Especially the dependency to glx is ugly as
that pulls in XLib into our library.
The way so far was to pass an enum value to the initGL method to know
whether it's EGL or GLX. With this change the enum value is removed and
replaced by a function pointer to resolve the methods.
This simplifies the resolve code and allows to completely remove the glx
variant we still had in the library. Thus kwinglutils library is now glx
and XLib free.
Test Plan: nested KWin with OpenGL/EGL still works
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3336
Summary:
This isn't used and if it was would give the wrong value.
Actual correct size can be determined via Screens object.
Test Plan:
Grepped it's not overriding anything
Compiles
Reviewers: #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3385
Summary:
No need to resolve glx methods through the shared lib. At the moment
this duplicates some code, but will be cleaned up with a follow up
change.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3335
Summary:
Glx extensions are only interesting to the glxbackend. Given that
querying can be moved there.
In order to simplify the extensions can be stored in the OpenGLBackend
which also provides the convenience check as before.
The egl platforms should also be adjusted to query in that way and
remove it from the kwinglutils.
There is still a usage of the glxextensions inside kwinglutils to
resolve one function. That should also be moved into the platform.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3332
Summary:
Glx version is only required once in the standalone x11 platform. No
need to have that in the shared kwinglutils library.
Removes one xlib usage from shared kwin.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3329
Summary:
to uniquely identify screens (in QScreen::name()) add the conenctor
name and id (such as HDMI-A-1) to the model identification
Test Plan: tested a full plasma session
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: graesslin, plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3341
Summary:
Output scaling can't ever work on a single buffer; especially if they're
different scales and overlapping.
This ports the virtual backend to perScreenRendering so that I can use
it for
tests.
ctest fails here, but it fails on the tests that it failed on before..
Reviewers: #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3306
Summary:
Some platforms support to hide and show the cursor. This will be needed
by e.g. the zoom effect which currently only provides this functionality
on X11.
This change introduces a new method in the Platform to hide and show the
cursor. The methods need to be called balanced and the implementation
takes care of only showing again if all hide got matched by a show.
The actual hiding and showing is performed in the platform plugins. So
far the DRM and X11/Standalone platforms implement the required
functionality, though other platforms probably could implement as well.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3119
On build.kde.org the autotests started to crash on tear down due to a
newer Wayland library. The reason is that the KWayland::Client::Outputs
are destroyed after the internal Wayland connection is destroyed.
This change parents the created Outputs to the Registry like the other
objects. To ensure that the KWin::QPA::Screen doesn't have a problem
with that, it is changed to a QPointer - nullptr checks are already in
place.
Hopefully that will fix the crashes on build.kde.org, but there is a
chance that more errors are hidden.
Summary:
With nouveau driver it can happen that KWin gets frozen when first trying
to render with OpenGL. This results in a freeze of the complete desktop
as the compositor is non functional.
Our OpenGL breakage detection is only able to detect crashes, but not
freezes. This change improves it by also added a freeze protection.
In the PreInit stage a thread is started with a QTimer of 15 sec. If the
timer fires, qFatal is triggered to terminate KWin. This can only happen
if the creation of the OpenGL compositor takes longer than said 15 sec.
In the PostInit stage the timer gets deleted and the thread stopeed
again.
Thus if a freeze is detected the OpenGL unsafe protection is written into
the config. KWin aborts and gets restarted by DrKonqui. The new KWin
instance will no longer try to activate the freezing OpenGL as the
protection is set.
If KWin doesn't freeze the protection is removed from the config as
we are used to.
Check for freezes for the first n frames, not just the first
This patch changes the freeze detection code to detect freezes in the
first 30 frames (by default, users can change that with the
KWIN_MAX_FRAMES_TESTED environment variable). This detects
successfully the freezes associated to nouveau drivers
in https://bugzilla.suse.com/show_bug.cgi?id=1005323
Reviewers: davidedmundson, #plasma, #kwin, graesslin
Reviewed By: #plasma, #kwin, graesslin
Subscribers: luebking, graesslin, kwin, plasma-devel, davidedmundson
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3132
Summary:
There are several effects (screenshot, zoom) which need access to the
cursor image and cursor hotspot. So far these effects used X11
unconditionally to get the cursor which obviously does not work on
Wayland.
This change adds a new class PlatformCursorImage to kwinglobals which
wraps what a cursor is (image and hotspot) and adds a new virtual method
to Platform to provide such a PlatformCursorImage. By default it's the
cursor image the Platform tracks. On X11/standalone platform this new
virtual method is overriden and provides a PlatformCursorImage from X11
using the code previously used in screenshot effect.
Screenshot effect and zoom are adjusted to use the new API instead of
X11.
Test Plan:
Zoom effect tested on Wayland, now gets the proper cursor icon.
X11 functionality not yet tested.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3093
Summary:
The modifier-only-shortcuts break as soon as KWin grabs the keyboard
(e.g. alt+tab, present windows, etc.). The investigation shows that in
that case KWin does not get any raw key events any more and thus gets
confused about the state of the hold modifiers. E.g. alt+tab has the
alt key pressed, but we miss the release as the keyboard is grabbed.
This change addresses the problem by installing an additional event
filter for key press and release event which only filters for key events
on the root window. That way we can be sure that it only operates when
KWin grabbed the keyboard on the root window.
Note: the problem only exists when grabbing on the root window. If the
grab is on another window (e.g. moving a window) we still do get all
events.
The problem also seems to not happen if another application grabbed
keys on the root window. E.g. for key combinations grabbed by
kglobalaccel the correct sequence of key press/release as raw events
are reported. Also while the screen is locked the evemts are reported
and kscreenlocker grabs the keyboard on the root window.
Test Plan:
Used Alt+Tab and Present Windows and tried to activate launcher
afterwards.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D2980