From e2c8a7605d51ae741474dc3ee680ec042463a911 Mon Sep 17 00:00:00 2001 From: ShootingStarDragons Date: Fri, 21 Mar 2025 20:43:00 +0900 Subject: [PATCH 1/2] chore: expose capture_output_frame_get_state_shm I want to expose it for xdg-desktop-portal to find the right format of the video --- libwayshot/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libwayshot/src/lib.rs b/libwayshot/src/lib.rs index b43c8b45..f94a639a 100644 --- a/libwayshot/src/lib.rs +++ b/libwayshot/src/lib.rs @@ -452,7 +452,11 @@ impl WayshotConnection { } } - fn capture_output_frame_get_state_shm( + /// We expose this api to let user can get the information of the wm. For example, when enable + /// the feature of vulkan on wlroots, the format will change, then if we use pipewire to get + /// stream, without knowing the current showing format, the color will become strange + /// This function just try to do a try screenshot, then get the information of screen + pub fn capture_output_frame_get_state_shm( &self, cursor_overlay: i32, output: &WlOutput, From dc849730ce6d876a7e1d9b94677fab03f253206c Mon Sep 17 00:00:00 2001 From: Shinyzenith Date: Sat, 22 Mar 2025 16:57:31 +0530 Subject: [PATCH 2/2] docs: update comment Signed-off-by: Shinyzenith --- libwayshot/src/lib.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libwayshot/src/lib.rs b/libwayshot/src/lib.rs index f94a639a..fc41db3c 100644 --- a/libwayshot/src/lib.rs +++ b/libwayshot/src/lib.rs @@ -452,10 +452,11 @@ impl WayshotConnection { } } - /// We expose this api to let user can get the information of the wm. For example, when enable - /// the feature of vulkan on wlroots, the format will change, then if we use pipewire to get - /// stream, without knowing the current showing format, the color will become strange - /// This function just try to do a try screenshot, then get the information of screen + // This API is exposed to provide users with access to window manager (WM) + // information. For instance, enabling Vulkan in wlroots alters the display + // format. Consequently, using PipeWire to capture streams without knowing + // the current format can lead to color distortion. This function attempts + // a trial screenshot to determine the screen's properties. pub fn capture_output_frame_get_state_shm( &self, cursor_overlay: i32,