Skip to content

Keep the bar behind a fullscreen window when it cannot take the fast path, and behind borderless X11 fullscreen - #250

Open
sachahjkl wants to merge 1 commit into
bea4dev:mainfrom
sachahjkl:fix/fullscreen-above-top
Open

sachahjkl wants to merge 1 commit into
bea4dev:mainfrom
sachahjkl:fix/fullscreen-above-top

Conversation

@sachahjkl

Copy link
Copy Markdown
Contributor

A taskbar on the Top layer was drawn over a fullscreen window in two cases.

  1. A window in the Fullscreen state that cannot take the fast path. The renderer hid the Top layers only when the window qualified for the fullscreen fast path (fullscreen_scanout_window): it covers the output exactly, it does not animate, and no window closes on that output. Hit testing hid Top as soon as the topmost window committed the Fullscreen state. So during a close animation, a rect animation, or for a fullscreen window that is not exactly output-sized, the bar was drawn over the window while its clicks went to the window.
  2. Borderless fullscreen X11 windows. Many games (here a Proton game through xwayland-satellite) go fullscreen by sizing an undecorated window to the monitor, without _NET_WM_STATE_FULLSCREEN. The session log shows only maximize and unfullscreen requests from such a game. The window never had the Fullscreen state, so the bar stayed above it.

The change:

  • One predicate, fullscreen_window_above_top, decides whether the topmost window of an output stacks above the Top layers. Hit testing and both renderers (tty and winit) use it. The scanout fast path keeps its own stricter conditions.
  • The predicate holds for a window that committed the Fullscreen state, and for an X11 window (a toplevel of the Xwayland bridge) whose geometry covers the whole output. KWin and Mutter treat that last case as fullscreen too, and Wine does the same itself. Wayland windows are not guessed about.
  • The composition Builder gets CompositionScene::fullscreen_above_top: when it holds but the window does not own the stack, Top layers listed after the output's window stack are dropped (Overlay stays), and the scene below the window is still drawn.
  • The output composition reference documents it (English and Japanese).

Tested with tests/fullscreen_stacking.rs in shojiwm_rs, with a Top layer bar mapped:

  • a Wayland window in the Fullscreen state that does not cover the output (the config's rect leaves a strip) stacks above the bar, and the pointer at the bar's place reaches the window;
  • a Wayland window that covers the output without the state does not;
  • a window of a client inserted as the Xwayland bridge stacks above the bar when it covers the output, and does not when it is shorter.

Two composition unit tests check that the Builder drops Top in front of the stack and keeps the scene below it, and that Top listed below the window stack stays. cargo test --workspace --all-targets passes except virtual_keyboard_binds::input_method_keyboard_grab_gets_the_keymap_of_the_keys_it_is_sent, which fails the same way on main on this machine. Not tried on hardware with the game yet.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant