mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2024-12-27 21:58:18 +01:00
Update internal xwm window layering
This commit is contained in:
parent
9af11d7b6a
commit
8df5682328
3 changed files with 29 additions and 1 deletions
|
@ -731,6 +731,8 @@ impl tag_service_server::TagService for TagService {
|
|||
return;
|
||||
};
|
||||
|
||||
state.fixup_xwayland_internal_z_indices();
|
||||
|
||||
state.request_layout(&output);
|
||||
state.update_focus(&output);
|
||||
state.schedule_render(&output);
|
||||
|
@ -758,6 +760,8 @@ impl tag_service_server::TagService for TagService {
|
|||
tag.set_active(true, state);
|
||||
});
|
||||
|
||||
state.fixup_xwayland_internal_z_indices();
|
||||
|
||||
state.request_layout(&output);
|
||||
state.update_focus(&output);
|
||||
state.schedule_render(&output);
|
||||
|
|
|
@ -73,6 +73,8 @@ impl State {
|
|||
|
||||
self.z_index_stack.retain(|win| win != &window);
|
||||
self.z_index_stack.push(window);
|
||||
|
||||
self.fixup_xwayland_internal_z_indices();
|
||||
}
|
||||
|
||||
/// Get the currently focused output, or the first mapped output if there is none, or None.
|
||||
|
|
|
@ -22,7 +22,7 @@ use smithay::{
|
|||
X11Surface, X11Wm, XwmHandler,
|
||||
},
|
||||
};
|
||||
use tracing::{debug, error, trace};
|
||||
use tracing::{debug, error, trace, warn};
|
||||
|
||||
use crate::{
|
||||
focus::keyboard::KeyboardFocusTarget,
|
||||
|
@ -510,6 +510,28 @@ impl XwmHandler for State {
|
|||
}
|
||||
}
|
||||
|
||||
impl State {
|
||||
pub fn fixup_xwayland_internal_z_indices(&mut self) {
|
||||
let Some(xwm) = self.xwm.as_mut() else {
|
||||
return;
|
||||
};
|
||||
|
||||
let x11_wins = self
|
||||
.space
|
||||
.elements()
|
||||
.filter(|win| win.is_on_active_tag())
|
||||
.filter_map(|win| win.x11_surface())
|
||||
.cloned()
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
for x11_win in x11_wins {
|
||||
if let Err(err) = xwm.raise_window(&x11_win) {
|
||||
warn!("Failed to raise xwayland window: {err}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Make assumptions on whether or not the surface should be floating.
|
||||
///
|
||||
/// This logic is taken from the Sway function `wants_floating` in sway/desktop/xwayland.c.
|
||||
|
|
Loading…
Reference in a new issue