Skip to content

Commit 5e39d17

Browse files
committed
Add support of virtual monitor
1 parent d4d6992 commit 5e39d17

33 files changed

Lines changed: 2602 additions & 1486 deletions

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ daemon ship together under one version.
88

99
### Added
1010

11+
- Cast a **new monitor** instead of mirroring one you already have. A toggle
12+
above the device list switches between *Mirror screen* and *New monitor*; in
13+
the second mode the desktop gains an extra display, sized to what the receiver
14+
accepts, that exists only for as long as the cast. The television becomes a
15+
real second screen you can drag windows onto rather than a copy of your laptop
16+
panel, and it is no longer letterboxed to fit it. Needs a Wayland session -
17+
GNOME on Xorg cannot create a monitor, so the toggle is hidden there.
18+
*Choose what to cast* also lists GNOME's own Virtual Monitor option now.
1119
- Eleven more interface languages: Arabic, Bengali, Bulgarian, Chinese
1220
(Simplified), French, Hindi, Indonesian, Portuguese (Brazil), Russian,
1321
Spanish and Urdu.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# GNOME Shell Cast
22

3-
Cast your **whole screen or a single window** to a **Chromecast** device, or send your **system audio** to a Chromecast speaker, smart display, or cast group, right from the GNOME Shell top panel.
3+
Cast your **whole screen or a single window** to a **Chromecast** device, add a **new monitor** and cast that instead, or send your **system audio** to a Chromecast speaker, smart display, or cast group, right from the GNOME Shell top panel.
44

55
The project has two parts, shipped together in this repository:
66

@@ -29,7 +29,7 @@ The two talk over the D-Bus session bus (`org.gnome.ShellCast1`). The daemon is
2929

3030
Chromecast's Default Media Receiver plays media it pulls over HTTP. When you start a cast:
3131

32-
1. The daemon opens an XDG ScreenCast portal session - GNOME shows its native picker for a monitor or a window.
32+
1. The daemon opens an XDG ScreenCast portal session - GNOME shows its native picker for a monitor or a window. In *New monitor* mode it asks the portal for a **virtual monitor** instead: GNOME creates an extra display for the cast and removes it again when the cast ends, so nothing on your own screens changes. Move windows onto it with `Super`+`Shift`+arrow; until you do, the television shows an empty desktop. This mode needs a Wayland session.
3333
2. A GStreamer pipeline captures the PipeWire stream, encodes H.264 video and AAC system audio, and writes a live HLS stream into `$XDG_RUNTIME_DIR/gnome-shell-cast/`.
3434
3. A tiny built-in HTTP server serves that stream on your LAN.
3535
4. The daemon tells the Chromecast (CASTv2 protocol) to play the stream URL.

TROUBLESHOOTING.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,38 @@ The receiver app exited or never started rendering. Check the log for
245245
[The cast falls back to HLS](#the-cast-falls-back-to-hls-or-the-receiver-never-answers)
246246
below.
247247

248+
### "New monitor" is missing from the menu
249+
250+
That mode is only offered on a **Wayland** session, because GNOME on Xorg cannot
251+
create a monitor. Check which one you are on:
252+
253+
```sh
254+
echo $XDG_SESSION_TYPE
255+
```
256+
257+
If it says `x11`, log out and pick *GNOME* rather than *GNOME on Xorg* at the
258+
login screen. Casting the screen normally works either way.
259+
260+
### The new monitor shows only the wallpaper
261+
262+
Nothing has been moved onto it yet - a new monitor starts empty, the same as
263+
plugging in a second screen. Move the window you want with
264+
`Super`+`Shift`+`Right`, or drag it past the edge of your own screen. *Settings →
265+
Displays* shows where GNOME placed the new monitor relative to the others.
266+
267+
### `The system could not create a new monitor for this cast.`
268+
269+
GNOME accepted the request and then failed to make the monitor. Almost always an
270+
Xorg session (see above); otherwise the compositor refused the size. The real
271+
reason is in the shell's own log, not the daemon's:
272+
273+
```sh
274+
journalctl --user -b -u org.gnome.shell.service | grep -i 'virtual monitor'
275+
```
276+
277+
`Backend doesn't support creating virtual monitors` confirms Xorg. Cast the
278+
screen normally in the meantime.
279+
248280
---
249281

250282
## Connection

daemon/Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

daemon/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "gnome-shell-cast-daemon"
3-
version = "3.0.0"
3+
version = "4.0.0"
44
edition = "2024"
55
license = "MIT"
66
description = "Casts the GNOME desktop (screen or window) to Chromecast devices; controlled over D-Bus by the gnome-shell-cast extension"

0 commit comments

Comments
 (0)