Upgrade Smithay to pinned upstream Git
Pin 8a270232f1bfc416c781273c98a3f52a812a0bba and adapt protocol dispatch, input timestamps, configure state and rendering APIs. Preserve custom lock and toplevel validation, compositor-owned key repeats, and valid layer remapping sequences. Add native icon-buffer lifecycle regressions for the GoLand and Spotify launch failure.
This commit is contained in:
1 parent
17df20089b
commit
90879145b2
44 files changed
+1069
-634
No files matched your search
@@ -850,6 +850,7 @@ mod tests {
|
||||
let output = Output::new(
|
||||
"pause-test".into(),
|
||||
smithay::output::PhysicalProperties {
|
||||
serial_number: String::new(),
|
||||
size: (0, 0).into(),
|
||||
subpixel: smithay::output::Subpixel::Unknown,
|
||||
make: "test".into(),
|
||||
|
||||
@@ -86,13 +86,21 @@ pub(crate) fn window(state: &mut Ferese, events: &mut EventLoop<'static, Ferese>
|
||||
.insert_client(server, Arc::new(ClientState::default()))
|
||||
.unwrap();
|
||||
let compositor = client
|
||||
.create_resource::<WlCompositor, (), Ferese>(&state.display_handle, 6, ())
|
||||
.create_resource::<WlCompositor, smithay::wayland::GlobalData, Ferese>(
|
||||
&state.display_handle,
|
||||
6,
|
||||
smithay::wayland::GlobalData,
|
||||
)
|
||||
.unwrap();
|
||||
let shell = client
|
||||
.create_resource::<XdgWmBase, XdgWmBaseUserData, Ferese>(&state.display_handle, 6, Default::default())
|
||||
.unwrap();
|
||||
let shm = client
|
||||
.create_resource::<WlShm, (), Ferese>(&state.display_handle, 1, ())
|
||||
.create_resource::<WlShm, smithay::wayland::GlobalData, Ferese>(
|
||||
&state.display_handle,
|
||||
1,
|
||||
smithay::wayland::GlobalData,
|
||||
)
|
||||
.unwrap();
|
||||
request(&mut wire, compositor.id().protocol_id(), 0, &[2], None);
|
||||
request(&mut wire, shell.id().protocol_id(), 2, &[3, 2], None);
|
||||
@@ -141,10 +149,18 @@ fn attach_children(
|
||||
use smithay::reexports::wayland_server::protocol::wl_subcompositor::WlSubcompositor;
|
||||
let client = window.toplevel().unwrap().wl_surface().client().unwrap();
|
||||
let compositor = client
|
||||
.create_resource::<WlCompositor, (), Ferese>(&state.display_handle, 6, ())
|
||||
.create_resource::<WlCompositor, smithay::wayland::GlobalData, Ferese>(
|
||||
&state.display_handle,
|
||||
6,
|
||||
smithay::wayland::GlobalData,
|
||||
)
|
||||
.unwrap();
|
||||
let subcompositor = client
|
||||
.create_resource::<WlSubcompositor, (), Ferese>(&state.display_handle, 1, ())
|
||||
.create_resource::<WlSubcompositor, smithay::wayland::GlobalData, Ferese>(
|
||||
&state.display_handle,
|
||||
1,
|
||||
smithay::wayland::GlobalData,
|
||||
)
|
||||
.unwrap();
|
||||
request(wire, compositor.id().protocol_id(), 0, &[7], None);
|
||||
request(wire, subcompositor.id().protocol_id(), 1, &[8, 7, 2], None);
|
||||
@@ -242,6 +258,7 @@ fn lock_scene_draws_the_pointer_and_delivers_client_cursor_frames() {
|
||||
let output = Output::new(
|
||||
"lock-cursor".into(),
|
||||
PhysicalProperties {
|
||||
serial_number: String::new(),
|
||||
size: (0, 0).into(),
|
||||
subpixel: Subpixel::Unknown,
|
||||
make: "test".into(),
|
||||
@@ -266,7 +283,11 @@ fn lock_scene_draws_the_pointer_and_delivers_client_cursor_frames() {
|
||||
let (desktop, mut wire) = window(&mut state, &mut events, 0xffff0000);
|
||||
let client = desktop.toplevel().unwrap().wl_surface().client().unwrap();
|
||||
let manager = client
|
||||
.create_resource::<ExtSessionLockManagerV1, (), Ferese>(&state.display_handle, 1, ())
|
||||
.create_resource::<ExtSessionLockManagerV1, smithay::wayland::GlobalData, Ferese>(
|
||||
&state.display_handle,
|
||||
1,
|
||||
smithay::wayland::GlobalData,
|
||||
)
|
||||
.unwrap();
|
||||
request(&mut wire, manager.id().protocol_id(), 1, &[7], None);
|
||||
let deadline = std::time::Instant::now() + Duration::from_secs(1);
|
||||
@@ -311,7 +332,11 @@ fn lock_scene_draws_the_pointer_and_delivers_client_cursor_frames() {
|
||||
}
|
||||
|
||||
let compositor = client
|
||||
.create_resource::<WlCompositor, (), Ferese>(&state.display_handle, 6, ())
|
||||
.create_resource::<WlCompositor, smithay::wayland::GlobalData, Ferese>(
|
||||
&state.display_handle,
|
||||
6,
|
||||
smithay::wayland::GlobalData,
|
||||
)
|
||||
.unwrap();
|
||||
request(&mut wire, compositor.id().protocol_id(), 0, &[8], None);
|
||||
request(&mut wire, 8, 1, &[6, 0, 0], None);
|
||||
@@ -388,6 +413,7 @@ fn capture_privacy_pixels_and_policy_transitions() {
|
||||
let output = Output::new(
|
||||
"privacy".into(),
|
||||
PhysicalProperties {
|
||||
serial_number: String::new(),
|
||||
size: (0, 0).into(),
|
||||
subpixel: Subpixel::Unknown,
|
||||
make: "test".into(),
|
||||
@@ -563,6 +589,7 @@ fn capture_privacy_pixels_and_policy_transitions() {
|
||||
let second = Output::new(
|
||||
"second".into(),
|
||||
PhysicalProperties {
|
||||
serial_number: String::new(),
|
||||
size: (0, 0).into(),
|
||||
subpixel: Subpixel::Unknown,
|
||||
make: "test".into(),
|
||||
@@ -649,7 +676,11 @@ fn capture_privacy_pixels_and_policy_transitions() {
|
||||
use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface;
|
||||
let client = secret.toplevel().unwrap().wl_surface().client().unwrap();
|
||||
let compositor = client
|
||||
.create_resource::<WlCompositor, (), Ferese>(&state.display_handle, 6, ())
|
||||
.create_resource::<WlCompositor, smithay::wayland::GlobalData, Ferese>(
|
||||
&state.display_handle,
|
||||
6,
|
||||
smithay::wayland::GlobalData,
|
||||
)
|
||||
.unwrap();
|
||||
request(&mut secret_wire, compositor.id().protocol_id(), 0, &[13], None);
|
||||
request(&mut secret_wire, 13, 1, &[6, 0, 0], None);
|
||||
@@ -756,6 +787,7 @@ fn resize_dependencies_protocol_and_pixels() {
|
||||
let output = Output::new(
|
||||
"resize".into(),
|
||||
PhysicalProperties {
|
||||
serial_number: String::new(),
|
||||
size: (0, 0).into(),
|
||||
subpixel: Subpixel::Unknown,
|
||||
make: "test".into(),
|
||||
@@ -944,7 +976,11 @@ fn resize_dependencies_protocol_and_pixels() {
|
||||
assert_ne!(state.viewports[&workspace].motion().current, frozen);
|
||||
let client = b.toplevel().unwrap().wl_surface().client().unwrap();
|
||||
let shm = client
|
||||
.create_resource::<WlShm, (), Ferese>(&state.display_handle, 1, ())
|
||||
.create_resource::<WlShm, smithay::wayland::GlobalData, Ferese>(
|
||||
&state.display_handle,
|
||||
1,
|
||||
smithay::wayland::GlobalData,
|
||||
)
|
||||
.unwrap();
|
||||
let mut resized = tempfile::tempfile().unwrap();
|
||||
resized.write_all(&0xff00ff00u32.to_ne_bytes().repeat(32 * 48)).unwrap();
|
||||
|
||||
@@ -150,6 +150,7 @@ mod tests {
|
||||
let output = Output::new(
|
||||
"focus".into(),
|
||||
smithay::output::PhysicalProperties {
|
||||
serial_number: String::new(),
|
||||
size: (0, 0).into(),
|
||||
subpixel: smithay::output::Subpixel::Unknown,
|
||||
make: "test".into(),
|
||||
|
||||
@@ -216,8 +216,8 @@ mod tests {
|
||||
struct TestButton(ButtonState);
|
||||
|
||||
impl Event<TestInput> for TestButton {
|
||||
fn time(&self) -> u64 {
|
||||
1_000
|
||||
fn time(&self) -> smithay::backend::input::InputTime {
|
||||
smithay::backend::input::InputTime::from_micros(1_000)
|
||||
}
|
||||
fn device(&self) -> WinitVirtualDevice {
|
||||
WinitVirtualDevice
|
||||
@@ -241,7 +241,7 @@ mod tests {
|
||||
&MotionEvent {
|
||||
location: position,
|
||||
serial: SERIAL_COUNTER.next_serial(),
|
||||
time: 1,
|
||||
time: smithay::backend::input::InputTime::from_millis(1),
|
||||
},
|
||||
);
|
||||
pointer.frame(state);
|
||||
@@ -268,6 +268,7 @@ mod tests {
|
||||
let output = Output::new(
|
||||
name.into(),
|
||||
smithay::output::PhysicalProperties {
|
||||
serial_number: String::new(),
|
||||
size: (0, 0).into(),
|
||||
subpixel: smithay::output::Subpixel::Unknown,
|
||||
make: "test".into(),
|
||||
|
||||
@@ -33,6 +33,7 @@ fn every_panel_style_owns_clearance_at_its_reserved_edge() {
|
||||
let output = Output::new(
|
||||
"clearance".into(),
|
||||
PhysicalProperties {
|
||||
serial_number: String::new(),
|
||||
size: (0, 0).into(),
|
||||
subpixel: Subpixel::Unknown,
|
||||
make: "test".into(),
|
||||
@@ -60,10 +61,18 @@ fn every_panel_style_owns_clearance_at_its_reserved_edge() {
|
||||
.insert_client(server, Arc::new(ClientState::default()))
|
||||
.unwrap();
|
||||
let compositor = client
|
||||
.create_resource::<WlCompositor, (), Ferese>(&state.display_handle, 6, ())
|
||||
.create_resource::<WlCompositor, smithay::wayland::GlobalData, Ferese>(
|
||||
&state.display_handle,
|
||||
6,
|
||||
smithay::wayland::GlobalData,
|
||||
)
|
||||
.unwrap();
|
||||
let layers = client
|
||||
.create_resource::<ZwlrLayerShellV1, (), Ferese>(&state.display_handle, 4, ())
|
||||
.create_resource::<ZwlrLayerShellV1, smithay::wayland::GlobalData, Ferese>(
|
||||
&state.display_handle,
|
||||
4,
|
||||
smithay::wayland::GlobalData,
|
||||
)
|
||||
.unwrap();
|
||||
request(&mut wire, compositor.id().protocol_id(), 0, &[2]);
|
||||
let mut namespace = b"ferese-shell-top-bar\0".to_vec();
|
||||
|
||||
@@ -427,6 +427,7 @@ mod tests {
|
||||
let output = Output::new(
|
||||
"resize-idle".into(),
|
||||
smithay::output::PhysicalProperties {
|
||||
serial_number: String::new(),
|
||||
size: (0, 0).into(),
|
||||
subpixel: smithay::output::Subpixel::Unknown,
|
||||
make: "test".into(),
|
||||
@@ -548,6 +549,7 @@ mod tests {
|
||||
let output = Output::new(
|
||||
format!("focus-{index}"),
|
||||
smithay::output::PhysicalProperties {
|
||||
serial_number: String::new(),
|
||||
size: (0, 0).into(),
|
||||
subpixel: smithay::output::Subpixel::Unknown,
|
||||
make: "test".into(),
|
||||
@@ -657,6 +659,7 @@ mod tests {
|
||||
let output = Output::new(
|
||||
"overview-slide-test".into(),
|
||||
smithay::output::PhysicalProperties {
|
||||
serial_number: String::new(),
|
||||
size: (0, 0).into(),
|
||||
subpixel: smithay::output::Subpixel::Unknown,
|
||||
make: "test".into(),
|
||||
@@ -780,6 +783,7 @@ mod tests {
|
||||
let output = Output::new(
|
||||
"forecast-test".into(),
|
||||
smithay::output::PhysicalProperties {
|
||||
serial_number: String::new(),
|
||||
size: (0, 0).into(),
|
||||
subpixel: smithay::output::Subpixel::Unknown,
|
||||
make: "test".into(),
|
||||
@@ -829,6 +833,7 @@ mod tests {
|
||||
let other = Output::new(
|
||||
"other-forecast".into(),
|
||||
smithay::output::PhysicalProperties {
|
||||
serial_number: String::new(),
|
||||
size: (0, 0).into(),
|
||||
subpixel: smithay::output::Subpixel::Unknown,
|
||||
make: "test".into(),
|
||||
|
||||
@@ -214,6 +214,7 @@ mod tests {
|
||||
output: Output::new(
|
||||
name.into(),
|
||||
PhysicalProperties {
|
||||
serial_number: String::new(),
|
||||
size: (0, 0).into(),
|
||||
subpixel: Subpixel::Unknown,
|
||||
make: "test".into(),
|
||||
@@ -250,7 +251,11 @@ mod tests {
|
||||
.insert_client(server, Arc::new(ClientState::default()))
|
||||
.unwrap();
|
||||
let compositor = client
|
||||
.create_resource::<WlCompositor, (), Ferese>(&state.display_handle, 6, ())
|
||||
.create_resource::<WlCompositor, smithay::wayland::GlobalData, Ferese>(
|
||||
&state.display_handle,
|
||||
6,
|
||||
smithay::wayland::GlobalData,
|
||||
)
|
||||
.unwrap();
|
||||
let shell = client
|
||||
.create_resource::<XdgWmBase, XdgWmBaseUserData, Ferese>(&state.display_handle, 6, Default::default())
|
||||
@@ -519,7 +524,11 @@ mod tests {
|
||||
.insert_client(server, Arc::new(ClientState::default()))
|
||||
.unwrap();
|
||||
let lock = client
|
||||
.create_resource::<ExtSessionLockManagerV1, (), Ferese>(&state.display_handle, 1, ())
|
||||
.create_resource::<ExtSessionLockManagerV1, smithay::wayland::GlobalData, Ferese>(
|
||||
&state.display_handle,
|
||||
1,
|
||||
smithay::wayland::GlobalData,
|
||||
)
|
||||
.unwrap();
|
||||
request(&mut lock_wire, lock.id().protocol_id(), 1, &[2]);
|
||||
event_loop.dispatch(Duration::from_millis(10), &mut state).unwrap();
|
||||
|
||||
@@ -11,6 +11,7 @@ fn fixture() -> (smithay::reexports::calloop::EventLoop<'static, Ferese>, Ferese
|
||||
let output = Output::new(
|
||||
"test".into(),
|
||||
smithay::output::PhysicalProperties {
|
||||
serial_number: String::new(),
|
||||
size: (0, 0).into(),
|
||||
subpixel: smithay::output::Subpixel::Unknown,
|
||||
make: "test".into(),
|
||||
@@ -778,7 +779,11 @@ fn floating_maximize_and_restore_work_in_both_layouts() {
|
||||
use std::os::fd::AsRawFd;
|
||||
let client = window.toplevel().unwrap().wl_surface().client().unwrap();
|
||||
let shm = client
|
||||
.create_resource::<WlShm, (), Ferese>(&state.display_handle, 1, ())
|
||||
.create_resource::<WlShm, smithay::wayland::GlobalData, Ferese>(
|
||||
&state.display_handle,
|
||||
1,
|
||||
smithay::wayland::GlobalData,
|
||||
)
|
||||
.unwrap();
|
||||
let (width, height) = (maximized.width.round() as u32, maximized.height.round() as u32);
|
||||
let mut file = tempfile::tempfile().unwrap();
|
||||
@@ -803,14 +808,9 @@ fn floating_maximize_and_restore_work_in_both_layouts() {
|
||||
next_object += 2;
|
||||
request(&mut wire, 2, 6, &[], None);
|
||||
dispatch(&mut events, &mut state);
|
||||
assert!(
|
||||
window
|
||||
.toplevel()
|
||||
.unwrap()
|
||||
.current_state()
|
||||
.states
|
||||
.contains(xdg_toplevel::State::Maximized)
|
||||
);
|
||||
assert!(window.toplevel().unwrap().with_committed_state(|state| {
|
||||
state.is_some_and(|state| state.states.contains(xdg_toplevel::State::Maximized))
|
||||
}));
|
||||
|
||||
state.set_window_maximized(id, false);
|
||||
assert_eq!(state.windows.geometry(&id).unwrap().logical, normal, "{mode:?}");
|
||||
@@ -820,14 +820,9 @@ fn floating_maximize_and_restore_work_in_both_layouts() {
|
||||
request(&mut wire, 2, 1, &[6, 0, 0], None);
|
||||
request(&mut wire, 2, 6, &[], None);
|
||||
dispatch(&mut events, &mut state);
|
||||
assert!(
|
||||
!window
|
||||
.toplevel()
|
||||
.unwrap()
|
||||
.current_state()
|
||||
.states
|
||||
.contains(xdg_toplevel::State::Maximized)
|
||||
);
|
||||
assert!(!window.toplevel().unwrap().with_committed_state(|state| {
|
||||
state.is_some_and(|state| state.states.contains(xdg_toplevel::State::Maximized))
|
||||
}));
|
||||
assert_eq!(
|
||||
state.workspaces.placement(id),
|
||||
Some(WindowPlacement::Floating { rect: normal })
|
||||
@@ -846,7 +841,7 @@ fn malformed_resize_limits_disconnect_only_the_client_and_motion_survives() {
|
||||
|
||||
let (mut events, mut state, _) = fixture();
|
||||
for (minimum, maximum) in [
|
||||
((800, 0), (400, 0)),
|
||||
((800i32, 0), (400, 0)),
|
||||
((0, 800), (0, 400)),
|
||||
((-1, 0), (0, 0)),
|
||||
((0, 0), (-1, 0)),
|
||||
@@ -883,10 +878,14 @@ fn malformed_resize_limits_disconnect_only_the_client_and_motion_survives() {
|
||||
&MotionEvent {
|
||||
location: (120.0, 130.0).into(),
|
||||
serial: SERIAL_COUNTER.next_serial(),
|
||||
time: 1,
|
||||
time: smithay::backend::input::InputTime::from_millis(1),
|
||||
},
|
||||
);
|
||||
pointer.unset_grab(&mut state, SERIAL_COUNTER.next_serial(), 2);
|
||||
pointer.unset_grab(
|
||||
&mut state,
|
||||
SERIAL_COUNTER.next_serial(),
|
||||
smithay::backend::input::InputTime::from_millis(2),
|
||||
);
|
||||
wire.set_nonblocking(true).unwrap();
|
||||
let mut messages = Vec::new();
|
||||
let _ = wire.read_to_end(&mut messages);
|
||||
@@ -1310,6 +1309,7 @@ fn shell_can_move_a_window_to_the_current_workspace_on_another_output() {
|
||||
let second = Output::new(
|
||||
"second".into(),
|
||||
smithay::output::PhysicalProperties {
|
||||
serial_number: String::new(),
|
||||
size: (0, 0).into(),
|
||||
subpixel: smithay::output::Subpixel::Unknown,
|
||||
make: "test".into(),
|
||||
|
||||
@@ -531,11 +531,8 @@ impl Ferese {
|
||||
return;
|
||||
};
|
||||
|
||||
let serial = with_states(surface, |states| {
|
||||
states
|
||||
.data_map
|
||||
.get::<XdgToplevelSurfaceData>()
|
||||
.and_then(|data| data.lock().ok().and_then(|data| data.current_serial))
|
||||
let serial = window.toplevel().and_then(|toplevel| {
|
||||
toplevel.with_cached_state(|state| state.last_acked.as_ref().map(|configure| configure.serial))
|
||||
});
|
||||
if !transaction.accepts(serial) {
|
||||
return;
|
||||
@@ -601,15 +598,10 @@ impl Ferese {
|
||||
let Some(&id) = self.windows.ids().get(window) else {
|
||||
return;
|
||||
};
|
||||
// current_serial is promoted by Smithay on commit, unlike
|
||||
// configure_serial, which only records an acknowledgement.
|
||||
// Read the acknowledgement attached to this commit, not a newer ack
|
||||
// that arrived without its corresponding buffer.
|
||||
let committed_serial = window.toplevel().and_then(|toplevel| {
|
||||
with_states(toplevel.wl_surface(), |states| {
|
||||
states
|
||||
.data_map
|
||||
.get::<XdgToplevelSurfaceData>()
|
||||
.and_then(|data| data.lock().ok().and_then(|data| data.current_serial))
|
||||
})
|
||||
toplevel.with_cached_state(|state| state.last_acked.as_ref().map(|configure| configure.serial))
|
||||
});
|
||||
if self
|
||||
.windows
|
||||
@@ -687,14 +679,17 @@ impl Ferese {
|
||||
// Never let an old buffer undo a newer resize or a fullscreen transition.
|
||||
self.windows.update(id, |w| w.placement_anchor = None);
|
||||
let settled_configure = window.toplevel().is_some_and(|toplevel| {
|
||||
let committed = toplevel.with_cached_state(|state| state.last_acked.clone());
|
||||
with_states(toplevel.wl_surface(), |states| {
|
||||
states.data_map.get::<XdgToplevelSurfaceData>().is_some_and(|data| {
|
||||
let Ok(data) = data.lock() else { return false };
|
||||
floating_commit_is_current(
|
||||
data.pending_configures().is_empty(),
|
||||
data.current_serial,
|
||||
data.configure_serial,
|
||||
data.current.states.contains(xdg_toplevel::State::Resizing),
|
||||
committed.as_ref().map(|configure| configure.serial),
|
||||
data.last_acked.as_ref().map(|configure| configure.serial),
|
||||
committed
|
||||
.as_ref()
|
||||
.is_some_and(|configure| configure.state.states.contains(xdg_toplevel::State::Resizing)),
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user