Actually properly offset popups on offset outputs

Also update window positions when output positon changes.
This commit is contained in:
Shawn Wallace 2024-07-04 14:57:07 -04:00
parent 3794c4b945
commit ece5d1bd10
6 changed files with 208 additions and 118 deletions

View file

@ -502,9 +502,15 @@ impl Server {
self.display.flush_clients().unwrap();
}
pub fn move_surface_to_output(&mut self, surface: SurfaceId, output: WlOutput) {
pub fn move_output(&mut self, output: &WlOutput, x: i32, y: i32) {
output.geometry(x, y, 0, 0, wl_output::Subpixel::None, "".into(), "".into(), wl_output::Transform::Normal);
output.done();
self.display.flush_clients().unwrap();
}
pub fn move_surface_to_output(&mut self, surface: SurfaceId, output: &WlOutput) {
let data = self.state.surfaces.get(&surface).expect("No such surface");
data.surface.enter(&output);
data.surface.enter(output);
self.display.flush_clients().unwrap();
}
}