mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2026-08-04 19:24:15 +00:00
simpleborders: Update for 0.8 and for wlroots-next-f4249db
Abandoned simpleborders patch updated by @fauxmight
This commit is contained in:
committed by
A Frederick Christensen
parent
8085c4759f
commit
c9f31f29ea
@@ -0,0 +1,73 @@
|
||||
From 41eb0c0d196d302790ae87a5ca1a4da660864f10 Mon Sep 17 00:00:00 2001
|
||||
From: A Frederick Christensen <dwl@ivories.org>
|
||||
Date: Wed, 25 Feb 2026 20:11:56 -0600
|
||||
Subject: [PATCH] Apply simpleborders patch
|
||||
|
||||
---
|
||||
dwl.c | 22 ++++++++++++++++++++++
|
||||
1 file changed, 22 insertions(+)
|
||||
|
||||
diff --git a/dwl.c b/dwl.c
|
||||
index 44f3ad9..defe2a8 100644
|
||||
--- a/dwl.c
|
||||
+++ b/dwl.c
|
||||
@@ -257,6 +257,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);
|
||||
@@ -305,6 +306,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);
|
||||
@@ -915,6 +917,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)
|
||||
{
|
||||
@@ -1980,6 +1993,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)
|
||||
{
|
||||
@@ -2215,6 +2236,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 */
|
||||
--
|
||||
2.52.0
|
||||
|
||||
Reference in New Issue
Block a user