Commit Graph

217 Commits (81cdfd2ebfa0778071f70cf8c937176215ace383)

Author SHA1 Message Date
Vlad Zagorodniy abe128818c Use more accurate name for Workspace::getMovingClient method
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
2019-04-22 11:12:22 +03:00
Roman Gilg 548978bfe1 [xwl] Drag and drop between Xwayland and Wayland native clients
Summary:
Building upon the generic X Selection support this patch establishes another
selection class representing the XDND selection and provides interfaces
to communicate drags originating from Xwayland windows to the Wayland
server KWin and drags originating from Wayland native drags to Xwayland.

For Wayland native drags KWin will claim the XDND selection as owner and
will simply translate all relevant events to the XDND protocol and receive
alike messages by X clients.

When an X client claims the XDND selection KWin is notified via the X protocol
and it decides if it allows the X drag to transcend into the Wayland protocol.
If this is the case the mouse position is tracked and on entering a Wayland
native window a proxy X Window is mapped to the top of the window stack. This
proxy window acts as a drag destination for the drag origin window and again
X messages will be translated into respective Wayland protocol calls. If the
cursor leaves the Wayland window geometry before a drop is registered, the
proxy window is unmapped, what triggers a subsequent drag leave event.

In both directions the necessary core integration is minimal. There is a single
call to be done in the drag and drop event filter through the Xwayland
interface class.

From my tests this patch facilitates drags between any Qt/KDE apps. What needs
extra care are the browsers, which use target formats, that are not directly
compatible with the Wayland protocol's MIME representation. For Chromium an
additional integration step must be done in order to provide it with a net
window stack containing the proxy window.

Test Plan: Manually. Auto tests planned.

Reviewers: #kwin

Subscribers: zzag, kwin, alexde

Tags: #kwin

Maniphest Tasks: T4611

Differential Revision: https://phabricator.kde.org/D15627
2019-02-19 13:09:18 +01:00
Jan Grulich b4a8977b3a Add support for fake pointer move with absolute coordinates
Summary: This is needed for remote desktop support. It also depends on D18114.

Reviewers: davidedmundson

Reviewed By: davidedmundson

Subscribers: graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18115
2019-02-14 13:47:36 +01:00
Roman Gilg d848c11485 Revert "Remove comparison between signed and unsigned integer expressions warning"
This reverts commit 16e904592a.

The commit has logical errors, corrupting DND on Wayland. Also the solution
with static_cast to solve the compiler warnings is not a sensible one, it just
hides the root problem.

And next time such a change has to go through review!
2019-01-04 20:30:24 +01:00
Martin Flöser a0b482cbab Introduce a command line option to disable any kind of global shortcuts
Summary:
This command line option is useful for KWin in embedded use case. That
is when KWin is just used as a compositor for one application instead of
a complete desktop environment. In such a setup global shortcuts are not
wanted and interfere with the application. E.g. one does not want Alt+F4
to close the window, that would render the system unusable.

This change introduces a command line option and disables the following
event filters and spies:
 * global shortcuts
 * modifier only shortcuts
 * terminate session
 * virtual terminal switching
 * screen edges

KGlobalAccel still gets inited, otherwise the (non-functional) binary
would be launched when KWin registers it's global shortcuts.

Test Plan:
New test added based on existing tests for the global
shortcuts, ctest passes

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17304
2018-12-13 19:36:28 +01:00
Martin Flöser 070b46f455 Hide mouse cursor when interacting with touch screen
Summary:
On touch events the mouse cursor gets hidden, on next mouse event the
mouse cursor is shown again. This IMHO significantly improves the system
interaction if touch is the primary user interface.

Test Plan: Test case added and ctest passes

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17280
2018-12-13 18:55:46 +01:00
Roman Gilg 05ca6c97f8 Unset touch targets on no current touch points
Summary:
Certain input devices like touch screens can be in a state of having no input
target at all. In case of touch screens when there are no current touch points.

In this case unset and block at-surface targets until a touch point is
available again.

Test Plan: Auto test window-selection passes again.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: graesslin, davidedmundson, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17537
2018-12-13 10:59:07 +01:00
Shubham Jangra 16e904592a Remove comparison between signed and unsigned integer expressions warning 2018-12-10 01:11:34 +05:30
Roman Gilg a23368d638 Add Wayland touch drag and drop support
Summary:
Use the new functionality in KWayland to support drag and drop via touch
screens.

Either a drag and drop session with pointer or touch is possible, but not
both at the same time. Pointer/touch gets deactivated if a touch/pointer
drag and drop session is active.

Test Plan: Manually.

Reviewers: #kwin, davidedmundson

Subscribers: davidedmundson, alexde, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D15466
2018-12-02 21:54:20 +01:00
Roman Gilg 2e29711323 Rework InputDeviceHandler focus tracking
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
2018-12-02 21:36:11 +01:00
Roman Gilg eab71a8a19 Privatize variables in InputDeviceHandler
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
2018-12-02 21:17:44 +01:00
Roman Gilg b5a91cdfe0 Float position values in drag input filter
Summary:
We lost information when using QMouseEvent::globalPos, since
it is integer. Use instead InputRedirection::globalPointer,
which is updated before the filters are processed and is
float.

Test Plan: Manually.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: anthonyfieroni, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D15502
2018-12-02 21:11:16 +01:00
Martin Flöser 77e3bbef7e Disable modifier window actions if global shortcuts are disabled
Summary:
Same is done on X11 (see Client::updateMouseGrab), so we should have this
on Wayland as well.

Also adding the pointer confinement restriction for modifier + wheel.

Test Plan: Run new and adjusted testcases with and without the change

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16025
2018-10-14 09:45:57 +02:00
Martin Flöser cefc15e573 Ignore modifier mouse actions when the pointer is constrained
Summary:
If the pointer is constrained all mouse events should go to the window.
Also our Alt+click. To use Alt+click nevertheless one can just unconfine
the window.

CCBUG: 399375

Test Plan: Run the adjusted autotest before and after change

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D15982
2018-10-06 18:05:32 +02:00
Roman Gilg 6072b0cd6c Remove breaking pointer constraints functionality
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
2018-09-12 22:55:26 +02:00
Roman Gilg 1fada99478 Activate clients on drag enter
Summary:
We currently only raise a client when a drag enters it and not activate it.
This is confusing since afterwards the raised window has not keyboard focus
although visually being in front of the window the drag originated from.

Therefore activate entered windows instead of only raising them.

Test Plan: Manually and autotests still pass.

Reviewers: #kwin, hein

Reviewed By: hein

Subscribers: anthonyfieroni, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D15225
2018-09-11 11:20:18 +02:00
Yuri Chornoivan bf58da3e9a Fix minor EBN issues 2018-08-29 21:02:16 +03:00
Roman Gilg f0ba436c72 Explicitly disable pointer constraints on TabBox invocation
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
2018-07-16 10:43:25 +02:00
Roman Gilg 2694839099 Remove pointer constraint on resource unbind
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
2018-06-11 22:46:06 +02:00
Martin Flöser 08455f297d Ensure the QToolTip on the deocration does not steal key events
Summary:
BUG: 393253
FIXED-IN: 5.13.0

Test Plan: manual testing and new unit test

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12633
2018-05-19 09:01:11 +02:00
Martin Flöser 88b9de04ed Merge branch 'Plasma/5.12' 2018-03-04 09:43:38 +01:00
Martin Flöser b554e54e87 Support modifier mouse/scroll action on internal decorated windows
Summary:
This fixes the problem that alt+lmb did not start unrestricted move
resize for the Debug Console.

BUG: 374880
FIXED-IN: 5.12.3

Test Plan: New test case and manual testing whether alt+lmb/rmb works

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D10440
2018-03-04 09:41:38 +01:00
Martin Flöser 119c64839d Merge branch 'Plasma/5.12' 2018-02-25 14:11:25 +01:00
Martin Flöser 911176a887 Send hoverLeave or hoverMotion after touch up on decoration
Summary:
On touch down a first hover motion is sent to the decoration. Thus e.g. a
button enters the hovered state. On touch release so far the decoration
did not get a leave event resulting in the button still being hovered.

This change ensures the leave event is sent or if the pointer is also on
the decoration a motion to the pointer position is sent.

BUG: 386231
FIXED-IN: 5.12.3

Test Plan:
New test case and manual testing to verify that the maximize
button is no longer hovered after touch down/up on it

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D10308
2018-02-25 13:54:02 +01:00
Martin Flöser a0c91c6e19 Merge branch 'Plasma/5.12' 2018-02-21 18:07:41 +01:00
Martin Flöser 338c7362c9 Properly handle move during touch events
Summary:
When a window was being moved the touch handling performed the wrong
interaction. Due to that it was possible to move the window, but KWin
did not enter the correct code paths, thus quick tiling was for example
not functional.

BUG: 390113
FIXED-IN: 5.12.3

Test Plan: New test case added and manual test in nested KWin

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D10431
2018-02-21 18:06:00 +01:00
Martin Flöser 137b954add Remove remaining HAVE_INPUT ifdef sections
Somehow they sneaked in between creating the patch for making libinput
mandatory and pushing the patch.
2018-02-10 20:36:43 +01:00
Martin Flöser bbf00fdd98 Require libinput and udev
Summary:
The main reason for not having it as a mandatory dependency was that BSD
doesn't support it. But as I learned recently it is available on our CI
system. So BSDs have support now.

Even more it showed that the code doesn't compile if the dependency is
missing. And there's one thing I hate: broken build configuration
options.

So let's make UDEV and libinput a required dependency and get rid of the
problems.

Test Plan: Compiles

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D10057
2018-02-04 15:00:42 +01:00
Marco Martin 87b688daae Expose if the tablet mode switch is available
Summary:
expose in the libinput wrapper a property that tells whether
a tablet mode switch input device is present on the machine,
expose it trough dbus

Test Plan:
still not complete, I need a way to either access the connection
from TabletModeManager or setting to TabletModeManager from input.cpp

Reviewers: #kwin, #plasma, graesslin

Reviewed By: #kwin, #plasma, graesslin

Subscribers: graesslin, ngraham, davidedmundson, plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D9944
2018-01-25 12:46:38 +01:00
Martin Flöser b002b27903 Simulate user activity on fake input events
Summary:
This ensures that using KDE Connect to control input properly inhibits
idle timeouts.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9555
2018-01-10 17:43:42 +01:00
Martin Flöser d2a9232ad3 Pass SwitchEvent from LibInput through KWin and add to DebugConsole
Summary:
This change introduces a new SwitchEvent and passes it through the
InputEventSpy and InputEventFilter. The DebugConsoleFilter implements it
so that the events can be monitored in the debug console.

Test Plan: Untested as my only device with such switches has too old libinput

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9521
2018-01-09 19:32:58 +01:00
Martin Flöser 6ab625ed97 Ignore outputOnly QWindows for pointer and touch events
Summary:
The idea is to be output only, so also ignore for pointer and touch.
This is similar to the previous commit for keyboard events.

BUG: 386954

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9647
2018-01-03 21:15:34 +01:00
Martin Flöser f5f1f6ceb4 Don't send keyboard events to QWindows which have outputOnly property set
Summary:
PlasmaCore.Dialog has a property outputOnly. This is for example used in
KWin's OnScreenNotification. If that property is set KWin should not send
any key events to it, just like for windows with _q_showWithoutActivating.

BUG: 388112

Test Plan: Not yet

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9618
2018-01-03 21:13:23 +01:00
Martin Flöser 68698b4201 [libinput] Find screen for touch screen devices and calibrate accordingly
Summary:
This change finds the screen for a touch screen device based on:
 * number available screens
 * output name defined on the touch screen device
 * internal screen
 * and physical size

The id of the screen is stored in the Device allowing to adjust the
touch points accordingly. This means instead of transferring to the
combined display size the touch points are transferred into the output
space and the position of the output is added. Thus in a multi screen
system the touch points are properly mapped to the output.

Furthermore the screen orientation is passed to the Device and a
calibration matrix is set accordingly. Thus a transformed screen has the
touch screen transformed accordingly.

Please note that this only affects libinput on Wayland and not on X11!
The x11 standalone platform needs to gain similar code.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8748
2017-12-23 10:18:55 +01:00
Fabian Vogt 60b0413830 Merge branch 'Plasma/5.11' 2017-11-19 12:33:04 +01:00
Fabian Vogt d7d78e2b59 Fix race condition with libinput events on startup
Summary:
In some cases, it's possible that libinput wrote device added events to
the file descriptor before the connection to handle those events was
in-place. This resulted in a compositor without any input devices.

Test Plan:
Ran a wayland session. In about 60% of all cases, no input was
possible. kwin_libinput showed the enumeration of all devices correctly,
but KWin::LibInput::Context did not have any m_devices.
After this change, this did not appear anymore.

Reviewers: #plasma, graesslin, davidedmundson

Reviewed By: #plasma, graesslin, davidedmundson

Subscribers: anthonyfieroni, ngraham, kwin, #kwin, plasma-devel

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8888
2017-11-19 12:31:51 +01:00
Martin Flöser 48f7331c4c Merge branch 'Plasma/5.11' 2017-11-14 18:04:29 +01:00
Martin Flöser 5313b85646 Support modifier+mouse button on window decoration
Summary:
On X11 modifier+mouse button on the window decoration triggers the
"special" handling thus as unrestricted move instead of passing the click
to the decoration. Of course on Wayland we want to have the same
functionality.

BUG: 386708
FIXED-IN: 5.11.4

Test Plan: New test case added. PointerInputTest still passes.

Reviewers: #kwin, #plasma, broulik

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8758
2017-11-14 18:03:36 +01:00
Martin Flöser 91d78daac4 Ensure libinput connection thread uses real time scheduling
Summary:
The SCHED_RESET_ON_FORK results in threads (not only processes) to have
the scheduling policy reset to default. This means that the libinput
thread is not real time, but this was actually intended.

To solve this problem KWin does start without the RESET_ON_FORK flag
during startup. Once createInput has been called the scheduling is
adjusted again and RESET_ON_FORK is added again. This results in the
libinput thread and all threads Qt starts in between (e.g. dbus) to gain
real time policy. But it is still not leaked to other processes or to
threads in KWin which don't need it.

Other options considered: just don't use RESET_ON_FORK and instead
manually reset on fork. This would mean all threads in KWin gain real
time, but we don't need this. It's only interesting for the main
(rendering, Wayland thread) and the input thread. Also the danger to
leak into another process is too high.

Keeping the capability till the libinput thread is created and adjust
the thread itself. This option was discarded as I don't want KWin to
have any capabilities when the QApplication is started.

Test Plan: ps -eL -o class,rtprio,cmd,comm  | grep kwin_wayland

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8065
2017-10-31 12:44:51 +01:00
Martin Flöser 70bc9524d9 Send QKeyEvent with Qt::Key as expected by Qt to internal windows
Summary:
KWin passes the current keysym converted to a Qt::Key in the QKeyEvent.
The current keysym does not always change when a key gets released, so
when pressing a shortcut the release carry a Qt::Key which could be
considered as wrong.

QtWayland transforms the actual pressed/released key into a keysym and
passes that through the QKeyEvent. This change does the same for the
internal windows. A new QKeyEvent is created and adjusted in a way that
it matches what Qt expects.

Why not change everything to how Qt expects it? The key is used at
various places and in KWin internally we expect the behavior how it is
currently implemented. So it's better to use Qt's expectation only when
interacting with Qt.

Also the change carries a workaround for a bug in QKeySequenceEdit
(see QTBUG-62102) and transforms Super to Meta. As this adjustment only
makes sense for the internal windows we need to send in an adjusted
QKeyEvent anyway, so another argument for using the Qt behavior only in
this place.

