From f44abad5b0eb8ea4524e9357808550833a67e71a Mon Sep 17 00:00:00 2001 From: Nova Date: Sat, 6 Sep 2025 14:40:56 -0700 Subject: [PATCH] fix(wayland): set xdg surface role properly --- src/wayland/xdg/popup.rs | 2 +- src/wayland/xdg/toplevel.rs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/wayland/xdg/popup.rs b/src/wayland/xdg/popup.rs index b72604e..9482f02 100644 --- a/src/wayland/xdg/popup.rs +++ b/src/wayland/xdg/popup.rs @@ -35,7 +35,7 @@ impl Popup { xdg_surface: &Arc, positioner: &Positioner, ) -> Self { - xdg_surface + let _ = xdg_surface .wl_surface() .surface_id .set(SurfaceId::Child(rand::thread_rng().gen_range(0..u64::MAX))); diff --git a/src/wayland/xdg/toplevel.rs b/src/wayland/xdg/toplevel.rs index 5ad7088..fd01613 100644 --- a/src/wayland/xdg/toplevel.rs +++ b/src/wayland/xdg/toplevel.rs @@ -1,6 +1,9 @@ use super::backend::XdgBackend; use crate::{ - nodes::{Node, items::panel::PanelItem}, + nodes::{ + Node, + items::panel::{PanelItem, SurfaceId}, + }, wayland::core::surface::Surface, }; use mint::Vector2; @@ -66,6 +69,8 @@ impl Toplevel { wl_surface: Arc, xdg_surface: Arc, ) -> Self { + let _ = wl_surface.surface_id.set(SurfaceId::Toplevel(())); + Toplevel { id: object_id, wl_surface: Arc::downgrade(&wl_surface),