about summary refs log tree commit diff stats
path: root/043space.cc
Commit message (Expand)AuthorAgeFilesLines
* 4106Kartik K. Agaram2017-11-031-3/+2
* 4104Kartik K. Agaram2017-11-031-2/+2
* 4100Kartik K. Agaram2017-11-011-1/+1
* 4099Kartik K. Agaram2017-11-011-15/+55
* 4089Kartik K. Agaram2017-10-221-90/+85
* 4087Kartik K. Agaram2017-10-211-23/+26
* 4086 - back to cleaning up delimited continuationsKartik K. Agaram2017-10-181-1/+1
* 3999Kartik K. Agaram2017-09-151-4/+4
* 3987Kartik K. Agaram2017-09-011-5/+7
* 3877Kartik K. Agaram2017-05-261-2/+2
* 3841Kartik K. Agaram2017-04-271-2/+2
* 3822Kartik K. Agaram2017-04-141-0/+1
* 3819Kartik K. Agaram2017-04-131-7/+4
* 3754Kartik K. Agaram2017-03-051-1/+1
* 3747Kartik K. Agaram2017-02-071-5/+5
* 3744Kartik K. Agaram2017-02-071-4/+0
* 3743Kartik K. Agaram2017-02-071-0/+4
* 3742 - move instruction.old_name to a later layerKartik K. Agaram2017-02-061-0/+9
* 3707Kartik K. Agaram2016-12-121-5/+2
* 3663 - fix a refcounting bug: '(type)' != 'type'Kartik K. Agaram2016-11-101-2/+2
* 3659Kartik K. Agaram2016-11-101-1/+1
* 3656Kartik K. Agaram2016-11-101-3/+3
* 3643Kartik K. Agaram2016-11-071-4/+4
* 3561Kartik K. Agaram2016-10-221-3/+3
* 3522Kartik K. Agaram2016-10-191-4/+4
* 3394Kartik K. Agaram2016-09-171-9/+15
* 3393Kartik K. Agaram2016-09-171-5/+5
* 3390Kartik K. Agaram2016-09-171-16/+16
* 3389Kartik K. Agaram2016-09-171-31/+31
* 3381Kartik K. Agaram2016-09-171-1/+1
* 3380Kartik K. Agaram2016-09-171-40/+40
* 3376 - start maximally using all type abbreviationsKartik K. Agaram2016-09-171-2/+2
* 3309Kartik K. Agaram2016-09-091-9/+5
* 3260Kartik K. Agaram2016-08-261-1/+1
* 3255Kartik K. Agaram2016-08-261-8/+9
* 3215Kartik K. Agaram2016-08-171-3/+3
* 3214Kartik K. Agaram2016-08-171-1/+1
* 3213Kartik K. Agaram2016-08-171-2/+1
* 3202 - bugfix: 'start-running' and refcountsKartik K. Agaram2016-08-161-2/+2
* 3199Kartik K. Agaram2016-08-161-6/+7
* 3198Kartik K. Agaram2016-08-161-15/+16
* 3197Kartik K. Agaram2016-08-161-5/+4
* 3196Kartik K. Agaram2016-08-161-1/+1
* 2990Kartik K. Agaram2016-05-201-3/+3
* 2974Kartik K. Agaram2016-05-181-23/+4
* 2973 - reclaim refcounts for local scopes againKartik K. Agaram2016-05-181-35/+147
* 2972 - abandon recursive containersKartik K. Agaram2016-05-171-0/+1
* 2932Kartik K. Agaram2016-05-061-4/+4
* 2931 - be explicit about making copiesKartik K. Agaram2016-05-061-33/+33
* 2864 - replace all address:shared with just addressKartik K. Agaram2016-04-241-34/+32
ss="w"> XK_3, view, { .i = Twork } }, { Mod1Mask, XK_space, tiling, { 0 } }, { Mod1Mask|ShiftMask, XK_space, floating, { 0 } }, { Mod1Mask|ShiftMask, XK_0, ttrunc, { .i = Tscratch } }, { Mod1Mask|ShiftMask, XK_1, ttrunc, { .i = Tdev } }, { Mod1Mask|ShiftMask, XK_2, ttrunc, { .i = Twww } }, { Mod1Mask|ShiftMask, XK_3, ttrunc, { .i = Twork } }, { Mod1Mask|ShiftMask, XK_c, ckill, { 0 } }, { Mod1Mask|ShiftMask, XK_q, quit, { 0 } }, { Mod1Mask|ShiftMask, XK_Return, spawn, { .argv = term } }, { Mod1Mask|ShiftMask, XK_w, spawn, { .argv = browse } }, { Mod1Mask|ShiftMask, XK_l, spawn, { .argv = xlock } }, { ControlMask, XK_0, tappend, { .i = Tscratch } }, { ControlMask, XK_1, tappend, { .i = Tdev } }, { ControlMask, XK_2, tappend, { .i = Twww } }, { ControlMask, XK_3, tappend, { .i = Twork } }, }; /********** CUSTOMIZE **********/ void update_keys(void) { static unsigned int len = key ? sizeof(key) / sizeof(key[0]) : 0; unsigned int i; KeyCode code; for(i = 0; i < len; i++) { code = XKeysymToKeycode(dpy, key[i].keysym); XUngrabKey(dpy, code, key[i].mod, root); XGrabKey(dpy, code, key[i].mod, root, True, GrabModeAsync, GrabModeAsync); } } void keypress(XEvent *e) { XKeyEvent *ev = &e->xkey; static unsigned int len = key ? sizeof(key) / sizeof(key[0]) : 0; unsigned int i; KeySym keysym; keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); for(i = 0; i < len; i++) if((keysym == key[i].keysym) && (key[i].mod == ev->state)) { if(key[i].func) key[i].func(&key[i].arg); return; } } #define ButtonMask (ButtonPressMask | ButtonReleaseMask) #define MouseMask (ButtonMask | PointerMotionMask) void mresize(Client *c) { XEvent ev; int ocx, ocy; ocx = c->x; ocy = c->y; if(XGrabPointer(dpy, root, False, MouseMask, GrabModeAsync, GrabModeAsync, None, cursor[CurResize], CurrentTime) != GrabSuccess) return; XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w, c->h); for(;;) { XMaskEvent(dpy, MouseMask | ExposureMask, &ev); switch(ev.type) { default: break; case Expose: handler[Expose](&ev); break; case MotionNotify: XFlush(dpy); c->w = abs(ocx - ev.xmotion.x); c->h = abs(ocy - ev.xmotion.y); c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - c->w; c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - c->h; resize(c, True); break; case ButtonRelease: XUngrabPointer(dpy, CurrentTime); return; } } } void mmove(Client *c) { XEvent ev; int x1, y1, ocx, ocy, di; unsigned int dui; Window dummy; ocx = c->x; ocy = c->y; if(XGrabPointer(dpy, root, False, MouseMask, GrabModeAsync, GrabModeAsync, None, cursor[CurMove], CurrentTime) != GrabSuccess) return; XQueryPointer(dpy, root, &dummy, &dummy, &x1, &y1, &di, &di, &dui); for(;;) { XMaskEvent(dpy, MouseMask | ExposureMask, &ev); switch (ev.type) { default: break; case Expose: handler[Expose](&ev); break; case MotionNotify: XFlush(dpy); c->x = ocx + (ev.xmotion.x - x1); c->y = ocy + (ev.xmotion.y - y1); resize(c, False); break; case ButtonRelease: XUngrabPointer(dpy, CurrentTime); return; } } }