commit cd03f2e3d1e7015efa66313cb04613a26a908e1b
parent 9353c2be35abacc29e8565c41a39ec1ebc957432
Author: Dylan Araps <dylan.araps@gmail.com>
Date: Thu, 17 Oct 2019 19:47:34 +0300
patches: optimize rounded corners further.
Diffstat:
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/patches/sowm-rounded-corners.patch b/patches/sowm-rounded-corners.patch
@@ -22,7 +22,7 @@ index 3cef34b..e7f1518 100644
const char* menu[] = {"dmenu_run", 0};
const char* term[] = {"st", 0};
diff --git a/sowm.c b/sowm.c
-index 126aca0..996e005 100644
+index 126aca0..5c99c5c 100644
--- a/sowm.c
+++ b/sowm.c
@@ -3,6 +3,7 @@
@@ -51,7 +51,7 @@ index 126aca0..996e005 100644
}
void key_press(XEvent *e) {
-@@ -201,9 +206,47 @@ void win_fs() {
+@@ -201,9 +206,44 @@ void win_fs() {
} else
XMoveResizeWindow(d, cur, c->wx, c->wy, c->ww, c->wh);
@@ -61,12 +61,9 @@ index 126aca0..996e005 100644
}
+void win_round_corners(Window w, int rad) {
-+ XWindowAttributes attr2;
-+ XGetWindowAttributes(d, w, &attr2);
++ unsigned int ww, wh, dia = 2 * rad;
+
-+ int dia = 2 * rad;
-+ int ww = attr2.width;
-+ int wh = attr2.height;
++ win_size(w, &(int){1}, &(int){1}, &ww, &wh);
+
+ if (ww < dia || wh < dia) return;
+
@@ -99,7 +96,7 @@ index 126aca0..996e005 100644
void win_to_ws(const Arg arg) {
int tmp = ws;
win_current();
-@@ -275,6 +318,7 @@ void map_request(XEvent *e) {
+@@ -275,6 +315,7 @@ void map_request(XEvent *e) {
if (wx == 0 && wy == 0) win_center((Arg){.i = w});
XMapWindow(d, w);