Keep popover effects alive until surface destruction
This commit is contained in:
1 parent
4d1d1af413
commit
bbc2f226d8
3 files changed
+15
-2
No files matched your search
@@ -171,6 +171,7 @@ struct FereseShell {
|
|||||||
theme_error: Option<String>,
|
theme_error: Option<String>,
|
||||||
pending_config_error: Option<String>,
|
pending_config_error: Option<String>,
|
||||||
menu: Option<status_ui::OpenMenu>,
|
menu: Option<status_ui::OpenMenu>,
|
||||||
|
closing_menu_effects: std::collections::HashMap<window::Id, EffectsBinding>,
|
||||||
system_modal: Option<system_modal::SystemModal>,
|
system_modal: Option<system_modal::SystemModal>,
|
||||||
launcher: Option<launcher::Launcher>,
|
launcher: Option<launcher::Launcher>,
|
||||||
launcher_files: launcher::files::Files,
|
launcher_files: launcher::files::Files,
|
||||||
@@ -340,6 +341,7 @@ impl cosmic::Application for FereseShell {
|
|||||||
theme_error: None,
|
theme_error: None,
|
||||||
pending_config_error,
|
pending_config_error,
|
||||||
menu: None,
|
menu: None,
|
||||||
|
closing_menu_effects: Default::default(),
|
||||||
system_modal: None,
|
system_modal: None,
|
||||||
launcher: None,
|
launcher: None,
|
||||||
launcher_files: Default::default(),
|
launcher_files: Default::default(),
|
||||||
@@ -1204,6 +1206,7 @@ mod tests {
|
|||||||
theme_error: None,
|
theme_error: None,
|
||||||
pending_config_error: None,
|
pending_config_error: None,
|
||||||
menu: None,
|
menu: None,
|
||||||
|
closing_menu_effects: Default::default(),
|
||||||
system_modal: None,
|
system_modal: None,
|
||||||
launcher: None,
|
launcher: None,
|
||||||
launcher_files: Default::default(),
|
launcher_files: Default::default(),
|
||||||
|
|||||||
@@ -152,9 +152,13 @@ impl FereseShell {
|
|||||||
self.night_light_temperature = None;
|
self.night_light_temperature = None;
|
||||||
let tooltip = self.dismiss_workspace_tooltip();
|
let tooltip = self.dismiss_workspace_tooltip();
|
||||||
crate::EFFECT_FRAME_PENDING.store(false, std::sync::atomic::Ordering::Relaxed);
|
crate::EFFECT_FRAME_PENDING.store(false, std::sync::atomic::Ordering::Relaxed);
|
||||||
let Some(menu) = self.menu.take() else {
|
let Some(mut menu) = self.menu.take() else {
|
||||||
return tooltip;
|
return tooltip;
|
||||||
};
|
};
|
||||||
|
// Keep opacity applied until Iced has destroyed the popup's Wayland surface.
|
||||||
|
if let Some(effects) = menu.effects.take() {
|
||||||
|
self.closing_menu_effects.insert(menu.id, effects);
|
||||||
|
}
|
||||||
self.refresh_media_art(false);
|
self.refresh_media_art(false);
|
||||||
if menu.kind == Menu::Notifications {
|
if menu.kind == Menu::Notifications {
|
||||||
self.notifications.history_open = false;
|
self.notifications.history_open = false;
|
||||||
|
|||||||
@@ -416,6 +416,9 @@ impl FereseShell {
|
|||||||
..
|
..
|
||||||
}) if self.menu.is_some() => self.close_menu(),
|
}) if self.menu.is_some() => self.close_menu(),
|
||||||
Event::PlatformSpecific(PlatformSpecific::Wayland(wayland::Event::Popup(event, surface, popup_id))) => {
|
Event::PlatformSpecific(PlatformSpecific::Wayland(wayland::Event::Popup(event, surface, popup_id))) => {
|
||||||
|
if matches!(event, wayland::PopupEvent::Done) {
|
||||||
|
self.closing_menu_effects.remove(&popup_id);
|
||||||
|
}
|
||||||
if self.workspace_ui.tooltip == Some(popup_id) && matches!(event, wayland::PopupEvent::Done) {
|
if self.workspace_ui.tooltip == Some(popup_id) && matches!(event, wayland::PopupEvent::Done) {
|
||||||
self.workspace_ui.tooltip = None;
|
self.workspace_ui.tooltip = None;
|
||||||
return self.dismiss_workspace_tooltip();
|
return self.dismiss_workspace_tooltip();
|
||||||
@@ -455,7 +458,10 @@ impl FereseShell {
|
|||||||
{
|
{
|
||||||
self.close_system_modal()
|
self.close_system_modal()
|
||||||
}
|
}
|
||||||
Event::Window(window::Event::Closed) => Task::none(),
|
Event::Window(window::Event::Closed) => {
|
||||||
|
self.closing_menu_effects.remove(&id);
|
||||||
|
Task::none()
|
||||||
|
},
|
||||||
Event::PlatformSpecific(PlatformSpecific::Wayland(wayland::Event::Frame(_, surface, frame_id)))
|
Event::PlatformSpecific(PlatformSpecific::Wayland(wayland::Event::Frame(_, surface, frame_id)))
|
||||||
if self.menu.as_ref().is_some_and(|menu| menu.id == frame_id) =>
|
if self.menu.as_ref().is_some_and(|menu| menu.id == frame_id) =>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user