state: Consistent frame callbacks for sticky windows
This commit is contained in:
parent
d32d49779b
commit
7776d057da
1 changed files with 18 additions and 41 deletions
59
src/state.rs
59
src/state.rs
|
|
@ -88,7 +88,7 @@ use smithay::{
|
||||||
use time::UtcOffset;
|
use time::UtcOffset;
|
||||||
use tracing::error;
|
use tracing::error;
|
||||||
|
|
||||||
use std::{cell::RefCell, collections::HashSet, ffi::OsString, time::Duration};
|
use std::{cell::RefCell, ffi::OsString, time::Duration};
|
||||||
use std::{collections::VecDeque, time::Instant};
|
use std::{collections::VecDeque, time::Instant};
|
||||||
|
|
||||||
#[derive(RustEmbed)]
|
#[derive(RustEmbed)]
|
||||||
|
|
@ -568,12 +568,11 @@ impl Common {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut visited_outputs = HashSet::new();
|
for seat in self
|
||||||
for seat in self.seats.iter() {
|
.seats
|
||||||
if !visited_outputs.insert(seat.active_output()) {
|
.iter()
|
||||||
continue;
|
.filter(|seat| &seat.active_output() == output)
|
||||||
}
|
{
|
||||||
if &seat.active_output() == output {
|
|
||||||
let cursor_status = seat
|
let cursor_status = seat
|
||||||
.user_data()
|
.user_data()
|
||||||
.get::<RefCell<CursorImageStatus>>()
|
.get::<RefCell<CursorImageStatus>>()
|
||||||
|
|
@ -589,13 +588,9 @@ impl Common {
|
||||||
.unwrap_or(CursorImageStatus::default_named());
|
.unwrap_or(CursorImageStatus::default_named());
|
||||||
|
|
||||||
if let CursorImageStatus::Surface(wl_surface) = cursor_status {
|
if let CursorImageStatus::Surface(wl_surface) = cursor_status {
|
||||||
send_frames_surface_tree(
|
send_frames_surface_tree(&wl_surface, output, time, Some(Duration::ZERO), |_, _| {
|
||||||
&wl_surface,
|
None
|
||||||
output,
|
})
|
||||||
time,
|
|
||||||
Some(Duration::ZERO),
|
|
||||||
|_, _| None,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(move_grab) = seat.user_data().get::<SeatMoveGrabState>() {
|
if let Some(move_grab) = seat.user_data().get::<SeatMoveGrabState>() {
|
||||||
|
|
@ -611,9 +606,8 @@ impl Common {
|
||||||
);
|
);
|
||||||
if let Some(output) = primary_scanout_output {
|
if let Some(output) = primary_scanout_output {
|
||||||
with_fractional_scale(states, |fraction_scale| {
|
with_fractional_scale(states, |fraction_scale| {
|
||||||
fraction_scale.set_preferred_scale(
|
fraction_scale
|
||||||
output.current_scale().fractional_scale(),
|
.set_preferred_scale(output.current_scale().fractional_scale());
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -631,6 +625,7 @@ impl Common {
|
||||||
render_element_states,
|
render_element_states,
|
||||||
surface_primary_scanout_output,
|
surface_primary_scanout_output,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -650,15 +645,12 @@ impl Common {
|
||||||
output,
|
output,
|
||||||
states,
|
states,
|
||||||
render_element_states,
|
render_element_states,
|
||||||
|_current_output, _current_state, next_output, _next_state| {
|
|_current_output, _current_state, next_output, _next_state| next_output,
|
||||||
next_output
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
if let Some(output) = primary_scanout_output {
|
if let Some(output) = primary_scanout_output {
|
||||||
with_fractional_scale(states, |fraction_scale| {
|
with_fractional_scale(states, |fraction_scale| {
|
||||||
fraction_scale.set_preferred_scale(
|
fraction_scale
|
||||||
output.current_scale().fractional_scale(),
|
.set_preferred_scale(output.current_scale().fractional_scale());
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -677,22 +669,7 @@ impl Common {
|
||||||
surface_primary_scanout_output,
|
surface_primary_scanout_output,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
} else {
|
|
||||||
let output = seat.active_output();
|
|
||||||
self.shell
|
|
||||||
.workspaces
|
|
||||||
.sets
|
|
||||||
.get(&output)
|
|
||||||
.unwrap()
|
|
||||||
.sticky_layer
|
|
||||||
.mapped()
|
|
||||||
.for_each(|mapped| {
|
|
||||||
let window = mapped.active_window();
|
|
||||||
window.send_frame(&output, time, throttle, |_, _| None);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let active = self.shell.active_space(output);
|
let active = self.shell.active_space(output);
|
||||||
active.mapped().for_each(|mapped| {
|
active.mapped().for_each(|mapped| {
|
||||||
|
|
@ -732,12 +709,12 @@ impl Common {
|
||||||
for space in self
|
for space in self
|
||||||
.shell
|
.shell
|
||||||
.workspaces
|
.workspaces
|
||||||
.spaces()
|
.spaces_for_output(output)
|
||||||
.filter(|w| w.handle != active.handle)
|
.filter(|w| w.handle != active.handle)
|
||||||
{
|
{
|
||||||
space.mapped().for_each(|mapped| {
|
space.mapped().for_each(|mapped| {
|
||||||
let window = mapped.active_window();
|
let window = mapped.active_window();
|
||||||
window.send_frame(space.output(), time, throttle, |_, _| None);
|
window.send_frame(output, time, throttle, |_, _| None);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue