summaryrefslogtreecommitdiff
path: root/x11/plasma6-layer-shell-qt/files/patch-src_qwaylandlayersurface.cpp
blob: 264ac398bdcd3a33682a14b15e722f22a641ed86 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Fix the crash that happens when right-clicking the desktop surface

--- src/qwaylandlayersurface.cpp.orig	2025-07-15 09:53:41 UTC
+++ src/qwaylandlayersurface.cpp
@@ -113,10 +113,8 @@ void QWaylandLayerSurface::attachPopup(QtWaylandClient
 
 void QWaylandLayerSurface::attachPopup(QtWaylandClient::QWaylandShellSurface *popup)
 {
-    std::any anyRole = popup->surfaceRole();
-
-    if (auto role = std::any_cast<::xdg_popup *>(&anyRole)) {
-        get_popup(*role);
+    if (auto role = popup->nativeResource("xdg_popup")) {
+        get_popup(reinterpret_cast<struct ::xdg_popup*>(role));
     } else {
         qCWarning(LAYERSHELLQT) << "Cannot attach popup of unknown type";
     }