sowm

An itsy bitsy floating window manager (220~ sloc!).
git clone git://mfeller.io/sowm.git
Log | Files | Refs | README | LICENSE

commit 2d1e5c2654c222a2843c820d637077d2216beec2
parent d70ecee07dd0c171e089d855477e73dfd2573105
Author: Dylan Araps <dylan.araps@gmail.com>
Date:   Sat, 19 Oct 2019 17:23:26 +0300

sowm: clean up

Diffstat:
Msowm.c | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/sowm.c b/sowm.c @@ -92,13 +92,13 @@ void notify_enter(XEvent *e) { } void notify_motion(XEvent *e) { - if (mouse.subwindow == 0) return; + if (!mouse.subwindow) return; + + while(XCheckTypedEvent(d, MotionNotify, e)); int xd = e->xbutton.x_root - mouse.x_root; int yd = e->xbutton.y_root - mouse.y_root; - while(XCheckTypedEvent(d, MotionNotify, e)); - XMoveResizeWindow(d, mouse.subwindow, wx + (mouse.button == 1 ? xd : 0), wy + (mouse.button == 1 ? yd : 0), @@ -115,7 +115,7 @@ void key_press(XEvent *e) { } void button_press(XEvent *e) { - if (e->xbutton.subwindow == 0) return; + if (!e->xbutton.subwindow) return; win_size(e->xbutton.subwindow, &wx, &wy, &ww, &wh); XRaiseWindow(d, e->xbutton.subwindow); @@ -178,7 +178,7 @@ void win_center() { void win_fs() { if (!cur) return; - if ((cur->f = cur->f == 0 ? 1 : 0)) { + if ((cur->f = cur->f ? 0 : 1)) { win_size(cur->w, &cur->wx, &cur->wy, &cur->ww, &cur->wh); XMoveResizeWindow(d, cur->w, 0, 0, sw, sh);