all repos — ryudo @ 7f97ee3e9e21ba8b6fadef7fc51588eda1d7d03e

the floatiling window manager that flows; fork of rio from plan9port

remove -grey option and related code (no bg setting); maximized window borders are off the edge of the screen now; truncate long window labels
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAl3oiXgACgkQO3+8IhRO
Y5jJ2A//QDCnvk+zEyWKaL5QqyLkv/6ezNlKo9cYd8UGlqXyL4MjjBgHEyhqr4u+
RWdebiErLT1NU3nZNU35S2p26SHTr+Vquq25Dsl/xL7JV8LRur4mFa0s91EqJ4Lh
ha8j/6VdvjA1JO72QhP20EeEuRrsR2DsBhUpye/Loc/5VeLVXcd9T+0rAYqBqQcJ
9U3LrArgtDXHKIL/s1eD2UN3ffK9LRA1nFjLmwi6+6jEAk6UvmpR/yCJepLLtAFs
7l/inTNXZWiFW3/kK2kng9vdUZbBJCgN4Io+zZdo2gN/SrEg2TqbWKaCNI09mWUY
HEaZZuhw4G473+6ddbDpG1kz/HXHEmsFg4eeUzHsKGfyvmf6qjOSxBHPmmFpwqOM
axvDAVcM9rY7n8g/byRPWVAZuivhL2cX0JxeU9XRCoptcP6P5gxCgvzdiNeAh8WQ
mzvv91J8Jlw7pNqYyueFYsB4bKuyC5TwjoAlX/aukIGlX545RI3LeLFexJipZ49a
EHatByxDeAVYkleYbXcluBQgSVHfru2WuKNaPSFTui6a2mvFj8A2P9wi5R1NCus4
xgjQBChlasaPF8HEuPCX3m05C3ItkBrTdNtuTVwp2B8fuoulqBDq9VdgDpvj4kma
Z2xOZEgI3HgAXMxquH+lJ6hkPDofXu70V9/O82Y13l06TNaOAe4=
=QiCo
-----END PGP SIGNATURE-----
commit

7f97ee3e9e21ba8b6fadef7fc51588eda1d7d03e

parent

ec4967e2cce2ec5ffcd6ae952b24d877abade11a

3 files changed, 21 insertions(+), 28 deletions(-)

jump to
M key.ckey.c

@@ -106,14 +106,12 @@ int ccode = XKeysymToKeycode(dpy, SNAPCENTER_KEY);

int rightcode = XKeysymToKeycode(dpy, NEXTVIRT_KEY); int leftcode = XKeysymToKeycode(dpy, PREVVIRT_KEY); -/* TODO: use current->screen->width/height, and use switch/case for key handling */ + static int scrw = 0; + static int scrh = 0; - XWindowAttributes ra; - XGetWindowAttributes(dpy, DefaultRootWindow(dpy), &ra); + scrw = current->screen->width; + scrh = current->screen->height; -/* alt tab */ - if(e->keycode == tabcode && (e->state&Mod1Mask) == (1<<3)) - alttab(e->state&ShiftMask); /* basic wm functionality */ if(e->keycode == dcode && (e->state&SHORTCUTMOD) == (MODBITS))

@@ -125,31 +123,31 @@ move(current, Button3);

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, scrw+BORDER, scrh+BORDER); /* half snap */ if (e->keycode == hcode && (e->state&SHORTCUTMOD) == (MODBITS)) - quickreshape(current, 0, 0, ra.width/2, ra.height); + quickreshape(current, 0, 0, scrw/2, scrh); if (e->keycode == lcode && (e->state&SHORTCUTMOD) == (MODBITS)) - quickreshape(current, ra.width/2, 0, ra.width/2, ra.height); + quickreshape(current, scrw/2, 0, scrw/2, scrh); if (e->keycode == jcode && (e->state&SHORTCUTMOD) == (MODBITS)) - quickreshape(current, 0, ra.height/2, ra.width, ra.height/2); + quickreshape(current, 0, scrh/2, scrw, scrh/2); if (e->keycode == kcode && (e->state&SHORTCUTMOD) == (MODBITS)) - quickreshape(current, 0, 0, ra.width, ra.height/2); + quickreshape(current, 0, 0, scrw, scrh/2); /* quarter snap */ if (e->keycode == qcode && (e->state&SHORTCUTMOD) == (MODBITS)) - quickreshape(current, 0, 0, ra.width/2, ra.height/2); + quickreshape(current, 0, 0, scrw/2, scrh/2); if (e->keycode == wcode && (e->state&SHORTCUTMOD) == (MODBITS)) - quickreshape(current, 0, ra.height/2, ra.width/2, ra.height/2); + quickreshape(current, 0, scrh/2, scrw/2, scrh/2); if (e->keycode == ocode && (e->state&SHORTCUTMOD) == (MODBITS)) - quickreshape(current, ra.width/2, ra.height/2, ra.width/2, ra.height/2); + quickreshape(current, scrw/2, scrh/2, scrw/2, scrh/2); if (e->keycode == pcode && (e->state&SHORTCUTMOD) == (MODBITS)) - quickreshape(current, ra.width/2, 0, ra.width/2, ra.height/2); + quickreshape(current, scrw/2, 0, scrw/2, scrh/2); /* center snap */ if (e->keycode == ccode && (e->state&SHORTCUTMOD) == (MODBITS)) - quickreshape(current, ra.width/5, ra.height/5, 3*ra.width/5, 3*ra.height/5); + quickreshape(current, scrw/5, scrh/5, 3*scrw/5, 3*scrh/5); /* launch */
M main.cmain.c

@@ -72,14 +72,14 @@

void usage(void) { - fprintf(stderr, "usage: ryudo [-grey] [-font fname] [-s] [-term prog] [-version] [-virtuals num] [exit|restart]\n"); + fprintf(stderr, "usage: ryudo [-font fname] [-s] [-term prog] [-version] [-virtuals num] [exit|restart]\n"); exit(1); } int main(int argc, char *argv[]) { - int i, background, do_exit, do_restart; + int i, do_exit, do_restart; char *fname; int shape_event; #ifdef SHAPE

@@ -90,14 +90,11 @@ shape_event = 0;

myargv = argv; /* for restart */ do_exit = do_restart = 0; - background = 0; font = 0; fname = 0; for(i = 1; i < argc; i++) if(strcmp(argv[i], "-nostalgia") == 0) nostalgia++; - else if(strcmp(argv[i], "-grey") == 0) - background = 1; else if(strcmp(argv[i], "-debug") == 0) debug++; /*

@@ -217,7 +214,7 @@ num_screens = ScreenCount(dpy);

screens = (ScreenInfo *)malloc(sizeof(ScreenInfo) * num_screens); for(i = 0; i < num_screens; i++) - initscreen(&screens[i], i, background); + initscreen(&screens[i], i, 0); initb2menu(numvirtuals);

@@ -351,12 +348,6 @@ | KeyPressMask | EnterWindowMask;

mask = CWCursor|CWEventMask; XChangeWindowAttributes(dpy, s->root, mask, &attr); XSync(dpy, False); - - if(background){ - XSetWindowBackgroundPixmap(dpy, s->root, s->root_pixmap); - XClearWindow(dpy, s->root); - } else - system("xsetroot -solid grey30"); attrs.border_pixel = colorpixel(dpy, s, s->depth, MBORDERCOL, s->black); attrs.background_pixel = colorpixel(dpy, s, s->depth, MENUBGCOL, s->white);
M manage.cmanage.c

@@ -355,6 +355,10 @@ else

label = "no label"; if((p = index(label, ':')) != 0) *p = '\0'; + if (sizeof(label) >= 16*sizeof(char)){ + label[15] = '~'; + label[18] = '\0'; + } c->label = label; }