all repos — ryudo @ 55d6921b4504bb3d4f594caf494161dae4da7436

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

config.h, main.c, key.c, manage.c, client.c: add zoom mode (fullscreen everything); event.c, menu.c: don't leave us out of focus when deleting windows
Iris Lightshard nilix@nilfm.cc
commit

55d6921b4504bb3d4f594caf494161dae4da7436

parent

8ce7319b0861bf71c1cae4ae70ff61d25ed06290

8 files changed, 49 insertions(+), 2 deletions(-)

jump to
M client.cclient.c

@@ -277,6 +277,9 @@ #endif

void shuffle(int up) { Client **l, *c; + static XWindowAttributes ra; + + XGetWindowAttributes(dpy, DefaultRootWindow(dpy), &ra); if (clients == 0 || clients->next == 0) return;

@@ -297,6 +300,14 @@ return;

XMapRaised(dpy, c->parent); top(c); active(c); + if (zoom) { + quickreshape( + c, + -BORDER, + -BORDER, + ra.width + 2 * BORDER, + ra.height + 2 * BORDER); + } } else { c = clients; for (l = &clients; *l; l = &(*l)->next)
M config.hconfig.h

@@ -60,6 +60,7 @@ #define MOVE_KEY XK_v

#define RESIZE_KEY XK_r #define DESTROY_KEY XK_d #define STICK_KEY XK_s +#define ZOOM_KEY XK_z #define STICKYTOFRONT_KEY XK_t #define STICKYTOBACK_KEY XK_b
M dat.hdat.h

@@ -157,6 +157,7 @@ extern int solidsweep;

extern int numvirtuals; extern int scrolling; extern int ffm; /* focus follows mouse */ +extern int zoom; extern Atom exit_rio; extern Atom restart_rio;
M event.cevent.c

@@ -292,18 +292,23 @@

void destroy(Window w) { int i; Client* c; + int v; curtime = CurrentTime; c = getclient(w, 0); if (c == 0) return; + v = c->virt; if (numvirtuals > 1) for (i = 0; i < numvirtuals; i++) if (currents[i] == c) currents[i] = 0; rmclient(c); + if (v == virt) { + shuffle(0); + } /* flush any errors generated by the window's sudden demise */ ignore_badwindow = 1;
M key.ckey.c

@@ -47,6 +47,7 @@ int ocode = XKeysymToKeycode(dpy, SNAPBOTTOMRIGHT_KEY);

int pcode = XKeysymToKeycode(dpy, SNAPTOPRIGHT_KEY); int ccode = XKeysymToKeycode(dpy, SNAPCENTER_KEY); int slcode = XKeysymToKeycode(dpy, LAUNCH_KEY); + int zcode = XKeysymToKeycode(dpy, ZOOM_KEY); int rightcode = XKeysymToKeycode(dpy, NEXTVIRT_KEY); int leftcode = XKeysymToKeycode(dpy, PREVVIRT_KEY); #ifdef DEVEL

@@ -225,6 +226,14 @@ GrabModeSync,

GrabModeAsync); XGrabKey( dpy, + zcode, + SHORTCUTMOD, + screens[i].root, + 0, + GrabModeSync, + GrabModeAsync); + XGrabKey( + dpy, tabcode, Mod1Mask | ShiftMask, screens[i].root,

@@ -271,6 +280,7 @@ int vcode = XKeysymToKeycode(dpy, MOVE_KEY);

int scode = XKeysymToKeycode(dpy, STICK_KEY); int rcode = XKeysymToKeycode(dpy, RESIZE_KEY); int slcode = XKeysymToKeycode(dpy, LAUNCH_KEY); + int zcode = XKeysymToKeycode(dpy, ZOOM_KEY); int hcode = XKeysymToKeycode(dpy, SNAPLEFT_KEY); int lcode = XKeysymToKeycode(dpy, SNAPRIGHT_KEY); int jcode = XKeysymToKeycode(dpy, SNAPBOTTOM_KEY);

@@ -312,6 +322,8 @@ ra.width + 2 * BORDER,

ra.height + 2 * BORDER); else if (e->keycode == scode && (e->state & SHORTCUTMOD) == (MODBITS)) stick(current); + else if (e->keycode == zcode && (e->state & SHORTCUTMOD) == (MODBITS)) + zoom = !zoom; /* half snap */ else if (e->keycode == hcode && (e->state & SHORTCUTMOD) == (MODBITS))
M main.cmain.c

@@ -43,6 +43,7 @@ int solidsweep = 0;

int numvirtuals = 0; int ffm = 0; int kbLaunch = 0; +int zoom = 0; Atom exit_rio; Atom restart_rio;
M manage.cmanage.c

@@ -219,6 +219,16 @@ if (current && (current != c))

cmapfocus(current); c->init = 1; + /* If we are in zoom mode, spawn the window maximized */ + if (zoom) { + quickreshape( + c, + -BORDER, + -BORDER, + ra.width + 2 * BORDER, + ra.height + 2 * BORDER); + } + /* If the window is out of bounds of the screen, try to wrangle it */ /* If it's bigger than the screen, try to set it maximized */