Compare commits

...

3 Commits

Author SHA1 Message Date
André Desgualdo Pereira
918863bd3c add controlled fullscreen patch 2025-10-29 09:21:56 -03:00
André Desgualdo Pereira
0a6759e881 decklayout fixes 2025-10-29 02:48:07 +01:00
Zuki Air
3f25b6c7d4 riverctl: add support for changing border colors via dwlctl, and fix bug with changing borderpx not applying 2025-10-26 14:24:20 +00:00
5 changed files with 329 additions and 13 deletions

View File

@ -0,0 +1,9 @@
### Description
This patch allows 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)

View File

@ -0,0 +1,140 @@
From 33e9b8a227b63e344407c1e4d137b574483cbd1e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Desgualdo=20Pereira?= <desgua@gmail.com>
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

View File

@ -0,0 +1,9 @@
### Description
Deck is a dwl-layout which is inspired by the dwm Deck layout (which is inspired by TTWM window manager). It applies the monocle-layout to the clients in the stack. The master-client is still visible. The stacked clients are like a deck of cards, hence the name.
### Download
- [git branch](https://codeberg.org/Kana/dwl/src/branch/decklayout)
- [main 2025-10-08](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/decklayout/decklayout.patch)
### Authors
- [André Desgualdo Pereira](https://codeberg.org/Kana)

View File

@ -0,0 +1,112 @@
From 095439425e64f2567f141d5d941178b148ef0d3a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Desgualdo=20Pereira?= <desgua@gmail.com>
Date: Sun, 12 Oct 2025 11:44:26 -0300
Subject: [PATCH] decklayout
---
config.def.h | 2 ++
dwl.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 63 insertions(+)
diff --git a/config.def.h b/config.def.h
index 95c2afa..cc846eb 100644
--- a/config.def.h
+++ b/config.def.h
@@ -34,6 +34,7 @@ static const Layout layouts[] = {
{ "[]=", tile },
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
+ { "[E]", deck },
};
/* monitors */
@@ -139,6 +140,7 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
+ { MODKEY, XKB_KEY_a, setlayout, {.v = &layouts[3]} },
{ MODKEY, XKB_KEY_space, setlayout, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} },
diff --git a/dwl.c b/dwl.c
index 12f441e..227004f 100644
--- a/dwl.c
+++ b/dwl.c
@@ -278,6 +278,7 @@ static void destroylayersurfacenotify(struct wl_listener *listener, void *data);
static void destroylock(SessionLock *lock, int unlocked);
static void destroylocksurface(struct wl_listener *listener, void *data);
static void destroynotify(struct wl_listener *listener, void *data);
+static void deck(Monitor *m);
static void destroypointerconstraint(struct wl_listener *listener, void *data);
static void destroysessionlock(struct wl_listener *listener, void *data);
static void destroykeyboardgroup(struct wl_listener *listener, void *data);
@@ -1837,6 +1838,66 @@ monocle(Monitor *m)
wlr_scene_node_raise_to_top(&c->scene->node);
}
+void
+deck(Monitor *m)
+{
+ unsigned int mw, my;
+ int i, n = 0;
+ Client *c;
+
+ /* count tiled clients */
+ 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;
+
+ /* set master width */
+ if (n > m->nmaster)
+ mw = m->nmaster ? (int)roundf(m->w.width * m->mfact) : 0;
+ else
+ mw = m->w.width;
+
+ /* update layout symbol with number of stack windows */
+ /* use the following rules to count only the windows on the deck
+ if (n > m->nmaster)
+ snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n - m->nmaster);
+ else
+ snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); */
+
+ /* or this one to count all windows on the tag */
+ snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
+
+ i = my = 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) {
+ /* master clients */
+ resize(c, (struct wlr_box){
+ .x = m->w.x,
+ .y = m->w.y + my,
+ .width = mw,
+ .height = (m->w.height - my) / (MIN(n, m->nmaster) - i)
+ }, 0);
+ my += c->geom.height;
+ } else {
+ /* deck clients: overlap in stack area */
+ resize(c, (struct wlr_box){
+ .x = m->w.x + mw,
+ .y = m->w.y,
+ .width = m->w.width - mw,
+ .height = m->w.height
+ }, 0);
+ }
+ i++;
+ }
+}
+
void
motionabsolute(struct wl_listener *listener, void *data)
{
--
2.51.0

View File

@ -1,17 +1,20 @@
From 735440660fd2bccdde982f9c3d758e189ba35e40 Mon Sep 17 00:00:00 2001
From 672df57ab7d5b52f91a712eaf3954d580cdf8ba3 Mon Sep 17 00:00:00 2001
From: Zuki Air <zukirust@gmail.com>
Date: Thu, 7 Aug 2025 13:19:59 +0100
Subject: [PATCH] riverctl patch
make setborderpx apply instantly
add setting border colors via dwlctl
---
.gitignore | 1 +
Makefile | 22 +-
config.def.h | 36 +-
config.def.h | 42 +-
dwl.c | 47 +-
dwlctl.c | 133 +++++
dwlctl.c | 133 ++++
protocols/river-control-unstable-v1.xml | 85 +++
river-control.h | 753 ++++++++++++++++++++++++
7 files changed, 1055 insertions(+), 22 deletions(-)
river-control.h | 789 ++++++++++++++++++++++++
7 files changed, 1094 insertions(+), 25 deletions(-)
create mode 100644 dwlctl.c
create mode 100644 protocols/river-control-unstable-v1.xml
create mode 100644 river-control.h
@ -75,18 +78,25 @@ index 578194f..029dfad 100644
dist: clean
mkdir -p dwl-$(VERSION)
diff --git a/config.def.h b/config.def.h
index 95c2afa..72afbd6 100644
index 95c2afa..ccc3edb 100644
--- a/config.def.h
+++ b/config.def.h
@@ -6,7 +6,7 @@
@@ -6,11 +6,11 @@
/* appearance */
static const int sloppyfocus = 1; /* focus follows mouse */
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
-static const unsigned int borderpx = 1; /* border pixel of windows */
+static unsigned int borderpx = 1; /* border pixel of windows */
static const float rootcolor[] = COLOR(0x222222ff);
static const float bordercolor[] = COLOR(0x444444ff);
static const float focuscolor[] = COLOR(0x005577ff);
-static const float bordercolor[] = COLOR(0x444444ff);
-static const float focuscolor[] = COLOR(0x005577ff);
-static const float urgentcolor[] = COLOR(0xff0000ff);
+static float bordercolor[] = COLOR(0x444444ff);
+static float focuscolor[] = COLOR(0x005577ff);
+static float urgentcolor[] = COLOR(0xff0000ff);
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
static const float fullscreen_bg[] = {0.0f, 0.0f, 0.0f, 1.0f}; /* You can also use glsl colors */
@@ -21,7 +21,14 @@ static const float fullscreen_bg[] = {0.0f, 0.0f, 0.0f, 1.0f}; /* You ca
static int log_level = WLR_ERROR;
@ -480,10 +490,10 @@ index 0000000..aa5fc4d
+</protocol>
diff --git a/river-control.h b/river-control.h
new file mode 100644
index 0000000..59561b6
index 0000000..599cffe
--- /dev/null
+++ b/river-control.h
@@ -0,0 +1,753 @@
@@ -0,0 +1,789 @@
+#include "river-control-unstable-v1-private-protocol.c"
+#include "river-control-unstable-v1-protocol.h"
+#ifdef KEYS_USED
@ -495,6 +505,9 @@ index 0000000..59561b6
+void clear_rules(const Arg*);
+void clear_binds(const Arg*);
+void setborderpx(const Arg*);
+void setfocuscolor(const Arg*);
+void setbordercolor(const Arg*);
+void seturgentcolor(const Arg*);
+struct wl_list arg_str_store;
+struct wl_list rule_str_store;
+struct wl_list rules_list;
@ -534,6 +547,7 @@ index 0000000..59561b6
+ FUNC_STR_ARG_TYPE_INT,
+ FUNC_STR_ARG_TYPE_UINT,
+ FUNC_STR_ARG_TYPE_FLOAT,
+ FUNC_STR_ARG_TYPE_COLOR,
+ FUNC_STR_ARG_TYPE_STRING_ARRAY,
+ FUNC_STR_ARG_TYPE_WLR_DIRECTION,
+ FUNC_STR_ARG_TYPE_LAYOUT,
@ -552,6 +566,9 @@ index 0000000..59561b6
+ { enter_mode, FUNC_STR_ARG_TYPE_STRING_ARRAY, "enter-mode"},
+ { oneshot_mode, FUNC_STR_ARG_TYPE_STRING_ARRAY, "oneshot-mode"},
+ { create_mode_user, FUNC_STR_ARG_TYPE_STRING_ARRAY, "create-mode"},
+ STR(setfocuscolor,FUNC_STR_ARG_TYPE_COLOR),
+ STR(setbordercolor,FUNC_STR_ARG_TYPE_COLOR),
+ STR(seturgentcolor,FUNC_STR_ARG_TYPE_COLOR),
+ STR(setborderpx,FUNC_STR_ARG_TYPE_UINT),
+ STR(setlayout,FUNC_STR_ARG_TYPE_LAYOUT),
+ STR(spawn,FUNC_STR_ARG_TYPE_STRING_ARRAY),
@ -641,10 +658,36 @@ index 0000000..59561b6
+
+void setborderpx(const Arg *arg) {
+ Client *c;
+ Monitor *m;
+ borderpx = arg->ui;
+ wl_list_for_each(c, &clients, link) {
+ c->bw = borderpx;
+ }
+ wl_list_for_each(m, &mons,link) {
+ arrange(m);
+ }
+}
+
+void setfocuscolor(const Arg *arg) {
+ const float color[4] = COLOR(arg->i);
+ int i;
+ for (i = 0; i < 4; i++) {
+ focuscolor[i] = color[i];
+ }
+}
+void setbordercolor(const Arg *arg) {
+ const float color[4] = COLOR(arg->i);
+ int i;
+ for (i = 0; i < 4; i++) {
+ bordercolor[i] = color[i];
+ }
+}
+void seturgentcolor(const Arg *arg) {
+ const float color[4] = COLOR(arg->i);
+ int i;
+ for (i = 0; i < 4; i++) {
+ urgentcolor[i] = color[i];
+ }
+}
+
+void zriver_control_destroy(struct wl_client *client,
@ -1098,7 +1141,10 @@ index 0000000..59561b6
+ args->error = true;
+ args->error_msg = zriver_error_out_of_range;
+ }
+
+ break;
+ case(FUNC_STR_ARG_TYPE_COLOR):
+ arg->i = strtol(argument,NULL,16);
+ break;
+ }
+ }
+ args->argc++;
@ -1238,5 +1284,5 @@ index 0000000..59561b6
+ zriver_arg_list_resource, zriver_control_handle_destory);
+}
--
2.49.1
2.51.0