mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-09-08 12:14:50 +00:00
barpadding: 2024-08-23
This commit is contained in:
parent
060612ea3a
commit
f5e0ef9eea
@ -1,13 +1,13 @@
|
|||||||
From 634ee6c1692224004c9163aaff33e88b1febb966 Mon Sep 17 00:00:00 2001
|
From f01cea73042155e856b2f41452724fe5c895eee4 Mon Sep 17 00:00:00 2001
|
||||||
From: sewn <sewn@disroot.org>
|
From: sewn <sewn@disroot.org>
|
||||||
Date: Mon, 10 Jun 2024 16:33:52 +0300
|
Date: Fri, 23 Aug 2024 09:59:03 +0300
|
||||||
Subject: [PATCH] add vertical and horizontal spacing to bar
|
Subject: [PATCH] add vertical and horizontal spacing to bar
|
||||||
|
|
||||||
https://dwm.suckless.org/patches/barpadding/
|
https://dwm.suckless.org/patches/barpadding/
|
||||||
---
|
---
|
||||||
config.def.h | 2 ++
|
config.def.h | 2 ++
|
||||||
dwl.c | 10 +++++-----
|
dwl.c | 14 +++++++-------
|
||||||
2 files changed, 7 insertions(+), 5 deletions(-)
|
2 files changed, 9 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
diff --git a/config.def.h b/config.def.h
|
diff --git a/config.def.h b/config.def.h
|
||||||
index 5d1dc2b..756b1ae 100644
|
index 5d1dc2b..756b1ae 100644
|
||||||
@ -23,10 +23,10 @@ index 5d1dc2b..756b1ae 100644
|
|||||||
static const float rootcolor[] = COLOR(0x000000ff);
|
static const float rootcolor[] = COLOR(0x000000ff);
|
||||||
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
|
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index 8614fdd..2eb00cf 100644
|
index ece537a..380549a 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -592,8 +592,8 @@ arrangelayers(Monitor *m)
|
@@ -598,8 +598,8 @@ arrangelayers(Monitor *m)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m->scene_buffer->node.enabled) {
|
if (m->scene_buffer->node.enabled) {
|
||||||
@ -37,8 +37,17 @@ index 8614fdd..2eb00cf 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Arrange exclusive surfaces from top->bottom */
|
/* Arrange exclusive surfaces from top->bottom */
|
||||||
@@ -1523,8 +1523,8 @@ drawbar(Monitor *m)
|
@@ -750,7 +750,7 @@ buttonpress(struct wl_listener *listener, void *data)
|
||||||
drwl_finish_drawing(m->drw);
|
if (!c && !exclusive_focus &&
|
||||||
|
(node = wlr_scene_node_at(&layers[LyrBottom]->node, cursor->x, cursor->y, NULL, NULL)) &&
|
||||||
|
(buffer = wlr_scene_buffer_from_node(node)) && buffer == selmon->scene_buffer) {
|
||||||
|
- cx = (cursor->x - selmon->m.x) * selmon->wlr_output->scale;
|
||||||
|
+ cx = (cursor->x - selmon->m.x - sidepad) * selmon->wlr_output->scale;
|
||||||
|
do
|
||||||
|
x += TEXTW(selmon, tags[i]);
|
||||||
|
while (cx >= x && ++i < LENGTH(tags));
|
||||||
|
@@ -1562,8 +1562,8 @@ drawbar(Monitor *m)
|
||||||
|
|
||||||
wlr_scene_buffer_set_dest_size(m->scene_buffer,
|
wlr_scene_buffer_set_dest_size(m->scene_buffer,
|
||||||
m->b.real_width, m->b.real_height);
|
m->b.real_width, m->b.real_height);
|
||||||
- wlr_scene_node_set_position(&m->scene_buffer->node, m->m.x,
|
- wlr_scene_node_set_position(&m->scene_buffer->node, m->m.x,
|
||||||
@ -46,17 +55,19 @@ index 8614fdd..2eb00cf 100644
|
|||||||
+ wlr_scene_node_set_position(&m->scene_buffer->node, m->m.x + sidepad,
|
+ wlr_scene_node_set_position(&m->scene_buffer->node, m->m.x + sidepad,
|
||||||
+ m->m.y + (topbar ? vertpad : m->m.height - m->b.real_height - vertpad));
|
+ m->m.y + (topbar ? vertpad : m->m.height - m->b.real_height - vertpad));
|
||||||
wlr_scene_buffer_set_buffer(m->scene_buffer, &buf->base);
|
wlr_scene_buffer_set_buffer(m->scene_buffer, &buf->base);
|
||||||
wlr_buffer_drop(&buf->base);
|
wlr_buffer_unlock(&buf->base);
|
||||||
}
|
}
|
||||||
@@ -3122,7 +3122,7 @@ updatebar(Monitor *m)
|
@@ -3162,8 +3162,8 @@ updatebar(Monitor *m)
|
||||||
char fontattrs[12];
|
char fontattrs[12];
|
||||||
|
|
||||||
wlr_output_transformed_resolution(m->wlr_output, &rw, &rh);
|
wlr_output_transformed_resolution(m->wlr_output, &rw, &rh);
|
||||||
- m->b.width = rw;
|
- m->b.width = rw;
|
||||||
+ m->b.width = rw - 2 * sidepad;
|
- m->b.real_width = (int)((float)m->b.width / m->wlr_output->scale);
|
||||||
m->b.real_width = (int)((float)m->b.width / m->wlr_output->scale);
|
+ m->b.width = rw - (2 * sidepad);
|
||||||
|
+ m->b.real_width = (int)((float)rw / m->wlr_output->scale) - (2 * sidepad);
|
||||||
|
|
||||||
wlr_scene_node_set_enabled(&m->scene_buffer->node, m->wlr_output->enabled ? showbar : 0);
|
wlr_scene_node_set_enabled(&m->scene_buffer->node, m->wlr_output->enabled ? showbar : 0);
|
||||||
|
|
||||||
--
|
--
|
||||||
2.46.0
|
2.46.0
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user