Summary:
So far KWin didn't send axis_source, axis_discrete, and axis_stop. Even
though most of those events are optional, clients need them to work as
expected. For example, one needs axis_source and axis_stop to implement
kinetic scrolling; Xwayland needs axis_discrete to prevent multiple
scroll events when the compositor sends axis deltas greater than 10, etc.
BUG: 404152
FIXED-IN: 5.17.0
Test Plan:
* Content of a webpage in Firefox is moved by one line per each mouse
wheel "click";
* Scrolled gedit using 2 fingers on GNOME Shell, sway, and KDE Plasma;
in all three cases wayland debug looked the same (except diagonal scroll
motions).
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19000
Summary:
The name of Workspace::getMovingClient() method implies that the
returned value is a client that is currently being moved around
by the user, but this is of course incorrect.
Reviewers: #kwin, apol
Reviewed By: apol
Subscribers: apol, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D20663
Summary:
Currently, when resizing a window the cursor doesn't match the resize
direction. The reason for that is the move-resize cursor is hardcoded.
To fix that, CursorImage::updateMoveResize has to use AbstractClient::cursor.
Also, because the move-resize cursor is updated after calling startMoveResize,
we have to connect to AbstractClient::moveResizeCursorChanged.
BUG: 370339
FIXED-IN: 5.15
Reviewers: #kwin, davidedmundson, broulik, romangg, graesslin
Reviewed By: #kwin, graesslin
Subscribers: davidedmundson, romangg, graesslin, kwin
Tags: #kwin
Maniphest Tasks: T5714
Differential Revision: https://phabricator.kde.org/D3202
Summary:
This patch aims at improving the Toplevel, internal window and decoration
focus tracking.
In detail the goals are:
* Clean tracking of beneath and focus Toplevel as well as decoration and
internal windows. Splitting this up in well defined sub routines.
* Minimal find Toplevel operations on window stack.
* Reduce code duplication in pointer and touch child classes.
* Reuse tracking in drag operations.
* Allow direct usage of Wayland input interfaces for decoration and internal
windows in the future.
* Update touch focus on external events like VD switches correctly.
Test Plan: Manually and existing autotests.
Reviewers: #kwin
Subscribers: kwin, zzag
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D15595
Summary:
Some members were declared protected. Better style is to have them private
with public or protected getters and setters.
This also removes the unnecessary m_input variable.
Test Plan: Builds and runs.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D15519
Summary:
With 2694839099, 0bd5eff862 and f0ba436c72 it is now possible to
unconstrain a pointer by killing the client or deactivating the window, for
example by switching the window via the TabBox.
A user should always be able to do it therefore without needing to explicitly
break the pointer constrain as in the past with the Esc key.
Therefore remove the functionality and also remove the OSD announcing it,
which was often shown at the wrong time.
Test Plan: Manually and auto test adapted.
Reviewers: #kwin, #vdg, hein
Reviewed By: hein
Subscribers: ngraham, hein, kwin
Tags: #kwin
Maniphest Tasks: T8923
Differential Revision: https://phabricator.kde.org/D15234
Summary:
* effects.h includes client.h and forward declares Client, both at the
same time. Thus, delete the include;
* the blur effect includes effects.h. That, most likely, is a leftover
after 3f5bf65a9e.
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D15191
Summary:
Listen for cursor position hint changes and set cursor position to the hint
on unlock if a valid position hint was set.
Test Plan: With pointer constraints test app.
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: graesslin, kwin
Tags: #kwin
Maniphest Tasks: T4693
Differential Revision: https://phabricator.kde.org/D14176
Summary:
Pointer constraints should become disabled when the TabBox is invoked. Since
the current client stays activated while TabBox is enabled and currently can
not be deactivated with the risk of regression as discussed in D13758, disable
all pointer constraining explicitly and enable it again when the TabBox is
closed.
Test Plan: Manually in Wayland session.
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: kwin
Tags: #kwin
Maniphest Tasks: T8923
Differential Revision: https://phabricator.kde.org/D14142
Summary:
If the new pointer position is "off screen", PointerInputRedirection
just ignores that new position. So, pointer remains on its previous
position. In some particular cases, like reaching default panel, it
degrades desktop experience because one have to slowly move pointer in
order to reach what he/she wants.
This change addresses that problem by confining the new pointer position
to screen geometry.
BUG: 374867
FIXED-IN: 5.13.4
Test Plan: Ran tests
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14036
Summary:
This patch changes KWin's pointer constraining behavior by only allowing
constraints if the surface has keyboard focus. In case the client activation
state changes, it rechecks it.
Test Plan:
Manually with the pointer constraints test application and opening the
launcher by pressing meta. Also amended autotest.
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: graesslin, davidedmundson, kwin
Tags: #kwin
Maniphest Tasks: T8923
Differential Revision: https://phabricator.kde.org/D13492
Test Plan:
Hovered over decoration
Looked super crystal clear
Same physical size as when I hover over window contents (which had a buffer scale of 1)
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13608
Summary:
It will then be renderered appropriately when painting to the output
buffer.
Test Plan: Updated unit test, plus used with other relevant patches
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13606
Summary:
A client might delete its pointer lock/confinement object. This is supposed to
directly remove the pointer lock/confinement in KWin, but did not explicitly
until now.
BUG: 388885
Test Plan:
Tested manually with Neverball, Nexuiz and the new pointer constraints test
application. The pointer constraints autotest is also appended.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Maniphest Tasks: T8923
Differential Revision: https://phabricator.kde.org/D13466
Summary:
Instead of seeing the cursor <--> on the left edge you now see an icon
that looks like |<- .
This brings kwin decorations in line with GTK CSD icons.
In theory this is also useful to tell which window will resize in the
case of side-by-side windows (regardless of whether borders are on or
not). In practice with the adwaita icon theme I tested with it's not
very intuitive to realise which is which till you learn the icon.
Change is more involved than it should be as Qt::CursorShape doesn't
have these entries, and I don't want to shadow that enum internally or
have
to change kwin effect code.
Specifics depend on cursor icon theme if they are not present it will
fallback to the <--> icon. (Breeze does not have them currently)
Test Plan:
Resized some windows (on X and on Wayland)
Correct icon appeared on Adwaita
Existing icon appeared on Breeze
Reviewers: #plasma
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13396
Summary:
From Wayland documentation:
"When a seat's focus enters a surface, the pointer image is undefined and
a client should respond to this event by setting an appropriate pointer
image with the set_cursor request."
KWin's interpretation so far for the undefined pointer image was to
remove the pointer image when entering a surface waiting for the client
to set a cursor image. This can result in a short flicker as there might
be a frame without a cursor image.
This patch changes the behavior by keeping the previous image till the
application set a new one. This brings some advantages:
* if the application is not responding a cursor is still shown
* if the same cursor is used as in the previous window we don't have a
flicker
CCBUG: 393639
Test Plan: I cannot see the flicker, so only tested with the adjusted tests
Reviewers: #kwin, #plasma
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D12631
Summary: There are two cursor caches: m_cursors and m_cursorsByName. The second doesn't ever seem to be cleared.
Reviewers: #kwin, davidedmundson, graesslin
Reviewed By: #kwin, graesslin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D12542
Summary:
When clicking the maximize button without moving the mouse, the maximize
button stayed in hover state till the mouse moved. The reason for this
is that the PointerInputRedirection does not perform an update on the
geometry change of a window.
BUG: 385140
FIXED-IN: 5.11
Test Plan: Manual testing
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8016
Summary:
This fixes the following problem:
1. Have two windows maximized
2. Click minimize button on first window
3. Click minimize button on second window
What happened:
Second click was ignored as the pointer was not updated.
BUG: 378704
FIXED-IN: 5.11
Test Plan:
Nested KWin/Wayland, added two maximized windows, minimized
both without moving the mouse
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8145
It was already partially using the x11Connection and partially the global
connection. In order to prepare for removal of the global connection and
rootWindow, it is better to use only the newer variant through kwinApp.
Summary:
During pointer motion we already had the condition that an update of
focused pointer surface can only happen when no button is pressed. But
there are more conditions where we try to update the focused pointer even
if a button is pressed. E.g. if the stacking order changes.
This happens when trying to move one of Qt's dock widgets:
1. Press inside a dock widget
2. Qt opens another window, which is underneath the cursor
3. KWin sends pointer leave to parent window
4. dock widget movement breaks
This change ensures that also this sequence works as expected and the
pointer gets only updated when there are no buttons pressed, no matter
from where we go into the update code path.
BUG: 372876
Test Plan: Dock widgets in Dolphin can be moved now.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D5461
Summary:
So far KWin did not properly handle popup windows. That is when a popup
surface got created and a click outside the surface happened KWin did not
send out the popupDone Wayland event.
This change makes KWin aware of whether a surface is a popup and tracks
through a new PopupInputFilter whether there are popup windows. In case
there are popups the new filter waits for mouse press events and cancels
the popups if the press does not happen on any surface belonging to the
same client. To quote the relevant section of the Wayland documentation:
The popup grab continues until the window is destroyed or a mouse
button is pressed in any other client's window. A click in any of the
client's surfaces is reported as normal, however, clicks in other
clients' surfaces will be discarded and trigger the callback.
So far the support is still incomplete. Not yet implemented are:
* support xdg_shell popup windows
* verifying whether the popup is allowed to be a popup
* cancel the popup on more global interactions like screen lock or
kwin effect
BUG: 366609
FIXED-IN: 5.10
Test Plan: Auto test and manual testing with QtWayland client
Reviewers: #plasma, #kwin
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D5177
Summary:
Consider the following situation: we have three InputEventFilter linked
in the sequence A - B - C.
The input filters are processing pointer motion events. The expected
behavior is that the new motion is processed in the sequence
A -> B -> C
So far this did not work correctly if the pointer gets warped during the
processing. If e.g. filter B warps the pointer we get a motion sequence:
A (1) -> B (1) -> A (2) -> B (2) -> C (2) -> C (1)
The filters following the one warping the pointer get first the newer
than the older position. This is obviously wrong. Unfortunately it is not
just a theoretical condition, but a condition happening when interacting
with the screenedges, which warp the pointer.
This change introduces a PositionUpdateBlocker in
PointerInputRedirection::processMotion to ensure that a processMotion
call finishes prior to the next update. If the PositionUpdateBlocker is
blocked the new position gets scheduled and processed once the
PositionUpdateBlocker gets destroyed.
With this we get the expected sequence for B warping pointer:
A (1) -> B (1) -> C (1) -> A (2) -> B (2) -> C (2)
This should hopefully improve the interaction with screen edges on
Wayland.
CCBUG: 374867
Test Plan:
Added an auto test demonstrating the issue of incorrect
ordering caused by screenedges. Prior to the change the test is failing.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D5182
Summary:
The functionality regarding triggering modifier only shortcuts is moved
out of Xkb - where it doesn't belong to - and is turned into an input
event spy listening for the changes it is interested in. Previously
the state got queried by asking e.g. for the pressed buttons, now it's
tracked directly.
The X11 side needs a larger change due to that as now pushing the events
into Xkb does not trigger modifier only shortcuts any more. Instead the
"normal" way through the platform API needs to be used which triggers the
processing of filters and spies.
The problem here is that our redirections only process events if they are
inited and that only happens on Wayland. We cannot call init on them as
that would create all the Wayland filters and spies and processing would
probably break. As an intermediate solution the spies are now processed
and there we know that it won't matter. A future solution would be to
remove the init checks completely and just send through both filters and
spies and ensure that on X11 only the supported ones are loaded.
Closes T5220
Test Plan: Tested on Wayland and X11
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Maniphest Tasks: T5220
Differential Revision: https://phabricator.kde.org/D4578
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:
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: 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:
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
Summary:
The interactive window selection is implemented in InputRedirection
through a dedicated InputEventFilter. The InputEventFilter so far takes
care of pointer input and keyboard input. In addition it ensures that
keyboard and pointer focus is reset on start and on end.
With this change KillWindow now also works on Wayland, but only for X11
windows, as the Wayland variant is not yet implemented.
Test Plan: Tested in nested setup, auto-tests still needed
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3365
Summary:
This change implements forwarding the pointer gestures to the new API in
SeatInterface.
While screen is locked no gestures are forwarded to the server. Also
locking the screen cancels any active gesture. Similar if areas inside
KWin would start to intercept the gestures, they need to be cancelled on
the Wayland SeatInterface.
Test Plan: Not yet
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3174
Summary:
When triggering a move resize all following pointer events are grabbed
by KWin itself. Thus the correct behavior is to informe the client about
it and send a pointer leave.
This ensures that after the move resize ended the pointer gets a new
enter. By sending anew pointer enter the position gets updated to the
new position which so far did not happen and the client generated events
on the wrong position.
BUG: 371573
FIXED-IN: 5.8.3
Reviewers: #kwin, #plasma_on_wayland, broulik
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3154
Summary:
If KWin interacts with Libinput the RelativePointerManager interface
gets created on the Wayland server. The ForwardInputEventFilter does
forward the relative motion events in addition to the normal motion
events.
In order to properly support the relative motion events as they are
expected by the Wayland protocol the handling of pointer motion events
got slightly adjusted:
* Libinput Pointer event extended by the additional data points
* Libinput Pointer event carries the delta as a QSizeF instead of
QPointF
* PointerInputRedirection adjusted to take a pointer motion event with
more arguments
* Custom QMouseEvent subclass adjusted to carry the additional members
The DebugConsole is adjusted to show the relative motion events in
addition to the global position.
Test Plan:
Verified the manager object is created and verified the
events in DebugConsole. Unfortunately not aware of any test application.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2979
Summary:
The raw pointer button events intercepted in the XInput2 input filter
get sent through the Platform to the PointerInputRedirection. This
makes the PointerInputRedirection track the pointer button state and
emit the signals for button changed and axis changed.
These signals are used by the modifier-only shortcut detection to
determine whether the shortcut should trigger.
On X11 the "normal" input handling doesn't use the InputRedirection
and the emitted signals are not consumed by anything else. As
PointerInputRedirection is not inited the events are not forwarded
to the input filter, thus won't be processed by other parts and
won't interfere with the normal event processing on X11.
Given that it also doesn't matter that the input filter does not
apply the left-handed setting. The internal tracking will have a
wrong mouse button, but nothing is going to do decisions based on
the value of the pressed mouse button. For the moment all we are
interested in is that a button is pressed.
Test Plan:
Pressed meta, clicked, scrolled, released meta: launcher
did not open. Pressed meta, released meta: launcher opened
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D2506
BUG: 367730
Summary:
For Xwayland windows we observed that passing pointer focus to another
window does not trigger proper leave events on X. Which results in e.g.
tooltip windows to show after the pointer moved to a completely
different position on a completely different surface.
This is a bug in Xwayland which will be fixed in 1.19 (already fixed in
master). Given that there is a runtime version check. Although it's fixed
in Xwayland master it's worth to carry a workaround.
To circumvent this problem KWin warps the xcb pointer to 0/0 whever an
X window loses pointer focus. That way the X window gets a proper leave
through the X protocol.
This created a problem though: when giving focus back to the X window it
started to warp the pointer for maximized windows as KWin got pointer
motion events through the X11 event filter for positions on the window
decoration. These are passed into the screen edge filter which pushes
the pointer back and warps our Wayland pointer. To solve this problem
KWin no longer performs any actions for pointer motion in the X11 event
filter if not on X11. The event filter needs to be reworked and most of
it should be moved into the Platform API, if possible.
Test Plan:
Reproduced situations where one could see that pointer updates
don't trigger leave. E.g. going from a highlighted window to the decoration.
Reviewers: #kwin, #plasma_on_wayland, bshah
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2531
Summary:
With this change KWin can create window decorations for internal windows.
Thus it's also possible to move internal windows and resize them which is
especially important for the debug console.
Reviewers: #kwin, #plasma_on_wayland, sebas
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2371
Summary:
Gesture events are swipe or pinch events on a touch pad.
This change implements basic support by:
* wrapping them in LibInput::Event
* processing them in LibInput::Connection and emitting
dedicated signals
* Forwarding them in InputRedirection to PointerInputRedirection
* Support them in the internal input event filter
* Printing debug information in DebugConsole
Further handling is not yet done. In future the following should be
implemented:
* activating e.g. zoom and present windows on pinch/swipe gesture
* forwarding non global gestures to KWayland
Note that forwarding to KWayland is not yet useful as QtWayland does
not yet have support for the unstable protocol. No Qt application could
make use of it yet. So for the moment just global gestures is the best
we can get.
Test Plan: Looked at output of DebugConsole when triggering gestures
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2359
So far KWin's pointer surface enter handling was:
1. update fouced surface
2. update the global position
On client side this resulted in:
1. Enter with incorrect coordinates
2. move event to correct coordinate
With QtWayland this results in the case of multiple surfaces in one
application that Qt doesn't properly process the enter event and the
Window never getting pointer focus and not reacting on any pointer
input events.
The root problem is that the KWayland server API is not ideal for
supporting this situation. There is an API call for setting the global
position (which causes a pointer motion for the focused surface) and
an API call to update the focused surface. But a combination for both
is (still) missing.
This change addresses the problem by first unsetting the entered surface,
then updating the global position and afterwards setting the new surface.
Thus the position is correct. While this needs to be made better in
KWayland, this is an urgency bug fix to get the behavior correct and thus
first working around the API deficit and not first extending in KWayland.
Reviewed-By: bshah
Summary:
The signals emitted by LibInput::Connection carry the Device for which
the input event was received. This Device is passed to the input handlers.
Custom event classes are added which extend QMouseEvent, QKeyEvent and
QWheelEvent respectively and expose the Device. The Device is only passed
around as a forward declared pointer, so even if compiled without libinput
support, it should still compile.
Event handlers which need to get access to the Device can now just cast
the event pointer to the custom class and access it. This can be used in
future to handle device specific key codes, etc.
As we don't have a proper event classes for touch events the event
handlers do not yet have access to the Device. Here the internal API
needs to be adjusted in future.
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D1667
Summary:
Qt's touch event API is rather difficult and complex to implement.
As none of KWin's internal windows supports multi-touch gestures yet,
this is going the easy route and just simulates a left mouse button
press. If in future need arises for touch gesture support on KWin's
internal windows, this can be added.
Test Plan: Tested on exopc with DebugConsole and auto test
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D1661
Summary:
Touch events are emulating mouse events, in particular left mouse
button.
With this change one can move windows through the decoration, use
the decoration buttons and also support the double click action.
As finding the decoration is pretty much exactly the same as for
pointer events, a new base class is introduces which provides the
functionality of updating the decoration and the shared common
variables.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1604
Summary:
This ensures that QWindow::setMask works for KWin internal windows.
Without KWin sends all pointer events to the QWindow, even if the
mask says it shouldn't get events.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1509
Summary:
In order to start the WaylandServer in kwin_x11 we need to make sure
that WaylandServer does not start the KScreenLocker integration. On
X11 the lock screen is provided by a different application (in Plasma
by ksmserver).
A new init flag is added to WaylandServer to not integrate with
KScreenLocker. Thus the default is still to integrate with KScreenLocker.
All direct usages of KScreenLocker are guarded to not be called if
the screenlocker integration is not present.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1481