propagate host fullscreen to stacked tab-group members too
clients_set_fullscreen only told each tab's main surface, so members stacked before a toggle never learned they were fullscreen, and members that mapped during fullscreen were never released from it. walk each tab's member list with a member_set_fullscreen helper (mirroring the app one) and give xdg members the same re-maximize/resize mains get on the way out; X11 members keep their own geometry. logged as "members fullscreen=" next to the existing line.
This commit is contained in:
parent
86fe848acd
commit
87f25783d9
3 changed files with 65 additions and 6 deletions
10
README.md
10
README.md
|
|
@ -270,12 +270,14 @@ browser's `F11`).
|
|||
|
||||
Fullscreen mirrors between the host window and the clients:
|
||||
|
||||
- Fullscreen the kick window (use your host compositor's fullscreen
|
||||
keybinding, or an app's own `F11`) and every tab is told it is fullscreen,
|
||||
so clients drop their decorations and fill the screen.
|
||||
- Fullscreen the kick window (your host compositor's fullscreen keybinding,
|
||||
an app's own `F11`, or `Alt+F11`) and every window of every tab -- mains
|
||||
and stacked tab-group members alike -- is told it is fullscreen, so
|
||||
clients drop their decorations and fill the screen.
|
||||
- A client that requests fullscreen itself (e.g. a video player) also
|
||||
fullscreens the kick host window.
|
||||
- Leaving fullscreen returns every tab to maximized.
|
||||
- Leaving fullscreen returns every window to maximized (X11 tab-group
|
||||
members keep their own geometry).
|
||||
|
||||
## Standalone mode
|
||||
|
||||
|
|
|
|||
35
kick.c
35
kick.c
|
|
@ -910,6 +910,21 @@ static void app_set_fullscreen(struct kick_app *app, bool on) {
|
|||
#endif
|
||||
}
|
||||
|
||||
/* Same as app_set_fullscreen() for a stacked tab-group member's own window;
|
||||
the is_main wrapper is covered by its owner's call above. */
|
||||
static void member_set_fullscreen(struct kick_tab_group_member *m, bool on) {
|
||||
if (!m) return;
|
||||
if (m->toplevel) {
|
||||
if (!m->toplevel->base->initialized) return;
|
||||
wlr_xdg_toplevel_set_fullscreen(m->toplevel, on);
|
||||
return;
|
||||
}
|
||||
#if HAVE_XWAYLAND
|
||||
if (m->is_x11 && m->xsurface)
|
||||
wlr_xwayland_surface_set_fullscreen(m->xsurface, on);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Keep a mapped window at the maximized output size. XDG clients are told
|
||||
via set_size; X11 clients get a configure to the full output at 0,0. */
|
||||
static void app_set_size(struct kick_app *app, int width, int height) {
|
||||
|
|
@ -2586,11 +2601,16 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data)
|
|||
}
|
||||
}
|
||||
|
||||
/* Propagate the host window's fullscreen state onto every client. Called
|
||||
from host_xdg_toplevel_configure when that state actually changes. */
|
||||
/* Propagate the host window's fullscreen state onto every client -- each
|
||||
tab's main surface plus every tab-group member stacked on it. Called
|
||||
from host_xdg_toplevel_configure when that state actually changes.
|
||||
X11 members keep their own geometry (see attach_group_member), so only
|
||||
xdg members get the re-maximize/resize mains receive on the way out;
|
||||
windows arriving later pick the flag up at their first commit. */
|
||||
static void clients_set_fullscreen(bool fs) {
|
||||
server.clients_fullscreen = fs;
|
||||
kick_log(KICK_LOG_INFO, "clients fullscreen=%d\n", fs);
|
||||
kick_log(KICK_LOG_INFO, "members fullscreen=%d\n", fs);
|
||||
for (int i = 0; i < server.num_apps; i++) {
|
||||
struct kick_app *app = server.apps[i];
|
||||
if (!app_initialized(app)) continue;
|
||||
|
|
@ -2599,6 +2619,17 @@ static void clients_set_fullscreen(bool fs) {
|
|||
app_set_maximized(app, true);
|
||||
app_set_size(app, server.output->width, server.output->height);
|
||||
}
|
||||
struct kick_tab_group_member *m;
|
||||
wl_list_for_each(m, &app->group_members, link) {
|
||||
if (m->is_main) continue; /* already handled via the owner */
|
||||
member_set_fullscreen(m, fs);
|
||||
if (!fs && m->toplevel
|
||||
&& m->toplevel->base->initialized) {
|
||||
wlr_xdg_toplevel_set_maximized(m->toplevel, true);
|
||||
wlr_xdg_toplevel_set_size(m->toplevel,
|
||||
server.output->width, server.output->height);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1495,6 +1495,32 @@ def test_alt_f11_toggles_host_fullscreen(session):
|
|||
assert session.proc.poll() is None
|
||||
|
||||
|
||||
def test_alt_f11_propagates_to_stack_members():
|
||||
"""prefix+F11's host fullscreen reaches not just each tab's main window
|
||||
but every stacked tab-group member too, and leaving fullscreen clears
|
||||
both again."""
|
||||
if not os.environ.get("WAYLAND_DISPLAY"):
|
||||
pytest.skip("needs a live host Wayland session (WAYLAND_DISPLAY)")
|
||||
s = _nested_session(f"{WL} --extra '{GREEN}' '{RED}'", f"{WL} '{BLUE}'",
|
||||
extra_args=("--tab-groups", "on"))
|
||||
try:
|
||||
s.wait_any_active()
|
||||
s.wait_for(r"\[sub\] stack app=0\b")
|
||||
s.chord(ALT, F11)
|
||||
s.wait_for("host fullscreen=1")
|
||||
s.wait_for("clients fullscreen=1")
|
||||
s.wait_for("members fullscreen=1")
|
||||
s.chord(ALT, F11)
|
||||
s.wait_for("host fullscreen=0")
|
||||
s.wait_for("clients fullscreen=0")
|
||||
s.wait_for("members fullscreen=0")
|
||||
assert s.proc.poll() is None
|
||||
finally:
|
||||
s.close()
|
||||
if s.proc.poll() is None:
|
||||
s.proc.terminate()
|
||||
|
||||
|
||||
def test_sigterm_removes_socket(session):
|
||||
sock_path = os.path.join(
|
||||
os.environ.get("XDG_RUNTIME_DIR", f"/run/user/{os.getuid()}"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue