Commit Graph

5 Commits (4ef07494bd9c46ce945f665af4adce6048b28909)

Author SHA1 Message Date
Martin Gräßlin 8a1f19b145 Add support for Drag'n'Drop on Wayland
Drag'n'Drop on Wayland allows us to improve the drag'n'drop experience.
When entering a window during the drag'n'drop operation, KWin raises it.

BUG: 36065
FIXED-IN: 5.6.0 (Wayland only)
2016-03-02 08:34:41 +01:00
Martin Gräßlin d15e94f326 [autotest] Add test case for cursor image
This test case verifies that the cursor image and hot spot changes
correctly when focusing a window, changes when damaged and hides.

Test shows that when focusing a window the cursor image is not
removed, neither that unfocus sets back to fallback cursor properly.
2016-02-25 08:14:48 +01:00
Martin Gräßlin 873e2b0320 Add support for Move/Resize cursor mode 2016-02-25 08:14:48 +01:00
Martin Gräßlin a029300ce5 Rework cursor image handling for Wayland
So far updating the cursor image was not really defined. It was possible
to use the cursor image from the wayland seat or have a custom set cursor
image. But there are no rules in place to decide which one to use when.

With this change a dedicated CursorImage class is introduced which tracks
the cursor image changes on the seat, on the decoration, in the effects
and so on. In addition it tracks which is the current source for the
image, that is whether e.g. the cursor from the seat or from effects
override should be used. Whenever the cursor image changes a signal is
emitted, which is connected to the signal in AbstractBackend.

Based on that the backends can directly show the image. The existing
code in the backends to install a cursor shape or to install the cursor
from the server is completely dropped. For the backend it's irrelevant
from where the image comes from.

A new feature added is that the cursor image is marked as rendered. This
is then passed on to the frame rendered in the Surface and thus animated
cursors are finally working. Unfortunately animated cursors are broken in
Qt (see https://bugreports.qt.io/browse/QTBUG-48181 ).
2016-02-25 08:14:48 +01:00
Martin Gräßlin c044ad98be Split out pointer related handling from InputRedirection
All pointer related code is moved into a new class called
PointerInputRedirection.

The main idea is to simplify the code and make it easier to maintain.
Therefore also a few changes in the setup were performed:
* before init() is called, no processing is performed
* init() is only called on Wayland and after Workspace is created
* init property is set to false once Workspace or WaylandServer is
  destroyed

Thus code can operate on the following assumptions:
* Workspace is valid
* WaylandServer is valid
* ScreenLocker integration is used

The various checks whether there is a waylandServer() and whether
there is a seat are no longer needed.

Some of the checks have been reordered to be faster in the most common
use case of using libinput. E.g. whether warping is supported is first
evaluated by the variable bound to whether we have libinput and only if
that is false the backend is checked.

The new class doesn't have signals but invokes the signals provided
by InputRedirection. I didn't want to add new signals as I consider
them as not needed. The areas in KWin needing those signals should
be ported to InputEventFilters.
2016-02-12 13:38:26 +01:00