From cc3ca6ed145b5eddff0e93b298cdf39218872bd2 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Fri, 11 Apr 2025 16:45:50 -0400 Subject: [PATCH] refactor: applet tooltips may be for an overflow window --- examples/applet/src/window.rs | 1 + src/applet/mod.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/applet/src/window.rs b/examples/applet/src/window.rs index 15085d8..3fa177f 100644 --- a/examples/applet/src/window.rs +++ b/examples/applet/src/window.rs @@ -135,6 +135,7 @@ impl cosmic::Application for Window { "test", self.popup.is_some(), |a| Message::Surface(a), + None )) } diff --git a/src/applet/mod.rs b/src/applet/mod.rs index cf2b41b..8f8cbfc 100644 --- a/src/applet/mod.rs +++ b/src/applet/mod.rs @@ -225,6 +225,7 @@ impl Context { tooltip: impl Into>, has_popup: bool, on_surface_action: impl Fn(crate::surface::Action) -> Message + 'static, + parent_id: Option, ) -> crate::widget::wayland::tooltip::widget::Tooltip<'a, Message, Message> { let window_id = *TOOLTIP_WINDOW_ID; let subsurface_id = TOOLTIP_ID.clone(); @@ -243,7 +244,7 @@ impl Context { }; SctkPopupSettings { - parent: window::Id::RESERVED, + parent: parent_id.unwrap_or(window::Id::RESERVED), id: window_id, grab: false, input_zone: Some(Rectangle::new(