From a0088869731c51e479f36b1a99f699d2c80db236 Mon Sep 17 00:00:00 2001 From: Derek Stevens Date: Wed, 4 Dec 2019 20:17:43 -0500 Subject: [PATCH] truncate long window labels, maximized windows have no visible border, fix makefile --- key.c | 16 ++++++++-------- manage.c | 10 +++++++++- mkriorules.sh | 7 ------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/key.c b/key.c index e4f5ba5..c3373f0 100755 --- a/key.c +++ b/key.c @@ -106,7 +106,7 @@ keypress(XKeyEvent *e) int rightcode = XKeysymToKeycode(dpy, NEXTVIRT_KEY); int leftcode = XKeysymToKeycode(dpy, PREVVIRT_KEY); - XWindowAttributes ra; + static XWindowAttributes ra; XGetWindowAttributes(dpy, DefaultRootWindow(dpy), &ra); /* alt tab */ @@ -123,7 +123,7 @@ keypress(XKeyEvent *e) if (e->keycode == rcode && (e->state&SHORTCUTMOD) == (MODBITS)) reshape(current, Button3, sweep, 0); if (e->keycode == mcode && (e->state&SHORTCUTMOD) == (MODBITS)) - quickreshape(current, 0, 0, ra.width, ra.height); + quickreshape(current, -BORDER, -BORDER, ra.width + 2*BORDER, ra.height + 2*BORDER); /* half snap */ if (e->keycode == hcode && (e->state&SHORTCUTMOD) == (MODBITS)) @@ -173,12 +173,12 @@ keypress(XKeyEvent *e) } /* switch virts */ - if (e->keycode == rightcode && (e->state&SHORTCUTMOD) == (MODBITS)) - if (numvirtuals > 1 && virt < numvirtuals - 1) - switch_to(virt + 1); - if (e->keycode == leftcode && (e->state&SHORTCUTMOD) == (MODBITS)) - if (numvirtuals >1 && virt > 0) - switch_to(virt - 1); + if (e->keycode == rightcode && (e->state&SHORTCUTMOD) == (MODBITS)) + if (numvirtuals > 1 && virt < numvirtuals - 1) + switch_to(virt + 1); + if (e->keycode == leftcode && (e->state&SHORTCUTMOD) == (MODBITS)) + if (numvirtuals >1 && virt > 0) + switch_to(virt - 1); XAllowEvents(dpy, SyncKeyboard, e->time); } diff --git a/manage.c b/manage.c index 79f3bf9..ef40b9a 100755 --- a/manage.c +++ b/manage.c @@ -341,7 +341,8 @@ getcmaps(Client *c) void setlabel(Client *c) { - char *label, *p; + char *label, *p, *lc; + int i; if(c->iconname != 0) label = c->iconname; @@ -355,6 +356,13 @@ setlabel(Client *c) label = "no label"; if((p = index(label, ':')) != 0) *p = '\0'; + for (i = 0, lc = label; *lc != '\0'; lc++, i++){ + if (i >= 23){ + label[22] = '~'; + label[23] = '\0'; + } + } + c->label = label; } diff --git a/mkriorules.sh b/mkriorules.sh index af48473..d28146b 100755 --- a/mkriorules.sh +++ b/mkriorules.sh @@ -1,8 +1 @@ -if [ "x$WSYSTYPE" != xx11 ]; then - echo 'default:V: all' - echo - echo 'all install clean nuke:' - echo ' # WSYSTYPE is not x11, and ryudo is only for x11' - exit 0 -fi cat $PLAN9/src/mkmany