Test Plan:
Can set a shortcut on Wayland and it can be used to activate
the window.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D6828
2017-08-19 11:37:08 +02:00
Martin Flöser 8527ac30dc Fix unused-parameter warnings as reported by GCC 2017-07-28 21:31:09 +02:00
David Faure bddde8d78e Fix compilation without libinput. #if is used everywhere else, #ifdef is wrong. 2017-05-13 12:05:33 +02:00
Martin Flöser 6a4e9cbb58 Merge branch 'Plasma/5.9' into Plasma/5.10 2017-05-12 07:08:04 +02:00
Martin Gräßlin 229be65e40 Improve the escape key handling for breaking constrained pointers
Summary:
So far KWin started to filter out the escape key as soon as it gets
pressed. This was done by unsetting keyboard focus. The idea was to
reset keyboard focus when it is only a short press and that then the
keyboard state is correct for the application. But in practice this
does not work. The only application currently supporting pointer
constraints (Xwayland) does not do anything on a key which is pressed
when gaining keyboard focus. The result is escape not working in
pointer constrained Xwayland windows.

This change addresses this problem by changing the interaction to only
unset keyboard focus when our break constraints condition is met. This
should also result in the application not handling the key release, but
it means it gets the key press. Unfortunately I don't have a good way
to test.

BUG: 378452

Test Plan: None

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5488
2017-05-12 07:06:44 +02:00
David Edmundson fe231be5e2 Keep all touchpad QActions in the main thread
Summary:
Making QActions with the Connection as a parent is dangerous as it gets
moved to a new thread, moving all child objects to that thread.

KGlobalAccel and QAction aren't thread safe and we shouldn't be using it
in two threads. This was notably seen when runnng invokeShortcut over
DBus which then invokes it on the main thread. Something my laptop was
doing when I closed the lid.

This patch simply moves the code to the Input class, where we set up the
libinput connection.

Test Plan:
Closed lid, kwin_wayland was still there when I resumed
Set manual shortcut for toggling touchpad, that still worked

Reviewers: #plasma

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5733
2017-05-07 16:08:00 +02:00
Martin Gräßlin 857d8a9c37 Add a KSharedConfigPtr for kcminputrc to KWin::Application
Summary:
There are a few places where KWin needs to read values from kcminputrc.
As I need to add yet another one it makes more sense to properly
structure it like in other cases and have only one kcminputrc hold in
the application. This also allows to better mock the config values in
the integration tests.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5540
2017-04-24 21:01:03 +02:00
Martin Gräßlin 9a13743c49 Don't update the focused pointer Surface if a button is pressed
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
2017-04-20 17:02:42 +02:00
Martin Gräßlin 1193b0da77 Initial support for popup window handling
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
2017-04-07 16:14:50 +02:00
Martin Gräßlin 67295336e5 Add support for interactive selection through touch events
Summary:
This was forgotten during implementing the interactive window/point
selection. With this change it is also possible to perform the
interaction through touch events. In that case KWin takes over any
existing touch sequence.

This implements T5315.

Test Plan: Added auto test and took a screenshot through touch events

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5203
2017-03-31 07:44:38 +02:00
Martin Gräßlin aa6c8f8116 Add support for activating screenedges through touch swipe gestures
Summary:
Each Edge creates a SwipeGesture for touch activation. The swipe needs to
be a single finger starting from the edge into the screen for at least
20 %. The SwipeGesture and GestureRecognizer is extended to support the
use cases of the touch screen edge swipe.

New features supported by the gesture system are:
 * minimum and maximum position
 * a minimum delta for the swipe
 * progress signal based on the minimum delta
 * starting a swipe with a start point

The Edge has the progress signal connected to its approach signal, thus
visual feedback is provided through the screen edge effect.

The screen edge system supports touch only for the edges (corners are
too difficult to activate on touch screens). At the moment the following
features are supported:
 * screen edge show/raise of windows (e.g. auto hidden panels)
 * trigger the configured action
 * trigger the configured callback function (e.g. script)

In future it might make sense to add a touch specific configuration
action to support different actions for screen edges activated by mouse
and touch.

BUG: 370323

Test Plan:
configured a screen edge and triggered through touch,
added an auto-hiding panel and triggered through touch

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D5106
2017-03-27 17:44:02 +02:00