diff --git a/src/backends/x11/windowed/x11_windowed_backend.cpp b/src/backends/x11/windowed/x11_windowed_backend.cpp index 85850c147e..2278142e26 100644 --- a/src/backends/x11/windowed/x11_windowed_backend.cpp +++ b/src/backends/x11/windowed/x11_windowed_backend.cpp @@ -415,17 +415,18 @@ void X11WindowedBackend::grabKeyboard(xcb_timestamp_t time) xcb_ungrab_pointer(m_connection, time); m_keyboardGrabbed = false; } else { - const auto c = xcb_grab_keyboard_unchecked(m_connection, false, window(), time, + const X11WindowedOutput *output = static_cast(m_outputs[0]); + const auto c = xcb_grab_keyboard_unchecked(m_connection, false, output->window(), time, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC); UniqueCPtr grab(xcb_grab_keyboard_reply(m_connection, c, nullptr)); if (!grab) { return; } if (grab->status == XCB_GRAB_STATUS_SUCCESS) { - const auto c = xcb_grab_pointer_unchecked(m_connection, false, window(), + const auto c = xcb_grab_pointer_unchecked(m_connection, false, output->window(), XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC, - window(), XCB_CURSOR_NONE, time); + output->window(), XCB_CURSOR_NONE, time); UniqueCPtr grab(xcb_grab_pointer_reply(m_connection, c, nullptr)); if (!grab || grab->status != XCB_GRAB_STATUS_SUCCESS) { xcb_ungrab_keyboard(m_connection, time); @@ -625,11 +626,6 @@ QVector X11WindowedBackend::supportedCompositors() const return QVector{OpenGLCompositing, QPainterCompositing}; } -xcb_window_t X11WindowedBackend::window() const -{ - return m_outputs.first()->window(); -} - Outputs X11WindowedBackend::outputs() const { return m_outputs; diff --git a/src/backends/x11/windowed/x11_windowed_backend.h b/src/backends/x11/windowed/x11_windowed_backend.h index ed2146e388..9aa1951e4c 100644 --- a/src/backends/x11/windowed/x11_windowed_backend.h +++ b/src/backends/x11/windowed/x11_windowed_backend.h @@ -103,7 +103,6 @@ public: int screenNumer() const; xcb_window_t rootWindow() const; - xcb_window_t window() const; bool hasXInput() const; bool initialize() override;