From 432924b372b8e416ca627fa1adef2504dac1d2be Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sun, 24 Mar 2024 02:02:27 +0000 Subject: [PATCH] xwayland: assign wlr_surface on associate --- src/events/Windows.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 056d9108..d1cf9552 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -1190,11 +1190,15 @@ void Events::listener_associateX11(void* owner, void* data) { PWINDOW->hyprListener_mapWindow.initCallback(&PWINDOW->m_uSurface.xwayland->surface->events.map, &Events::listener_mapWindow, PWINDOW, "XWayland Window"); PWINDOW->hyprListener_commitWindow.initCallback(&PWINDOW->m_uSurface.xwayland->surface->events.commit, &Events::listener_commitWindow, PWINDOW, "XWayland Window"); + + PWINDOW->m_pWLSurface.assign(g_pXWaylandManager->getWindowSurface(PWINDOW), PWINDOW); } void Events::listener_dissociateX11(void* owner, void* data) { const auto PWINDOW = (CWindow*)owner; + PWINDOW->m_pWLSurface.unassign(); + PWINDOW->hyprListener_mapWindow.removeCallback(); PWINDOW->hyprListener_commitWindow.removeCallback(); } @@ -1219,8 +1223,6 @@ void Events::listener_surfaceXWayland(wl_listener* listener, void* data) { PNEWWINDOW->hyprListener_destroyWindow.initCallback(&XWSURFACE->events.destroy, &Events::listener_destroyWindow, PNEWWINDOW, "XWayland Window"); PNEWWINDOW->hyprListener_setOverrideRedirect.initCallback(&XWSURFACE->events.set_override_redirect, &Events::listener_setOverrideRedirect, PNEWWINDOW, "XWayland Window"); PNEWWINDOW->hyprListener_configureX11.initCallback(&XWSURFACE->events.request_configure, &Events::listener_configureX11, PNEWWINDOW, "XWayland Window"); - - PNEWWINDOW->m_pWLSurface.assign(g_pXWaylandManager->getWindowSurface(PNEWWINDOW), PNEWWINDOW); } void Events::listener_newXDGToplevel(wl_listener* listener, void* data) {