Commit 80c3fdd6 authored by Martin Flöser's avatar Martin Flöser

Use App's x11 rootWindow and connection in PointerInputRedirection::warpXcbOnSurfaceLeft

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.
parent 651ea26f
......@@ -652,10 +652,11 @@ void PointerInputRedirection::warpXcbOnSurfaceLeft(KWayland::Server::SurfaceInte
// No XWayland, no point in warping the x cursor
return;
}
if (!kwinApp()->x11Connection()) {
const auto c = kwinApp()->x11Connection();
if (!c) {
return;
}
static bool s_hasXWayland119 = xcb_get_setup(kwinApp()->x11Connection())->release_number >= 11900000;
static bool s_hasXWayland119 = xcb_get_setup(c)->release_number >= 11900000;
if (s_hasXWayland119) {
return;
}
......@@ -669,8 +670,8 @@ void PointerInputRedirection::warpXcbOnSurfaceLeft(KWayland::Server::SurfaceInte
return;
}
// warp pointer to 0/0 to trigger leave events on previously focused X window
xcb_warp_pointer(connection(), XCB_WINDOW_NONE, rootWindow(), 0, 0, 0, 0, 0, 0),
xcb_flush(connection());
xcb_warp_pointer(c, XCB_WINDOW_NONE, kwinApp()->x11RootWindow(), 0, 0, 0, 0, 0, 0),
xcb_flush(c);
}
QPointF PointerInputRedirection::applyPointerConfinement(const QPointF &pos) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment