xwayland: allow windows to scale themselves
This commit is contained in:
parent
cc8db84289
commit
19b07fa7dc
40 changed files with 800 additions and 80 deletions
|
|
@ -135,7 +135,8 @@ impl WlSubsurface {
|
|||
v.pending.set(false);
|
||||
self.node.borrow_mut().replace(v);
|
||||
}
|
||||
if let Some((x, y)) = pending.position.take() {
|
||||
if let Some((mut x, mut y)) = pending.position.take() {
|
||||
client_wire_scale_to_logical!(self.surface.client, x, y);
|
||||
self.position
|
||||
.set(self.surface.buffer_abs_pos.get().at_point(x, y));
|
||||
let (parent_x, parent_y) = self.parent.buffer_abs_pos.get().position();
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ use {
|
|||
ifs::wl_surface::WlSurface,
|
||||
leaks::Tracker,
|
||||
object::{Object, Version},
|
||||
scale::Scale,
|
||||
utils::cell_ext::CellExt,
|
||||
wire::{wp_fractional_scale_v1::*, WpFractionalScaleV1Id},
|
||||
},
|
||||
std::rc::Rc,
|
||||
|
|
@ -38,17 +40,13 @@ impl WpFractionalScaleV1 {
|
|||
}
|
||||
|
||||
pub fn send_preferred_scale(&self) {
|
||||
let scale = match self.client.wire_scale.is_some() {
|
||||
true => Scale::from_int(1),
|
||||
false => self.surface.output.get().global.persistent.scale.get(),
|
||||
};
|
||||
self.client.event(PreferredScale {
|
||||
self_id: self.id,
|
||||
scale: self
|
||||
.surface
|
||||
.output
|
||||
.get()
|
||||
.global
|
||||
.persistent
|
||||
.scale
|
||||
.get()
|
||||
.to_wl(),
|
||||
scale: scale.to_wl(),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,13 +140,12 @@ pub struct Xwindow {
|
|||
|
||||
impl XwindowData {
|
||||
pub fn new(state: &Rc<State>, event: &CreateNotify, client: &Rc<Client>) -> Self {
|
||||
let extents = Rect::new_sized(
|
||||
event.x as _,
|
||||
event.y as _,
|
||||
event.width as _,
|
||||
event.height as _,
|
||||
)
|
||||
.unwrap();
|
||||
let mut x = event.x as i32;
|
||||
let mut y = event.y as i32;
|
||||
let mut width = event.width as i32;
|
||||
let mut height = event.height as i32;
|
||||
client_wire_scale_to_logical!(client, x, y, width, height);
|
||||
let extents = Rect::new_sized(x, y, width, height).unwrap();
|
||||
// log::info!("xwin {} new {:?} or {}", event.window, extents, event.override_redirect);
|
||||
Self {
|
||||
state: state.clone(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue