improv: better handling of popover dialog after dropdown

This commit is contained in:
Ashley Wulber 2026-07-08 18:42:18 -04:00 • committed by Jacob Kauffmann
parent 05f09fe33c
commit 95067445be
2 changed files with 11 additions and 3 deletions

View file

@ -366,7 +366,7 @@ impl<M: From<Message> + Send + 'static> Common<M> {
)
}
fn blur_rects(&mut self, id: SurfaceId) -> Task<M> {
pub fn blur_rects(&mut self, id: SurfaceId) -> Task<M> {
if let Some(output) = self.subsurface_outputs.get(&id) {
if let Some(rect) = self.subsurface_rects.get(output) {
let x = rect.x;

View file

@ -1527,6 +1527,9 @@ impl cosmic::Application for App {
if let Some(handle) = self.heartbeat_handle.take() {
handle.abort();
}
if self.dropdown_opt.is_some() {
return self.common.dropdown_blur_rects(true);
}
}
Message::DialogConfirm => match self.dialog_page_opt.take() {
Some(DialogPage::Restart(_)) => {
@ -1553,7 +1556,11 @@ impl cosmic::Application for App {
})
.discard();
}
None => {}
None => {
if self.dropdown_opt.is_some() {
return self.common.dropdown_blur_rects(true);
}
}
},
Message::DropdownToggle(dropdown) => {
if self.dropdown_opt == Some(dropdown) {
@ -1614,7 +1621,8 @@ impl cosmic::Application for App {
.abortable();
self.heartbeat_handle = Some(handle);
return heartbeat;
self.common.include_menu = false;
return Task::batch(vec![self.common.dropdown_blur_rects(false), heartbeat]);
}
}
Message::Heartbeat => match self.dialog_page_opt {