From bb404f7d67c7e5cb4071357a7d376189d0c1d27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 2 Apr 2015 09:49:39 +0200 Subject: [PATCH] [wayland] Fix checking id to Surface in xwayland client message We need to also pass the client to the verification. --- events.cpp | 5 ++++- wayland_server.h | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/events.cpp b/events.cpp index 24dab56c11..8872e48b60 100644 --- a/events.cpp +++ b/events.cpp @@ -67,6 +67,7 @@ along with this program. If not, see . #include "x11eventfilter.h" #if HAVE_WAYLAND +#include "wayland_server.h" #include #endif @@ -1698,7 +1699,9 @@ void Toplevel::clientMessageEvent(xcb_client_message_event_t *e) if (e->type == atoms->wl_surface_id) { m_surfaceId = e->data.data32[0]; #if HAVE_WAYLAND - m_surface = KWayland::Server::SurfaceInterface::get(m_surfaceId); + if (auto w = waylandServer()) { + m_surface = KWayland::Server::SurfaceInterface::get(m_surfaceId, w->xWaylandConnection()); + } #endif emit surfaceIdChanged(m_surfaceId); } diff --git a/wayland_server.h b/wayland_server.h index 2149cd6ec8..ee98dab619 100644 --- a/wayland_server.h +++ b/wayland_server.h @@ -79,6 +79,10 @@ public: **/ int createQtConnection(); + KWayland::Server::ClientConnection *xWaylandConnection() const { + return m_xwaylandConnection; + } + private: KWayland::Server::Display *m_display = nullptr; KWayland::Server::CompositorInterface *m_compositor = nullptr;