mirror of
https://github.com/VallierDev/uu-remote-linux.git
synced 2026-11-16 16:50:41 +01:00
X11: change the desktop resolution for the viewer's choice; survive live resizes (#86)
* Restart X11 capture at the new size when the desktop is resized mid-stream
A RandR resize during a session made x11grab fail with BadMatch on the old
size. read_encoder treated that as an encoder failure and walked the whole
fallback chain (NVENC -> CPU, HEVC -> H.264) with the stale size, then the
stream stopped ("Encoder output ended") and the viewer froze. New connections
already re-probed the geometry (#18); live ones did not.
- When an X11 stream fails and the root size differs, skip the encoder
fallback and restart capture at the new size with the same settings.
- Absolute pointer mapping follows the refreshed X11 size.
- New connections compare the root size with their capture instead of the
engine's change flag, which a live stream may already have consumed.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Change the X11 desktop resolution when the viewer picks one
The official Windows host changes its display resolution for the viewer's
分辨率 choice; this host only scaled the encoded stream, so a smaller choice
made text smaller and blurrier instead of larger.
On X11 the capture/resolution RPC now switches the primary output's mode with
xrandr (an existing mode of that size, else a CVT reduced-blanking mode at
60 Hz, or 30 Hz above an HDMI 2.0 pixel clock), re-applying it when mutter
resets the mode after the list changes. resolution_type 3 (original) and the
end of the last desktop stream restore the mode in use before the first
change. The stream restarts capture at the new native size and reports it in
the screen sources and CaptureSettingSync. UU_DESKTOP_RESIZE=0 keeps the old
encoder scaling; Wayland is unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: VallierDev <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
9 files changed
+297
-12
No files matched your search
+3
-1
@@ -5,6 +5,7 @@ mod engine_plugin;
|
||||
mod doctor;
|
||||
mod wol;
|
||||
mod desktop_backend;
|
||||
mod desktop_mode;
|
||||
mod desktop_session;
|
||||
mod desktop_power;
|
||||
mod portal;
|
||||
@@ -784,7 +785,8 @@ async fn serve(mut capture: Arc<ScreenCapture>, input: Arc<InputInjector>, shutd
|
||||
continue;
|
||||
}
|
||||
let resized=desktop && capture.init_error.is_none() && capture.backend==desktop_backend::DesktopBackend::X11
|
||||
&& tokio::task::spawn_blocking(crate::capture::x11_resized).await.unwrap_or(false);
|
||||
// Compare with this capture, not the engine: a live stream may already have refreshed it.
|
||||
&& tokio::task::spawn_blocking(crate::capture::x11_size).await.ok().flatten().is_some_and(|size| size!=(capture.width,capture.height));
|
||||
if resized { log::info!("Desktop geometry changed since startup; reinitializing capture"); }
|
||||
let session_capture=if desktop && portal_desktop.is_none() && (capture.init_error.is_some() || resized) {
|
||||
match tokio::task::spawn_blocking(ScreenCapture::new).await {
|
||||
|
||||
Reference in new issue
Block a user