diff --git a/patches/controlled_fullscreen/README.md b/patches/controlled_fullscreen/README.md new file mode 100644 index 0000000..99a11df --- /dev/null +++ b/patches/controlled_fullscreen/README.md @@ -0,0 +1,9 @@ +### Description + This patch allow a window to adjust its layout as if it was fullscreen, but it won't change its size and position, and it will stays under the control of dwl. For example a video on a browser can occupy the whole space reserved to the window, but we can still resize it and move it and see the status bar. + +### Download +- [git branch](https://codeberg.org/Kana/dwl/src/branch/controlled_fullscreen) +- [main 2025-10-08](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/controlled_fullscreen/controlled_fullscreen.patch) + +### Authors +- [André Desgualdo Pereira](https://codeberg.org/Kana) diff --git a/patches/controlled_fullscreen/controlled_fullscreen.patch b/patches/controlled_fullscreen/controlled_fullscreen.patch new file mode 100644 index 0000000..de9dac9 --- /dev/null +++ b/patches/controlled_fullscreen/controlled_fullscreen.patch @@ -0,0 +1,140 @@ +From 33e9b8a227b63e344407c1e4d137b574483cbd1e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Desgualdo=20Pereira?= +Date: Wed, 8 Oct 2025 17:38:00 -0300 +Subject: [PATCH] controlled fullscreen + +--- + dwl.c | 33 ++++++++++++--------------------- + 1 file changed, 12 insertions(+), 21 deletions(-) + +diff --git a/dwl.c b/dwl.c +index 12f441e..c74380d 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -518,9 +518,6 @@ arrange(Monitor *m) + } + } + +- wlr_scene_node_set_enabled(&m->fullscreen_bg->node, +- (c = focustop(m)) && c->isfullscreen); +- + strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol)); + + /* We move all clients (except fullscreen and unmanaged) to LyrTile while +@@ -878,7 +875,7 @@ commitnotify(struct wl_listener *listener, void *data) + return; + } + +- resize(c, c->geom, (c->isfloating && !c->isfullscreen)); ++ resize(c, c->geom, (c->isfloating)); + + /* mark a pending resize as completed */ + if (c->resize && c->resize <= c->surface.xdg->current.configure_serial) +@@ -1490,7 +1487,7 @@ focusstack(const Arg *arg) + { + /* Focus the next or previous client (in tiling order) on selmon */ + Client *c, *sel = focustop(selmon); +- if (!sel || (sel->isfullscreen && !client_has_children(sel))) ++ if (!sel) + return; + if (arg->i > 0) { + wl_list_for_each(c, &sel->link, link) { +@@ -1826,7 +1823,7 @@ monocle(Monitor *m) + int n = 0; + + wl_list_for_each(c, &clients, link) { +- if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen) ++ if (!VISIBLEON(c, m) || c->isfloating) + continue; + resize(c, m->w, 0); + n++; +@@ -1957,7 +1954,7 @@ moveresize(const Arg *arg) + if (cursor_mode != CurNormal && cursor_mode != CurPressed) + return; + xytonode(cursor->x, cursor->y, NULL, &grabc, NULL, NULL, NULL); +- if (!grabc || client_is_unmanaged(grabc) || grabc->isfullscreen) ++ if (!grabc || client_is_unmanaged(grabc)) + return; + + /* Float the window and tell motionnotify to grab it */ +@@ -2332,14 +2329,12 @@ setcursorshape(struct wl_listener *listener, void *data) + void + setfloating(Client *c, int floating) + { +- Client *p = client_get_parent(c); + c->isfloating = floating; + /* If in floating layout do not change the client's layer */ + if (!c->mon || !client_surface(c)->mapped || !c->mon->lt[c->mon->sellt]->arrange) + return; +- wlr_scene_node_reparent(&c->scene->node, layers[c->isfullscreen || +- (p && p->isfullscreen) ? LyrFS +- : c->isfloating ? LyrFloat : LyrTile]); ++ wlr_scene_node_reparent(&c->scene->node, ++ layers[c->isfloating ? LyrFloat : LyrTile]); + arrange(c->mon); + printstatus(); + } +@@ -2352,12 +2347,12 @@ setfullscreen(Client *c, int fullscreen) + return; + c->bw = fullscreen ? 0 : borderpx; + client_set_fullscreen(c, fullscreen); +- wlr_scene_node_reparent(&c->scene->node, layers[c->isfullscreen +- ? LyrFS : c->isfloating ? LyrFloat : LyrTile]); + ++ wlr_scene_node_reparent(&c->scene->node, ++ layers[c->isfloating ? LyrFloat : LyrTile]); + if (fullscreen) { + c->prev = c->geom; +- resize(c, c->mon->m, 0); ++ resize(c, c->mon->w, 0); + } else { + /* restore previous size instead of arrange for floating windows since + * client positions are set by the user and cannot be recalculated */ +@@ -2413,7 +2408,6 @@ setmon(Client *c, Monitor *m, uint32_t newtags) + /* Make sure window actually overlaps with the monitor */ + resize(c, c->geom, 0); + c->tags = newtags ? newtags : m->tagset[m->seltags]; /* assign tags of target monitor */ +- setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */ + setfloating(c, c->isfloating); + } + focusclient(focustop(selmon), 1); +@@ -2716,7 +2710,7 @@ tile(Monitor *m) + Client *c; + + wl_list_for_each(c, &clients, link) +- if (VISIBLEON(c, m) && !c->isfloating && !c->isfullscreen) ++ if (VISIBLEON(c, m) && !c->isfloating) + n++; + if (n == 0) + return; +@@ -2727,7 +2721,7 @@ tile(Monitor *m) + mw = m->w.width; + i = my = ty = 0; + wl_list_for_each(c, &clients, link) { +- if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen) ++ if (!VISIBLEON(c, m) || c->isfloating) + continue; + if (i < m->nmaster) { + resize(c, (struct wlr_box){.x = m->w.x, .y = m->w.y + my, .width = mw, +@@ -2747,7 +2741,7 @@ togglefloating(const Arg *arg) + { + Client *sel = focustop(selmon); + /* return if fullscreen */ +- if (sel && !sel->isfullscreen) ++ if (sel) + setfloating(sel, !sel->isfloating); + } + +@@ -2902,9 +2896,6 @@ updatemons(struct wl_listener *listener, void *data) + arrangelayers(m); + /* Don't move clients to the left output when plugging monitors */ + arrange(m); +- /* make sure fullscreen clients have the right size */ +- if ((c = focustop(m)) && c->isfullscreen) +- resize(c, m->m, 0); + + /* Try to re-set the gamma LUT when updating monitors, + * it's only really needed when enabling a disabled output, but meh. */ +-- +2.51.0 +