mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2025-01-29 20:34:46 +01:00
Fix window not raising when toggled to floating
This commit is contained in:
parent
7dac7ba8cd
commit
ac6130408b
1 changed files with 27 additions and 6 deletions
|
@ -12,9 +12,9 @@ use smithay::{
|
|||
wayland::{compositor, seat::WaylandFocus},
|
||||
};
|
||||
|
||||
use crate::{backend::Backend, state::State};
|
||||
use crate::{backend::Backend, output::OutputState, state::State};
|
||||
|
||||
use self::window_state::{CommitState, Float, WindowId, WindowState};
|
||||
use self::window_state::{Float, WindowId, WindowState};
|
||||
|
||||
pub mod window_state;
|
||||
|
||||
|
@ -87,11 +87,32 @@ pub fn toggle_floating<B: Backend>(state: &mut State<B>, window: &Window) {
|
|||
|
||||
state.re_layout();
|
||||
|
||||
// FIXME: every window gets mapped after this raise in `commit`, making this useless
|
||||
WindowState::with(window, |state| {
|
||||
state.needs_raise = CommitState::RequestReceived(window.toplevel().send_configure());
|
||||
let output = state.focus_state.focused_output.as_ref().unwrap();
|
||||
let render = OutputState::with(output, |op_state| {
|
||||
state
|
||||
.windows
|
||||
.iter()
|
||||
.cloned()
|
||||
.filter(|win| {
|
||||
WindowState::with(win, |win_state| {
|
||||
if win_state.floating.is_floating() {
|
||||
return true;
|
||||
}
|
||||
for tag_id in win_state.tags.iter() {
|
||||
if op_state.focused_tags().any(|tag| &tag.id == tag_id) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
false
|
||||
})
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
});
|
||||
|
||||
let clone = window.clone();
|
||||
state.schedule_on_commit(render, move |data| {
|
||||
data.state.space.raise_element(&clone, true);
|
||||
});
|
||||
// state.space.raise_element(window, true);
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize, serde::Deserialize)]
|
||||
|
|
Loading…
Add table
Reference in a new issue