From e42c5a1be64fc4f211e5f7dc48afb9eba6cb7e3e Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 6 Apr 2010 15:53:33 -0400 Subject: [PATCH] Add padding to the wimenu prompt. Closes issue #177. --- alternative_wmiircs/python/pygmi/util.py | 5 +++-- cmd/menu/menu.c | 2 +- cmd/wmii/Makefile | 1 + cmd/wmii/fns.h | 7 +++++++ cmd/wmii/mouse.c | 10 +++++++--- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/alternative_wmiircs/python/pygmi/util.py b/alternative_wmiircs/python/pygmi/util.py index 064ce271..88214780 100644 --- a/alternative_wmiircs/python/pygmi/util.py +++ b/alternative_wmiircs/python/pygmi/util.py @@ -29,8 +29,9 @@ def program_list(path): for d in path: try: for f in os.listdir(d): - if f not in names and os.access('%s/%s' % (d, f), - os.X_OK): + p = '%s/%s' % (d, f) + if f not in names and os.access(p, os.X_OK) and ( + os.path.isfile(p) or os.path.islink(p)): names.append(f) except Exception: pass diff --git a/cmd/menu/menu.c b/cmd/menu/menu.c index 343fc40b..c947ec4b 100644 --- a/cmd/menu/menu.c +++ b/cmd/menu/menu.c @@ -144,7 +144,7 @@ _menu_draw(bool draw) { rp = ZR; // SET(rp) if (prompt) { if (!promptw) - promptw = textwidth(font, prompt) + 2 * ltwidth; + promptw = textwidth(font, prompt) + 2 * ltwidth + pad; rd.min.x += promptw; rp = r; diff --git a/cmd/wmii/Makefile b/cmd/wmii/Makefile index 3332358e..63768f40 100644 --- a/cmd/wmii/Makefile +++ b/cmd/wmii/Makefile @@ -18,6 +18,7 @@ OBJ = area \ client \ column \ div \ + error \ event \ ewmh \ float \ diff --git a/cmd/wmii/fns.h b/cmd/wmii/fns.h index 37611452..3d57bd5b 100644 --- a/cmd/wmii/fns.h +++ b/cmd/wmii/fns.h @@ -121,6 +121,13 @@ bool find(Area**, Frame**, int, bool, bool); int stack_count(Frame*, int*); Frame* stack_find(Area*, Frame*, int, bool); +/* error.c */ +#define waserror() setjmp(pusherror()) +void error(char*, ...); +void nexterror(void); +void poperror(void); +jmp_buf* pusherror(void); + /* event.c */ void check_x_event(IxpConn*); void dispatch_event(XEvent*); diff --git a/cmd/wmii/mouse.c b/cmd/wmii/mouse.c index 31335921..948adee1 100644 --- a/cmd/wmii/mouse.c +++ b/cmd/wmii/mouse.c @@ -179,6 +179,7 @@ readmouse(Point *p, uint *button) { case PropertyNotify: dispatch_event(&ev); default: + Dprint(DEvent, "readmouse(): ignored: %E\n", &ev); continue; case ButtonPress: case ButtonRelease: @@ -597,14 +598,17 @@ mouse_checkresize(Frame *f, Point p, bool exec) { q = quadrant(r, p); if(rect_haspoint_p(p, f->grabbox)) { cur = cursor[CurTCross]; - if(exec) mouse_movegrabbox(f->client, false); + if(exec) + mouse_movegrabbox(f->client, false); } else if(f->area->floating) { - if(p.x <= 2 || p.y <= 2 + if(p.x <= 2 + || p.y <= 2 || r.max.x - p.x <= 2 || r.max.y - p.y <= 2) { cur = quad_cursor(q); - if(exec) mouse_resize(f->client, q, false); + if(exec) + mouse_resize(f->client, q, false); } else if(exec && rect_haspoint_p(p, f->titlebar)) mouse_movegrabbox(f->client, true);