Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wl-app-fullscreen

A small Wayland proxy that removes the FULLSCREEN state from xdg_toplevel.configure events only when the compositor initiated the fullscreen, leaving client-initiated fullscreen (F11, DOM Fullscreen API) untouched.

Background

On Sway, the fullscreen command sends fullscreen state to the client. Chromium and Electron apps treat that as application fullscreen and hide browser chrome such as the tab bar and address bar.

wl-app-fullscreen is a small Wayland proxy for Sway users who want compositor-driven fullscreen sizing without triggering application fullscreen UI. It strips compositor-initiated FULLSCREEN state from xdg_toplevel.configure events, while preserving client-initiated fullscreen from F11 and the DOM Fullscreen API.

Built on wl-proxy.

Install

From this Git repo with Cargo:

cargo install --git https://github.com/w9n/wl-app-fullscreen

That drops wl-app-fullscreen into ~/.cargo/bin/.

To build from a local checkout instead, with Nix:

nix develop
cargo build --release

Or with a stable Rust toolchain installed directly:

cargo build --release

The release binary lands at target/release/wl-app-fullscreen.

Usage

wl-app-fullscreen [-v] -- <program> [args...]

The leading -- is optional. -v / --verbose logs every intercepted xdg_toplevel.configure and the filter decision, plus a surface-commit rate approximation.

Example:

wl-app-fullscreen -- chromium
wl-app-fullscreen -v -- chromium

The proxy exits when the spawned program exits.

Verbose output

Example verbose log:

[wl-app-fullscreen] listening on wayland-1, spawning ["chromium"]
[configure] 960x540 [ACTIVATED] -> [ACTIVATED] (client_wants_fs=false, stripped)
[configure] 1920x1080 [FULLSCREEN,ACTIVATED] -> [ACTIVATED] (client_wants_fs=false, stripped)
[configure] 1920x1080 [FULLSCREEN,ACTIVATED] -> [FULLSCREEN,ACTIVATED] (client_wants_fs=true, passthrough)
[commits] total=60 (first window, starting clock)
[commits] total=120, last 60 over 1.00s = 60.0/s

The two FULLSCREEN cases differ by client_wants_fs. Compositor-initiated (mod+f) arrives with the flag false and FULLSCREEN gets stripped. Client-initiated (F11) sets the flag, so the next FULLSCREEN configure passes through.

How it works

Per-toplevel state: a single boolean, client_wants_fullscreen, starts false.

  • Client sends xdg_toplevel.set_fullscreen → flag becomes true
  • Client sends xdg_toplevel.unset_fullscreen → flag becomes false
  • Compositor sends a configure whose states do not contain FULLSCREEN → flag becomes false

On every xdg_toplevel.configure:

  • If client_wants_fullscreen is true, forward the states array unchanged
  • Otherwise, remove any FULLSCREEN entry from the states array

Caveats

  • One program per proxy. Each wl-app-fullscreen invocation serves a single child process. Run one proxy per program.
  • Native Wayland only. Programs launched with --ozone-platform=x11 (XWayland) or other X11 paths bypass the proxy entirely.
  • Same-user local tool. The proxy creates a Unix socket in $XDG_RUNTIME_DIR (mode 0700) and is not a sandbox or privilege boundary. Never run as root.

License

Licensed under either of MIT or Apache 2.0, at your option.

The upstream wl-proxy crate is itself dual-licensed under MIT OR Apache-2.0.

About

Wayland proxy for Sway that keeps browser chrome visible during compositor-initiated fullscreen while preserving normal app fullscreen.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages