forge
Explore
Log in

Don't you dare go Hollow

niri

Clone
★ 0

0 watching0 forksRustGPL-3.012.1 MiB9d8f4f8Ivan Molodetskikh1 month ago2997 commits

remove_output.rs34 lines, 1.1 KiBHistoryRawDownload
1use super::*;
2
3#[test]
4fn set_fullscreen_on_removed_output_does_not_panic() {
5 let mut f = Fixture::new();
6 f.add_output(1, (1920, 1080));
7 f.add_output(2, (1280, 720));
8
9 let id = f.add_client();
10
11 let window = f.client(id).create_window();
12 let surface = window.surface.clone();
13 window.commit();
14 f.roundtrip(id);
15
16 let window = f.client(id).window(&surface);
17 window.attach_new_buffer();
18 window.set_size(100, 100);
19 window.ack_last_and_commit();
20 f.double_roundtrip(id);
21
22 // Grab the second output's wl_output proxy on the client side.
23 let wl_output = f.client(id).output("headless-2");
24
25 // Remove the output on the niri side. Its wl_output global is disabled but not yet
26 // destroyed, so the client's wl_output resource is still valid and usable.
27 let output = f.niri_output(2);
28 f.niri().remove_output(&output);
29
30 // Request fullscreen on the now-removed wl_output. niri must not panic.
31 let window = f.client(id).window(&surface);
32 window.set_fullscreen(Some(&wl_output));
33 f.double_roundtrip(id);
34}