server: Unmap popup on popup_done event
Seems some applications don't expect their popups to be unmapped without their consent, so they make act strangely, but at least it doesn't crash. Fixes #117
This commit is contained in:
parent
10cb041a80
commit
54a7ad9e13
6 changed files with 91 additions and 2 deletions
|
|
@ -268,7 +268,7 @@ impl State {
|
|||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn configure_popup(&mut self, surface_id: SurfaceId) {
|
||||
fn configure_popup(&mut self, surface_id: SurfaceId) {
|
||||
let surface = self.surfaces.get_mut(&surface_id).unwrap();
|
||||
let Some(SurfaceRole::Popup(p)) = &mut surface.role else {
|
||||
panic!("Surface does not have popup role: {:?}", surface.role);
|
||||
|
|
@ -291,6 +291,15 @@ impl State {
|
|||
other => panic!("Surface does not have toplevel role: {:?}", other),
|
||||
}
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
fn popup_done(&mut self, surface_id: SurfaceId) {
|
||||
let surface = self.surfaces.get_mut(&surface_id).unwrap();
|
||||
let Some(SurfaceRole::Popup(p)) = &mut surface.role else {
|
||||
panic!("Surface does not have popup role: {:?}", surface.role);
|
||||
};
|
||||
p.popup.popup_done();
|
||||
}
|
||||
}
|
||||
|
||||
macro_rules! simple_global_dispatch {
|
||||
|
|
@ -492,6 +501,12 @@ impl Server {
|
|||
self.display.flush_clients().unwrap();
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn popup_done(&mut self, surface_id: SurfaceId) {
|
||||
self.state.popup_done(surface_id);
|
||||
self.display.flush_clients().unwrap();
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn close_toplevel(&mut self, surface_id: SurfaceId) {
|
||||
let toplevel = self.state.get_toplevel(surface_id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue