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
In case we need to set the SwitcherItem model in
`TabBoxHandlerPrivate::show()`, remember the current index row,
otherwise it gets reset to the first item.
Reviewers: #kwin, graesslin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D4162
BUG: 333511
Summary:
We need this to use the new OnScreenNotification in the screenshot
effect.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D4089
Summary:
We have a comma separated list:
"".split(',') returns ""
JS decides that's worth itterating over, and we implicitly cast "" to a
number which means we register on screen edge 0 (the top).
We can't use typeof or isFinite because valid entries are still strings
at this point.
Test Plan:
Ran with default config, no longer registered on top edge
Set an edge properly in the KCM. Still worked.
Reviewers: #plasma, mart
Reviewed By: mart
Subscribers: mart, plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D4113
Create auxiliary class for Connection class in order to connect to DBus
from main thread.
Reviewers: #kwin, davidedmundson, graesslin
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D4081
This brings back global menu support in KWin.
The DBusMenu infrastructure is different that we just read the DBus service name and
menu object path from the windows rather than passing around window IDs on DBus which
won't work on Wayland.
Differential Revision: https://phabricator.kde.org/D3089
On registering object use the object in the right thread.
Otherwise there are multiple errors.
BUG: 374554
Differential Revision: https://phabricator.kde.org/D4027
Summary:
This change triggers a fade out animation when the mouse is moved over
the OnScreenNotification, thus revealing the windows underneath. When
moving the mouse out of the OnScreenNotification it gets faded in again.
This is useful for various cases, e.g. when picking a color and the pixel
one wants to pick is underneath the notification, or when trying to kill
a window...
Test Plan: Manual testing in nested setup
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3964
Summary:
The OnScreenNotification gets moved during its placement. This update
of the geometry did not get synced to the QWindow's geometry as it
should.
The reason for this is the rather special implementation of
AbstractClient::move. This just modifies the geom variable and does not
call into setGeometry at all. Instead a virtual doMove method is invoked
to inform the platform specific client implementation about the move of
the window. For a "normal" ShellClient that is fine - there is nothing
to do.
This change adds an implementation of doMove in ShellClient to sync the
geometry to the internal window. This is not yet enough to fix the
geometry of the OnScreenNotification. It gets placed with a
GeometryUpdatesBlocker in place causing the doMove never to be called.
Instead setGeometry is invoked again when the geometry updates get
unblocked. So far ShellClient did not do anything in this case. This
change ensures that at least the doSetGeometry method is performed again.
Test Plan: Added test case and manual testing of OnScreenNotification
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3963
Summary:
This change adds support for opacity on a KWin internal QWindow.
Calling QWindow::setOpacity syncs the value to the ShellClient
representation of the QWindow.
This is needed for fading out the OnScreenNotification on mouse
over.
Test Plan: Added auto test and manual test
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3928
Summary:
An improvement from the introduction of InputEventSpy. Instead of
specifying a std::function as argument, we let the compiler decide what
is the best argument.
Reviewers: #kwin, #plasma, mart
Reviewed By: mart
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3877
Summary:
Adjusting to a difference from introducing the InputEventSpy. A filter
may only be installed once. Thus removeOne is totally sufficient.
Added a Q_ASSERT to ensure that it is not installed when installing.
Reviewers: #kwin, #plasma, mart
Reviewed By: mart
Subscribers: mart, plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3878
Summary:
As explained in 84e3308149
the DebugConsole should use an InputEventSpy instead of an InputEventFilter.
Reviewers: kwin, graesslin
Reviewed By: graesslin
Subscribers: graesslin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3879
Summary:
This adds the nativeButton to the MouseEvent allowing the InputEventSpy
to use this information. Also the InputEventFilter can be adjusted to
make use of it.
Reviewers: #kwin
Subscribers: graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3875
Summary:
So far KWin's input event processing is mostly based on
InputEventFilters. A filter can - as the name suggest - filter out an
input event from further processing. Our code shows that this is not
sufficient for all input event processing.
We have several areas inside KWin where we need to have access to all
input events, where the processing needs to happen on all events and
filtering is not allowed. This results in sub-optimal code which has
classes which know too much and do too much.
Examples:
* key-repeat handling done in KeyboardInputRedirection
* Layout change OSD in Xkb
* modifier only shortcuts in Xkb
* emitting signals for Cursor class in KeyboardInputRedirection
Also there are misuses of the InputEventFilters and internal API
* DebugConsole keyboard state (uses wrong information)
* DebugConsole input events tab (uses Filter, should be a spy)
This change introduces the API needed to fix these problems. It
introduces an InputEventSpy which is modelled after the InputEventFilter
with the difference that it has only void messages and uses the KWin
introduced event classes.
The spies are always processed prior to the filters, thus we know it can
have all events.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3863
Summary:
Prior to this change various event filters performed deep calls into
Xkb class to figure out the modifiers relevant for global shortcuts (aka
consumed modifiers). This shows that this is a general useful
information which should be available to all input event filters
directly.
Thus it's now added to the input events and exposed directly in
InputRedirection so that the calls into Xkb are no longer needed.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3810
Summary:
This change removes the workaround added with
421824b654.
Xkbcommon 0.7 introduces the needed API to make this work without a
workaround.
Test Plan: Test case still passes
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3809
Summary:
For every input event we have similar code. We go through all
InputFilters, invoke a method with some arguments and check whether
the filter returns true.
Instead of duplicating that logic everywhere, there is now one method
in InputRedirection which takes a std::function to call on the input
filters. The std::function is supposed to be generated with a std::bind
on the InputFilter::method with all the required arguments.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3806
Summary:
6383f83047 introduced a regression hitting
an assert on X11 when an osd window is added.
This change tries to address this by adding a GeometryUpdateBlocker
around the change. The hit assertion is:
pendingGeometryUpdate() == PendingGeometryNone ||
areGeometryUpdatesBlocked()
By using a GeometryUpdateBlocker the second condition becomes true
and we no longer hit the condition.
BUG: 374038
Test Plan:
Manual tested both on X11 and Wayland, Wayland autotest
still passes
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3808
Summary:
This adds support for the new on-screen-message support to the
kwineffects API and makes use of it in the colorpicker effect.
Not yet added to screenshot effect as for that we need support for
skip close animation on the on-screen-message window.
Reviewers: #plasma, #kwin
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3803
XWayland needs to create an eglDisplay for platform DRM. Depending on
the mesa version eglInitialize expects that the passed native display
is a Wayland display and crashes. This prevents KWin to startup.
This patch sets EGL_PLATFORM for Xwayland. This is actually not KWin's
job, but if it otherwise crashes it's better than nothing.
As Xwayland only supports DRM, it's fine to use this.
Summary:
When switching virtual desktops using shortcuts, the behavior is to
switch to a virtual desktop in the opposite direction if the current
one is on the edges of the layout. For example, in a one row layout with
4 virtual desktops, "Switch One Desktop to the Left" while in virtual
desktop # 1 will send the user to virtual desktop # 4. Likewise, in a 3
rows layout with 9 virtual desktops, "Switch One Desktop Down" while in
virtual desktop # 8 will lead the user to desktop # 2.
This patch uses the same behavior whilst changing windows using
"Switch to Window Above|Below|to the Right|to the Left".
For example, in a 3 display set-up (my set-up), the user would go from an
application in the rightmost position to an application in the leftmost
position using just one key combination: "Switch to Window to the Right".
Currently, the shortcuts are no-op in these cases (ie, trying "Switch to
Window to the Left" from the leftmost window has no outcome, which is
mostly accurate with the shortcut semantics but totally useless in behavior).
Reviewers: #vdg, #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: luebking, subdiff, colomar, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3602