voelin-ui: keep the studio to one stream and one window where needed
A session has one stream of ours: a quick share now refuses to start where the studio is live, as Go Live already refused where a share runs. Android runs one window, so the studio cannot be detached there (a wide tablet shows the desktop layout and its detach button). The studio's window sets the standard widgets' colour scheme from its theme, as the main window does, and the dialogs keep their fields under their labels. Headless screenshots also drop XDG_SESSION_TYPE: with it the push-to-talk hotkey (and screen capture) pick the desktop portal of the user's Wayland session even on Xvfb, which can ask the real desktop to bind a shortcut. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bbc0aa5c54
commit
06a4dd410b
6 files changed
+28
-4
No files matched your search
@@ -474,6 +474,11 @@ impl App {
|
||||
if self.share_busy || self.share.is_some() {
|
||||
return;
|
||||
}
|
||||
if self.studio_streams_to(session) {
|
||||
self.share_error = "The Stream Studio is live here: end that stream first.".into();
|
||||
self.refresh_streams();
|
||||
return;
|
||||
}
|
||||
// Typed values (no maximum), else the chosen presets.
|
||||
let choice = |i: i32, choices: &[u32]| {
|
||||
choices[usize::try_from(i).unwrap_or(0).min(choices.len() - 1)]
|
||||
|
||||
@@ -1007,6 +1007,7 @@ impl App {
|
||||
output_height: h as i32,
|
||||
fps: fps as i32,
|
||||
detached: st.window.is_some(),
|
||||
can_detach: cfg!(not(target_os = "android")),
|
||||
screen_shown: shows(|k| {
|
||||
matches!(
|
||||
k,
|
||||
@@ -1899,6 +1900,10 @@ impl App {
|
||||
// The window of its own.
|
||||
|
||||
pub(crate) fn studio_detach(&mut self) {
|
||||
// One window on Android.
|
||||
if cfg!(target_os = "android") {
|
||||
return;
|
||||
}
|
||||
if self.studio.window.is_none() {
|
||||
let window = match StudioWindow::new() {
|
||||
Ok(window) => window,
|
||||
|
||||
@@ -717,7 +717,7 @@ export component StudioHeader inherits HorizontalLayout {
|
||||
}
|
||||
}
|
||||
}
|
||||
IconButton {
|
||||
if StudioBridge.status.can-detach: IconButton {
|
||||
icon: StudioBridge.status.detached ? Icons.minimize-2 : Icons.external-link;
|
||||
label: StudioBridge.status.detached ? @tr("Back into the main window") : @tr("Open in its own window");
|
||||
y: (parent.height - self.height) / 2;
|
||||
@@ -1697,6 +1697,7 @@ component NumberField inherits VerticalLayout {
|
||||
in property <string> label;
|
||||
in-out property <string> value <=> field.text;
|
||||
in property <string> placeholder;
|
||||
alignment: start;
|
||||
spacing: Theme.space-1;
|
||||
Text {
|
||||
text: root.label;
|
||||
@@ -1720,11 +1721,12 @@ component SourceDialog inherits Modal {
|
||||
subtitle: adding ? @tr("Added to the live scene.") : @tr("Position, size and crop are in output pixels.");
|
||||
icon: StudioKinds.icon(form.kind);
|
||||
card-width: 560px;
|
||||
card-height: 680px;
|
||||
card-height: form.kind == "camera" ? 760px : form.kind == "text" || form.kind == "colour" || form.kind == "image" ? 640px : 560px;
|
||||
dismissed => { done(); }
|
||||
ScrollView {
|
||||
vertical-stretch: 1;
|
||||
VerticalLayout {
|
||||
alignment: start;
|
||||
spacing: Theme.space-4;
|
||||
padding-right: Theme.space-3;
|
||||
Field {
|
||||
@@ -2042,6 +2044,7 @@ component StudioSettingsDialog inherits Modal {
|
||||
ScrollView {
|
||||
vertical-stretch: 1;
|
||||
VerticalLayout {
|
||||
alignment: start;
|
||||
spacing: Theme.space-4;
|
||||
padding-right: Theme.space-3;
|
||||
Field {
|
||||
|
||||
@@ -112,6 +112,8 @@ export struct StudioStatus {
|
||||
output-height: int,
|
||||
fps: int,
|
||||
detached: bool,
|
||||
// A window of its own is possible (not on Android).
|
||||
can-detach: bool,
|
||||
// The live scene shows a screen, a camera, a window (the phone's cards).
|
||||
screen-shown: bool,
|
||||
camera-shown: bool,
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// compact; it has its own globals, which Rust fills from the same models
|
||||
// (src/studio.rs). Closing it docks the studio back into the main window.
|
||||
|
||||
import { Palette } from "std-widgets.slint";
|
||||
import { Theme } from "theme.slint";
|
||||
import { Icons } from "icons.slint";
|
||||
import { StudioBridge, StudioNav } from "studio-bridge.slint";
|
||||
@@ -20,6 +21,12 @@ export component StudioWindow inherits Window {
|
||||
default-font-size: Theme.font-body;
|
||||
icon: Icons.logo;
|
||||
|
||||
// Scroll bars and menus follow the theme (Rust copies the main
|
||||
// window's Theme here).
|
||||
property <bool> dark: Theme.dark;
|
||||
changed dark => { Palette.color-scheme = Theme.dark ? ColorScheme.dark : ColorScheme.light; }
|
||||
init => { Palette.color-scheme = Theme.dark ? ColorScheme.dark : ColorScheme.light; }
|
||||
|
||||
Rectangle {
|
||||
background: Theme.backdrop;
|
||||
VerticalLayout {
|
||||
|
||||
+4
-2
@@ -7,7 +7,9 @@
|
||||
# colours with `convert -colors 256 PNG8:`).
|
||||
#
|
||||
# WAYLAND_DISPLAY is removed so the window opens on the Xvfb server and not
|
||||
# on the desktop of a Wayland session (winit prefers Wayland when it can).
|
||||
# on the desktop of a Wayland session (winit prefers Wayland when it can),
|
||||
# and XDG_SESSION_TYPE so nothing picks the desktop portal for a Wayland
|
||||
# session (the push-to-talk hotkey would ask the desktop to bind it).
|
||||
# The screen is twice the window's size, so the pointer (in its middle) is
|
||||
# not over the window and nothing shows as hovered. FFmpeg stays off: the
|
||||
# pictures need no hardware encoders, and probing them can crash in some
|
||||
@@ -19,7 +21,7 @@ size=${3:-1440x960}
|
||||
w=${size%x*}
|
||||
h=${size#*x}
|
||||
bin=${VOELIN_BIN:-$CARGO_TARGET_DIR/debug/voelin}
|
||||
env -u WAYLAND_DISPLAY \
|
||||
env -u WAYLAND_DISPLAY -u XDG_SESSION_TYPE \
|
||||
SLINT_BACKEND=winit-software \
|
||||
VOELIN_FFMPEG=0 \
|
||||
VOELIN_DATA_DIR="$(mktemp -d)" \
|
||||
|
||||
Reference in new issue
Block a user