summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-05-24 10:32:21 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2020-05-29 18:21:57 +0200
commit0b253e8c595b596f44959d21124887545ab0b021 (patch)
tree95e15297ffae5472280014c297579644d53bbdb4 /src
parentbe7d24184f226fac9977e9d14e4b29ae3d5cd51f (diff)
Use WaylandCursorItem over clients, window system cursor otherwise
The pre-existing binding visible: cursorItem.surface != null implied that the surface would often be null; but in practice it was only null at startup. After entering a client window, whatever cursor it set would be retained when the mouse left the window. With client- side decorations, this could go unnoticed, because often the mouse would go across the titlebar or edge decorations on exit, and those would set the cursor back to a standard arrow. But in compositors that implement a lot of Qt Quick content of their own (server-side decorations and/or built-in features such as menus, docks etc.), that content cannot change the cursor that the WaylandCursorItem shows. Instead, we need the underlying window system cursor to be shown whenever the mouse is not hovering over a client window. As a drive-by, remove the inputEventsEnabled: false declarations from the examples, because WaylandCursorItem already does that internally. The pure-qml example is not fixed; it shows the window system cursor only when the compositor is a nested compositor. When it's not nested, you just have to move the mouse slowly enough to avoid "jumping over" the window edges. Or run clients that don't change the cursor. Pick-to: 5.15 Fixes: QTBUG-84391 Change-Id: I3e677f3e4314d01e5d27d8eea49b4cb315c29d03 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
Diffstat (limited to 'src')
-rw-r--r--src/compositor/compositor_api/qwaylandpointer.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/qwaylandpointer.cpp b/src/compositor/compositor_api/qwaylandpointer.cpp
index 38cb5d7f2..9e8bfff15 100644
--- a/src/compositor/compositor_api/qwaylandpointer.cpp
+++ b/src/compositor/compositor_api/qwaylandpointer.cpp
@@ -93,6 +93,7 @@ void QWaylandPointerPrivate::sendLeave()
enteredSurface = nullptr;
localPosition = QPointF();
enteredSurfaceDestroyListener.reset();
+ seat->cursorSurfaceRequest(nullptr, 0, 0);
}
void QWaylandPointerPrivate::ensureEntered(QWaylandSurface *surface)