dwl-patches/patches/borderlessrule/borderlessrule.patch
Anant Murmu b48effb3be
Add borderlessrule patch
no border around client if client rule isborderless set to 1
2025-11-30 00:30:28 +05:30

65 lines
2.3 KiB
Diff

From cf65713492eda1757a151b335785c72cee87e127 Mon Sep 17 00:00:00 2001
From: Anant Murmu <freezboltz@gmail.com>
Date: Sat, 29 Nov 2025 20:39:16 +0530
Subject: [PATCH] borderless client
- remove borders from client if rule matches the client
---
config.def.h | 7 ++++---
dwl.c | 6 +++++-
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/config.def.h b/config.def.h
index 95c2afa..9eee6ca 100644
--- a/config.def.h
+++ b/config.def.h
@@ -22,10 +22,11 @@ static int log_level = WLR_ERROR;
/* NOTE: ALWAYS keep a rule declared even if you don't use rules (e.g leave at least one example) */
static const Rule rules[] = {
- /* app_id title tags mask isfloating monitor */
+ /* app_id title tags mask isfloating monitor isborderless */
/* examples: */
- { "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */
- { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */
+ { "Gimp_EXAMPLE", NULL, 0, 1, -1, 0 }, /* Start on currently visible tags floating, not tiled */
+ { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1, 0 }, /* Start on ONLY tag "9" */
+ { "foo_EXAMPLE", NULL, 0, 0, -1, 1 }, /* Start on currently visible tags with no border around it */
};
/* layout(s) */
diff --git a/dwl.c b/dwl.c
index 12f441e..e97654f 100644
--- a/dwl.c
+++ b/dwl.c
@@ -137,7 +137,7 @@ typedef struct {
#endif
unsigned int bw;
uint32_t tags;
- int isfloating, isurgent, isfullscreen;
+ int isfloating, isurgent, isborderless, isfullscreen;
uint32_t resize; /* configure serial of a pending resize */
} Client;
@@ -490,6 +490,7 @@ applyrules(Client *c)
if ((!r->title || strstr(title, r->title))
&& (!r->id || strstr(appid, r->id))) {
c->isfloating = r->isfloating;
+ c->isborderless = r->isborderless;
newtags |= r->tags;
i = 0;
wl_list_for_each(m, &mons, link) {
@@ -2210,6 +2211,9 @@ resize(Client *c, struct wlr_box geo, int interact)
if (!c->mon || !client_surface(c)->mapped)
return;
+ if (c->isborderless)
+ c->bw = 0;
+
bbox = interact ? &sgeom : &c->mon->w;
client_set_bounds(c, geo.width, geo.height);
--
2.52.0