Avoid parenting popups to other popups

Fixes #36
This commit is contained in:
Shawn Wallace 2025-04-22 21:39:20 -04:00
parent 2b5288b4b9
commit c31679aa41
3 changed files with 47 additions and 6 deletions

View file

@ -464,6 +464,7 @@ impl HandleEvent for Pointer {
};
self.scale = surface_data.scale_factor;
let surface_is_popup = matches!(surface_data.role, Some(SurfaceRole::Popup(_)));
let mut do_enter = || {
debug!("pointer entering {} ({serial})", surface_data.server.id());
self.server.enter(
@ -474,10 +475,12 @@ impl HandleEvent for Pointer {
);
let window = surface_data.window.unwrap();
state.connection.as_mut().unwrap().raise_to_top(window);
state.last_hovered = Some(window);
if !surface_is_popup {
state.last_hovered = Some(window);
}
};
if matches!(surface_data.role, Some(SurfaceRole::Popup(_))) {
if surface_is_popup {
match self.pending_enter.0.take() {
Some(e) => {
let client::wl_pointer::Event::Enter {