From 1f72f88bde30230ea114635fb5b5a5b2aaccbe89 Mon Sep 17 00:00:00 2001 From: Derek Stevens Date: Tue, 1 Mar 2022 14:22:12 -0700 Subject: [PATCH] fix iconify and configreq bugs, bump to v1.3.1 --- event.c | 16 ++++++++++++---- main.c | 2 +- menu.c | 4 +++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/event.c b/event.c index aacb7c4..2a4c220 100644 --- a/event.c +++ b/event.c @@ -132,7 +132,8 @@ void mainloop(int shape_event) { void configurereq(XConfigureRequestEvent* e) { XWindowChanges wc; Client* c; - + XRRMonitorInfo monitor; + int m; /* we don't set curtime as nothing here uses it */ c = getclient(e->window, 0); trace("configurereq", c, e); @@ -140,6 +141,9 @@ void configurereq(XConfigureRequestEvent* e) { e->value_mask &= ~CWSibling; if (c) { + m = getmonitorbyclient(c); + monitor = monitorinfo[m]; + if (e->value_mask & CWX) c->x = e->x; if (e->value_mask & CWY) @@ -148,8 +152,12 @@ void configurereq(XConfigureRequestEvent* e) { c->dx = e->width; if (e->value_mask & CWHeight) c->dy = e->height; - if (e->value_mask & CWBorderWidth) - c->border = e->border_width; + if ( + e->value_mask & CWBorderWidth && e->width >= monitor.width && + e->height >= monitor.height) + c->border = 0; + else + c->border = BORDER; if (e->value_mask & CWStackMode) { if (e->detail == Above) @@ -164,8 +172,8 @@ void configurereq(XConfigureRequestEvent* e) { wc.y = c->y - c->border; wc.width = c->dx + c->border + c->border; wc.height = c->dy + c->border + c->border; - wc.border_width = 1; wc.sibling = None; + wc.border_width = c->border; wc.stack_mode = e->detail; XConfigureWindow(dpy, c->parent, e->value_mask, &wc); diff --git a/main.c b/main.c index 9fe5349..98d7060 100644 --- a/main.c +++ b/main.c @@ -22,7 +22,7 @@ #include "patchlevel.h" char* version[] = { - "ryudo version 1.3.0\nCopyright (c) 1994-1996 David Hogan,\n(c) 2004 Russ " + "ryudo version 1.3.1\nCopyright (c) 1994-1996 David Hogan,\n(c) 2004 Russ " "Cox,\n(c) 2019-2022 Derek Stevens", 0}; diff --git a/menu.c b/menu.c index f52da5f..fe64416 100644 --- a/menu.c +++ b/menu.c @@ -322,12 +322,14 @@ void delete (Client* c, int shift) { } void hide(Client* c) { + int monitor; if (c == 0 || numhidden == MAXHIDDEN) return; if (hidden(c)) { fprintf(stderr, "ryudo: already hidden: %s\n", c->label); return; } + monitor = getmonitorbyclient(c); XUnmapWindow(dpy, c->parent); XUnmapWindow(dpy, c->window); setstate(c, IconicState); @@ -347,7 +349,7 @@ void hide(Client* c) { } numhidden++; b3items[B3FIXED + numhidden] = 0; - ensureactive(); + ensureactiveonmonitor(monitor); } void unhide(int n, int map) {