tree: move output scale to global
This commit is contained in:
parent
0ba8648844
commit
d4fc672fb3
11 changed files with 16 additions and 17 deletions
|
|
@ -74,6 +74,7 @@ pub struct WlOutputGlobal {
|
|||
pub pending_captures: LinkedList<Rc<ZwlrScreencopyFrameV1>>,
|
||||
pub destroyed: Cell<bool>,
|
||||
pub legacy_scale: Cell<u32>,
|
||||
pub preferred_scale: Cell<crate::scale::Scale>,
|
||||
}
|
||||
|
||||
#[derive(Eq, PartialEq)]
|
||||
|
|
@ -120,6 +121,7 @@ impl WlOutputGlobal {
|
|||
pending_captures: Default::default(),
|
||||
destroyed: Cell::new(false),
|
||||
legacy_scale: Cell::new(1),
|
||||
preferred_scale: Cell::new(crate::scale::Scale::from_int(1)),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ impl WlSeatGlobal {
|
|||
for output in self.state.root.outputs.lock().values() {
|
||||
if let Some(hc) = output.hardware_cursor.get() {
|
||||
let render = render | output.hardware_cursor_needs_render.take();
|
||||
let scale = output.preferred_scale.get();
|
||||
let scale = output.global.preferred_scale.get();
|
||||
let extents = cursor.extents_at_scale(scale);
|
||||
if render {
|
||||
let (max_width, max_height) = hc.max_size();
|
||||
|
|
|
|||
|
|
@ -438,7 +438,7 @@ impl WlSurface {
|
|||
}
|
||||
output.global.send_enter(self);
|
||||
old.global.send_leave(self);
|
||||
if old.preferred_scale.get() != output.preferred_scale.get() {
|
||||
if old.global.preferred_scale.get() != output.global.preferred_scale.get() {
|
||||
self.on_scale_change();
|
||||
}
|
||||
let children = self.children.borrow_mut();
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ impl WpFractionalScaleV1 {
|
|||
pub fn send_preferred_scale(&self) {
|
||||
self.client.event(PreferredScale {
|
||||
self_id: self.id,
|
||||
scale: self.surface.output.get().preferred_scale.get().0,
|
||||
scale: self.surface.output.get().global.preferred_scale.get().0,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue