feat: handle global removals, recalc output scale (#367)

All `GlobalRemove` events sent from the server are now handled by
recording them in a new clientside `vec` and passing the identifier
returned by `create_global` (now stored by a map in the state) to
`disable_global`. `handle_globals` (the top-level function) and
`handle_new_globals` (the `InnerServerState` member function) have
swapped names to better represent their new purposes.

This enables action to be taken when globals are removed. In this case,
the desired action is to forward output removal, so that the scaling
calculation does not account for disconnected monitors in its logic.

Resolves #351.
This commit is contained in:
En-En 2026-02-04 01:19:49 +00:00 committed by GitHub
parent 75c9f5e775
commit 0947c4685f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 153 additions and 33 deletions

View file

@ -319,7 +319,7 @@ impl Fixture {
fn create_output(&mut self, x: i32, y: i32) -> wayland_server::protocol::wl_output::WlOutput {
self.testwl.new_output(x, y);
self.wait_and_dispatch();
self.testwl.last_created_output()
self.testwl.finalize_output()
}
}
@ -2233,7 +2233,7 @@ fn xsettings_fractional_scale() {
let mut connection = Connection::new(&f.display);
f.testwl.enable_xdg_output_manager();
let output = f.testwl.last_created_output();
let output = f.testwl.finalize_output();
let window = connection.new_window(connection.root, 0, 0, 20, 20, false);
let surface = f.map_as_toplevel(&mut connection, window);