mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2026-09-19 05:42:51 +00:00
simpleborders: update filename structure and add version
This commit is contained in:
@@ -4,8 +4,9 @@ Like smartborders. Don't put borders when there is only one window on the screen
|
||||
|
||||
### Download
|
||||
- [git branch](https://codeberg.org/bencc/dwl/src/branch/simpleborders)
|
||||
- [simpleborders-wlroots-next-f4249db](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/simpleborders/simpleborders-wlroots-next-f4249db.patch)
|
||||
- [simpleborders-0.8.patch](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/simpleborders/simpleborders-v0.8.patch)
|
||||
- [simpleborders_main-5fd19fe.patch](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/simpleborders/simpleborders_main-5fd19fe.patch)
|
||||
- [simpleborders_wlroots-next-f4249db.patch](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/simpleborders/simpleborders_wlroots-next-f4249db.patch)
|
||||
- [simpleborders_0.8.patch](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/simpleborders/simpleborders_0.8.patch)
|
||||
|
||||
### Authors
|
||||
- [A Frederick Christensen](https://codeberg.org/fauxmight)
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
diff --git a/dwl.c b/dwl.c
|
||||
index f902ace..5c3f0ee 100644
|
||||
--- a/dwl.c
|
||||
+++ b/dwl.c
|
||||
@@ -275,6 +275,7 @@ static void closemon(Monitor *m);
|
||||
static void commitlayersurfacenotify(struct wl_listener *listener, void *data);
|
||||
static void commitnotify(struct wl_listener *listener, void *data);
|
||||
static void commitpopup(struct wl_listener *listener, void *data);
|
||||
+static int countclients(Monitor *m);
|
||||
static void createdecoration(struct wl_listener *listener, void *data);
|
||||
static void createidleinhibitor(struct wl_listener *listener, void *data);
|
||||
static void createkeyboard(struct wlr_keyboard *keyboard);
|
||||
@@ -323,6 +324,7 @@ static void motionnotify(uint32_t time, struct wlr_input_device *device, double
|
||||
double sy, double sx_unaccel, double sy_unaccel);
|
||||
static void motionrelative(struct wl_listener *listener, void *data);
|
||||
static void moveresize(const Arg *arg);
|
||||
+static int needsborder(Client *c);
|
||||
static void outputmgrapply(struct wl_listener *listener, void *data);
|
||||
static void outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int test);
|
||||
static void outputmgrtest(struct wl_listener *listener, void *data);
|
||||
@@ -991,6 +993,17 @@ commitpopup(struct wl_listener *listener, void *data)
|
||||
free(listener);
|
||||
}
|
||||
|
||||
+int
|
||||
+countclients(Monitor *m)
|
||||
+{
|
||||
+ unsigned int n = 0;
|
||||
+ Client *c;
|
||||
+ wl_list_for_each(c, &clients, link)
|
||||
+ if (VISIBLEON(c, m) && !c->isfloating && !c->isfullscreen)
|
||||
+ n++;
|
||||
+ return n;
|
||||
+}
|
||||
+
|
||||
void
|
||||
createdecoration(struct wl_listener *listener, void *data)
|
||||
{
|
||||
@@ -2099,6 +2112,14 @@ moveresize(const Arg *arg)
|
||||
}
|
||||
}
|
||||
|
||||
+int
|
||||
+needsborder(Client *c) {
|
||||
+ return ((countclients(c->mon) > 1
|
||||
+ && c->mon->lt[c->mon->sellt]->arrange != monocle)
|
||||
+ || c->isfloating)
|
||||
+ && !c->isfullscreen;
|
||||
+}
|
||||
+
|
||||
void
|
||||
outputmgrapply(struct wl_listener *listener, void *data)
|
||||
{
|
||||
@@ -2330,6 +2351,7 @@ resize(Client *c, struct wlr_box geo, int interact)
|
||||
|
||||
client_set_bounds(c, geo.width, geo.height);
|
||||
c->geom = geo;
|
||||
+ c->bw = needsborder(c) ? borderpx : 0;
|
||||
applybounds(c, bbox);
|
||||
|
||||
/* Update scene-graph, including borders */
|
||||
Reference in New Issue
Block a user