mirror of
https://github.com/marcoallegretti/WEFT_OS.git
synced 2026-03-27 01:13:09 +00:00
feat(protocol): add wl_surface arg to create_window in weft-shell-unstable-v1
Adds an optional (allow-null) wl_surface argument to zweft_shell_manager_v1::create_window. Shell-owned windows pass null; app-backed windows pass the backing wl_surface so the compositor can correlate the surface with a session_id from weft-appd. Updates WeftShellWindowData to store the surface, and updates the CreateWindow handler in state.rs and the two protocol unit tests.
This commit is contained in:
parent
ca2cc38d4d
commit
69d29ee3a8
3 changed files with 14 additions and 7 deletions
|
|
@ -28,6 +28,7 @@ pub struct WeftShellWindowData {
|
||||||
pub app_id: String,
|
pub app_id: String,
|
||||||
pub title: String,
|
pub title: String,
|
||||||
pub role: String,
|
pub role: String,
|
||||||
|
pub surface: Option<wayland_server::protocol::wl_surface::WlSurface>,
|
||||||
pub closed: std::sync::atomic::AtomicBool,
|
pub closed: std::sync::atomic::AtomicBool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -55,6 +56,7 @@ mod tests {
|
||||||
app_id: "com.example.test".into(),
|
app_id: "com.example.test".into(),
|
||||||
title: "Test Window".into(),
|
title: "Test Window".into(),
|
||||||
role: "normal".into(),
|
role: "normal".into(),
|
||||||
|
surface: None,
|
||||||
closed: std::sync::atomic::AtomicBool::new(false),
|
closed: std::sync::atomic::AtomicBool::new(false),
|
||||||
};
|
};
|
||||||
assert_eq!(d.app_id, "com.example.test");
|
assert_eq!(d.app_id, "com.example.test");
|
||||||
|
|
@ -69,6 +71,7 @@ mod tests {
|
||||||
app_id: String::new(),
|
app_id: String::new(),
|
||||||
title: String::new(),
|
title: String::new(),
|
||||||
role: String::new(),
|
role: String::new(),
|
||||||
|
surface: None,
|
||||||
closed: std::sync::atomic::AtomicBool::new(false),
|
closed: std::sync::atomic::AtomicBool::new(false),
|
||||||
};
|
};
|
||||||
assert!(!d.closed.load(Ordering::Relaxed));
|
assert!(!d.closed.load(Ordering::Relaxed));
|
||||||
|
|
|
||||||
|
|
@ -454,6 +454,7 @@ impl Dispatch<ZweftShellManagerV1, ()> for WeftCompositorState {
|
||||||
app_id,
|
app_id,
|
||||||
title,
|
title,
|
||||||
role,
|
role,
|
||||||
|
surface,
|
||||||
x,
|
x,
|
||||||
y,
|
y,
|
||||||
width,
|
width,
|
||||||
|
|
@ -465,6 +466,7 @@ impl Dispatch<ZweftShellManagerV1, ()> for WeftCompositorState {
|
||||||
app_id,
|
app_id,
|
||||||
title,
|
title,
|
||||||
role,
|
role,
|
||||||
|
surface,
|
||||||
closed: std::sync::atomic::AtomicBool::new(false),
|
closed: std::sync::atomic::AtomicBool::new(false),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,8 @@
|
||||||
summary="initial window title"/>
|
summary="initial window title"/>
|
||||||
<arg name="role" type="string"
|
<arg name="role" type="string"
|
||||||
summary="window role hint (normal, dialog, panel, overlay)"/>
|
summary="window role hint (normal, dialog, panel, overlay)"/>
|
||||||
|
<arg name="surface" type="object" interface="wl_surface" allow-null="true"
|
||||||
|
summary="wl_surface backing this window slot; null for shell-owned windows"/>
|
||||||
<arg name="x" type="int"
|
<arg name="x" type="int"
|
||||||
summary="requested x position in compositor logical coordinates"/>
|
summary="requested x position in compositor logical coordinates"/>
|
||||||
<arg name="y" type="int"
|
<arg name="y" type="int"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue