wayland: implement scaling
This involves many subsystems:
- config:
- allow setting the connector scale
- allow setting the cursor size
- cursors:
- load server cursors for all requested sizes and scales
- wl_surface:
- track the output the surface belongs to
- send wl_surface.enter/leave
- wl_output:
- implement wl_output.scale
- text:
- pre-render texts for all used scales
- renderer:
- properly align scale textures and rectangles
- wp_fractional_scale:
- new interface for fractional scaling
This commit is contained in:
parent
16aec8f87e
commit
e52a60b3b6
41 changed files with 1417 additions and 364 deletions
|
|
@ -4,6 +4,7 @@ use {
|
|||
ifs::{
|
||||
wl_output::OutputId,
|
||||
wl_seat::{NodeSeatState, WlSeatGlobal},
|
||||
wl_surface::SurfaceSendPreferredScaleVisitor,
|
||||
},
|
||||
rect::Rect,
|
||||
render::Renderer,
|
||||
|
|
@ -16,7 +17,7 @@ use {
|
|||
linkedlist::{LinkedList, LinkedNode},
|
||||
},
|
||||
},
|
||||
std::{cell::Cell, fmt::Debug, rc::Rc},
|
||||
std::{cell::Cell, fmt::Debug, ops::Deref, rc::Rc},
|
||||
};
|
||||
|
||||
tree_id!(WorkspaceNodeId);
|
||||
|
|
@ -44,6 +45,17 @@ impl WorkspaceNode {
|
|||
self.fullscreen.set(None);
|
||||
}
|
||||
|
||||
pub fn set_output(&self, output: &Rc<OutputNode>) {
|
||||
let old = self.output.set(output.clone());
|
||||
if old.preferred_scale.get() != output.preferred_scale.get() {
|
||||
let mut visitor = SurfaceSendPreferredScaleVisitor(output.preferred_scale.get());
|
||||
self.node_visit_children(&mut visitor);
|
||||
for stacked in self.stacked.iter() {
|
||||
stacked.deref().clone().node_visit(&mut visitor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_container(self: &Rc<Self>, container: &Rc<ContainerNode>) {
|
||||
let pos = self.position.get();
|
||||
container.clone().tl_change_extents(&pos);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue