From 9f22a99887d8419d3c75f439ab36e624f9a93021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 27 Jun 2013 10:35:15 +0200 Subject: [PATCH] Install cursor from Effects mouse interception to Wayland surface Unfortunately this is extremely platform specific with code for X11 and Wayland. But at the moment it doesn't make much sense to abstract as Effects are the only case where a fullscreen low level input area is used. A small problem is also that the mouse cursor doesn't get restored and is changed when the X11 cursor changes. This will be fixed once we start to properly track the cursor of the individual X windows. --- effects.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/effects.cpp b/effects.cpp index 37e1721b43..5545696c4a 100644 --- a/effects.cpp +++ b/effects.cpp @@ -66,6 +66,9 @@ along with this program. If not, see . #include #include "composite.h" #include "xcbutils.h" +#ifdef WAYLAND_FOUND +#include "wayland_backend.h" +#endif // dbus generated #include "screenlocker_interface.h" @@ -768,6 +771,11 @@ void EffectsHandlerImpl::startMouseInterception(Effect *effect, Qt::CursorShape return; } if (kwinApp()->operationMode() != Application::OperationModeX11) { +#ifdef WAYLAND_FOUND + if (Wayland::WaylandBackend *w = Wayland::WaylandBackend::self()) { + w->installCursorImage(shape); + } +#endif return; } // NOTE: it is intended to not perform an XPointerGrab on X11. See documentation in kwineffects.h @@ -1257,6 +1265,11 @@ QSize EffectsHandlerImpl::virtualScreenSize() const void EffectsHandlerImpl::defineCursor(Qt::CursorShape shape) { if (!m_mouseInterceptionWindow.isValid()) { +#ifdef WAYLAND_FOUND + if (Wayland::WaylandBackend *w = Wayland::WaylandBackend::self()) { + w->installCursorImage(shape); + } +#endif return; } m_mouseInterceptionWindow.defineCursor(Cursor::x11Cursor(shape));