[wayland] Fix checking id to Surface in xwayland client message

We need to also pass the client to the verification.
This commit is contained in:
Martin Gräßlin 2015-04-02 09:49:39 +02:00
parent e1e437135b
commit bb404f7d67
2 changed files with 8 additions and 1 deletions

View file

@ -67,6 +67,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "x11eventfilter.h" #include "x11eventfilter.h"
#if HAVE_WAYLAND #if HAVE_WAYLAND
#include "wayland_server.h"
#include <KWayland/Server/surface_interface.h> #include <KWayland/Server/surface_interface.h>
#endif #endif
@ -1698,7 +1699,9 @@ void Toplevel::clientMessageEvent(xcb_client_message_event_t *e)
if (e->type == atoms->wl_surface_id) { if (e->type == atoms->wl_surface_id) {
m_surfaceId = e->data.data32[0]; m_surfaceId = e->data.data32[0];
#if HAVE_WAYLAND #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 #endif
emit surfaceIdChanged(m_surfaceId); emit surfaceIdChanged(m_surfaceId);
} }

View file

@ -79,6 +79,10 @@ public:
**/ **/
int createQtConnection(); int createQtConnection();
KWayland::Server::ClientConnection *xWaylandConnection() const {
return m_xwaylandConnection;
}
private: private:
KWayland::Server::Display *m_display = nullptr; KWayland::Server::Display *m_display = nullptr;
KWayland::Server::CompositorInterface *m_compositor = nullptr; KWayland::Server::CompositorInterface *m_compositor = nullptr;