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
Summary: Inform user how the pointer constraint can be ended.
Reviewers: #plasma, #kwin
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3780
Summary:
Recently we noticed that there are multiple areas where KWin needs to
inform the user about how to operate. Examples are:
* Screenshot
* ColorPicker
* Pointer constraint enabled
* Pointer constraint about to be removed
* Kill Window
For Screenshot and ColorPicker we used an EffectFrame to render it. But
this is not an optimal solution as it's lacking many features we would
need. We cannot properly use it from within KWin core, we cannot
implement features like hide on mouse over, etc. etc.
This change introduces an OnScreenNotification which supports:
* showing an icon
* showing a message
* timeout
It is Qml styled, so that it can be easily adjusted. This is a big
improvement over the EffectFrame solution. The Qml file creates a Plasma
Dialog of type OSD. Thus KWin places it like the normal OSD windows and
also looks kind of similar. In the case of KWin the focus is more on the
message, than an icon, so the icon is placed left of the text.
While the OnScreenNotification is supposed to be used like a singleton,
it doesn't use the KWin singleton pattern. Instead a small wrapper
namespace OSD is introduced which provides a convenient API for KWin
internal areas to show/hide the notification. By not using the KWin
singleton pattern, the OnScreenNotification does not depend on any other
parts of KWin and can be easily unit-tested.
A few features are still missing and will be added in further commits:
* hide-out on mouse over
* optional skip close animation (needed for screenshot)
* X11 support (not that important as it's mostly for Wayland features)
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3723
Summary:
The position of an OSD is based on the size of the window. If the
size of the OSD changed, it would not be positioned correctly any more.
With this change the OSD window gets placed again if the size changes.
Thus it's also placed correctly even if the window changed it's size.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3720
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:
WaylandServer creates a socketpair for several Wayland connections. So
far this duplicated code quite a bit.
This change introduces one method to perform the socketpair and the
error checking plus creating the server side ClientConnection from the
pair.
Test Plan: Tests still pass
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3576
Summary:
No need to capture the variable as it's static. Also apparently wrong.
Used to get the following error message:
/home/apol/devel/frameworks/kwin/libinput/connection.cpp:103:56: error: 's_self' cannot be captured because it does not have automatic storage duration
connect(s_self, &Connection::deviceAdded, s_self, [s_self](Device* device) {
^
/home/apol/devel/frameworks/kwin/libinput/connection.cpp:45:25: note: 's_self' declared here
Connection *Connection::s_self = nullptr;
^
/home/apol/devel/frameworks/kwin/libinput/connection.cpp:106:58: error: 's_self' cannot be captured because it does not have automatic storage duration
connect(s_self, &Connection::deviceRemoved, s_self, [s_self](Device* device) {
^
/home/apol/devel/frameworks/kwin/libinput/connection.cpp:45:25: note: 's_self' declared here
Connection *Connection::s_self = nullptr;
^
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3703
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 is a preparation step for no longer creating a socket in the tests
and slightly simplifies the init test code.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3575
In the future the GHNS button might hide itself based on KIOSK restrictions.
Using the GHNS Button will ensure we don't need to manually do this here.
Differential Revision: https://phabricator.kde.org/D3647
Summary:
There are two types of constraints supported:
1. Pointer confinement
2. Pointer locking
In the case of confinement the pointer is confined to a given region of
the surface. This is comparable to general operation where the pointer
is confined to the screen region.
In the second case the pointer gets locked. That means it cannot move at
all. No further position updates are provided, only relative motion
events can go to the application. There is a hint about cursor position
update on unlock which is not yet implemented in KWayland::Server, thus
also not in this change.
The implementation in KWin grants the requests for pointer constraints
when the pointer enters the constrained region, either by pointer
movement or by e.g. stacking order changes. There is no confirmation
from user required to enter that mode. But we want to show an OSD when
the pointer gets constrained, this is not yet implemented, though.
Breaking an active constraint is relatively easy. E.g. changing the
stacking order will break the constraint if another surface is under the
cursor. Also (in case of confinement) moving the pointer to an
overlapping window breaks the confinement. But as soon as one moves the
pointer back to the window a constraint might get honoured again.
To properly break there is a dedicated event filter. It listens for a
long press of the Escape key. If hold for 3sec the pointer constraint is
broken and not activated again till the pointer got moved out of the
window. Afterward when moving in the pointer might activate again.
The escape filter ensures that the key press is forwarded to the
application if it's a short press or if another key gets pressed during
the three seconds. If the three seconds way fires, the later escape
release is not sent to the application.
This basic interaction is also ensured through an added auto test.
This change implements T4605.
Test Plan: Added auto test and nested KWin Wayland with D3488
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3506