vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| On Mon, Apr 14, 2008 at 04:49:20PM +0100, Edd Barrett wrote: > See this url for gap support in cwm. It allows a space at the edge of > the screen for you to runs apps without maximised windows overlapping > them. > > http://students.dec.bmth.ac.uk/ebarr...s/cwm_gap.diff See attached a new diff with new syntax as requested oga@ and okan@ -- Best Regards Edd http://students.dec.bmth.ac.uk/ebarrett ? cwm ? y.tab.h ? parse.c ? cwm.cat1 ? cwmrc.cat5 Index: calmwm.h ================================================== ================= RCS file: /cvs/xenocara/app/cwm/calmwm.h,v retrieving revision 1.28 diff -u -r1.28 calmwm.h --- calmwm.h 9 Apr 2008 18:10:47 -0000 1.28 +++ calmwm.h 14 Apr 2008 18:02:07 -0000 @@ -274,6 +274,7 @@ #define DEFAULTFONTNAME "sans-serif char *DefaultFontName; + int gap_top, gap_bottom, gap_left, gap_right; }; /* Menu stuff */ Index: client.c ================================================== ================= RCS file: /cvs/xenocara/app/cwm/client.c,v retrieving revision 1.15 diff -u -r1.15 client.c --- client.c 9 Apr 2008 18:10:47 -0000 1.15 +++ client.c 14 Apr 2008 18:02:08 -0000 @@ -339,10 +339,12 @@ XGetWindowAttributes(X_Dpy, sc->rootwin, &rootwin_geom); if (!(cc->flags & CLIENT_VMAXIMIZED)) cc->savegeom = cc->geom; - cc->geom.x = 0; - cc->geom.y = 0; - cc->geom.height = rootwin_geom.height; - cc->geom.width = rootwin_geom.width; + cc->geom.x = Conf.gap_left; + cc->geom.y = Conf.gap_top; + cc->geom.height = rootwin_geom.height - + (Conf.gap_top + Conf.gap_bottom); + cc->geom.width = rootwin_geom.width - + (Conf.gap_left + Conf.gap_right); cc->flags |= CLIENT_DOMAXIMIZE; } @@ -765,12 +767,9 @@ if (!(cc->flags & CLIENT_MAXIMIZED)) cc->savegeom = cc->geom; - cc->geom.y = cc->bwidth; - if (cc->geom.min_dx == 0) - cc->geom.height = display_height; - else - cc->geom.height = display_height - - (display_height % cc->geom.min_dx); + cc->geom.y = cc->bwidth + Conf.gap_top; + cc->geom.height = display_height - + (Conf.gap_top + Conf.gap_bottom); cc->flags |= CLIENT_DOVMAXIMIZE; } Index: conf.c ================================================== ================= RCS file: /cvs/xenocara/app/cwm/conf.c,v retrieving revision 1.25 diff -u -r1.25 conf.c --- conf.c 8 Apr 2008 14:12:28 -0000 1.25 +++ conf.c 14 Apr 2008 18:02:08 -0000 @@ -153,6 +153,10 @@ strlcpy(c->lockpath, "xlock", sizeof(c->lockpath)); c->DefaultFontName = DEFAULTFONTNAME; + c->gap_top = 0; + c->gap_bottom = 0; + c->gap_left = 0; + c->gap_right = 0; } void Index: cwmrc.5 ================================================== ================= RCS file: /cvs/xenocara/app/cwm/cwmrc.5,v retrieving revision 1.1 diff -u -r1.1 cwmrc.5 --- cwmrc.5 23 Mar 2008 15:09:21 -0000 1.1 +++ cwmrc.5 14 Apr 2008 18:02:09 -0000 @@ -138,6 +138,16 @@ .Bd -literal -offset indent bind 4-o "unmap" .Ed +.It Ic gap Ar top bottom left right +Define "gaps" at the edge of the screen, so that when a window is maximized it will not overlap this area. +This gap can be used for other applications such as +.Xr xclock 1 , +which the user may wish to remain visible. +.Pp +.Pa top bottom left +and +.Pa right +are the sizes of each the gap in pixels. .El .Sh SEE ALSO .Xr cwm 1 Index: parse.y ================================================== ================= RCS file: /cvs/xenocara/app/cwm/parse.y,v retrieving revision 1.1 diff -u -r1.1 parse.y --- parse.y 23 Mar 2008 15:09:21 -0000 1.1 +++ parse.y 14 Apr 2008 18:02:09 -0000 @@ -65,7 +65,7 @@ %} -%token FONTNAME STICKY +%token FONTNAME STICKY GAP %token AUTOGROUP BIND COMMAND IGNORE %token YES NO %token ERROR @@ -161,8 +161,13 @@ free($2); free($3); } + | GAP NUMBER NUMBER NUMBER NUMBER { + conf->gap_top = $2; + conf->gap_bottom = $3; + conf->gap_left = $4; + conf->gap_right = $5; + } ; - %% struct keywords { @@ -199,6 +204,7 @@ { "bind", BIND}, { "command", COMMAND}, { "fontname", FONTNAME}, + { "gap", GAP}, { "ignore", IGNORE}, { "no", NO}, { "sticky", STICKY}, @@ -575,6 +581,8 @@ strlcpy(xconf->lockpath, conf->lockpath, sizeof(xconf->lockpath)); xconf->DefaultFontName = conf->DefaultFontName; + + bcopy(&(conf->gap_top), &(xconf->gap_top), sizeof(int) * 4); } free(conf); |