sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

dwm-uselessgap-5.9.diff (1815B)


      1 diff -r 23b71491e149 config.def.h
      2 --- a/config.def.h	Thu Dec 02 10:16:47 2010 +0000
      3 +++ b/config.def.h	Fri Jan 07 08:50:42 2011 +0100
      4 @@ -9,6 +9,7 @@
      5  static const char selbgcolor[]      = "#0066ff";
      6  static const char selfgcolor[]      = "#ffffff";
      7  static const unsigned int borderpx  = 1;        /* border pixel of windows */
      8 +static const unsigned int gappx     = 6;        /* gap pixel between windows */
      9  static const unsigned int snap      = 32;       /* snap pixel */
     10  static const Bool showbar           = True;     /* False means no bar */
     11  static const Bool topbar            = True;     /* False means bottom bar */
     12 diff -r 23b71491e149 dwm.c
     13 --- a/dwm.c	Thu Dec 02 10:16:47 2010 +0000
     14 +++ b/dwm.c	Fri Jan 07 08:50:42 2011 +0100
     15 @@ -273,6 +273,8 @@
     16  static DC dc;
     17  static Monitor *mons = NULL, *selmon = NULL;
     18  static Window root;
     19 +static int globalborder ;
     20 +static int globalborder ;
     21  
     22  /* configuration, allows nested code to access above variables */
     23  #include "config.h"
     24 @@ -1329,11 +1331,17 @@
     25  void
     26  resizeclient(Client *c, int x, int y, int w, int h) {
     27  	XWindowChanges wc;
     28 +	
     29 +	if(c->isfloating || selmon->lt[selmon->sellt]->arrange == NULL) { globalborder = 0 ; }
     30 +	else {
     31 +		if (selmon->lt[selmon->sellt]->arrange == monocle) { globalborder = 0 - borderpx ; }
     32 +		else { globalborder =  gappx ; }
     33 +	}
     34  
     35 -	c->oldx = c->x; c->x = wc.x = x;
     36 -	c->oldy = c->y; c->y = wc.y = y;
     37 -	c->oldw = c->w; c->w = wc.width = w;
     38 -	c->oldh = c->h; c->h = wc.height = h;
     39 +	c->oldx = c->x; c->x = wc.x = x + globalborder ;
     40 +	c->oldy = c->y; c->y = wc.y = y + globalborder ;
     41 +	c->oldw = c->w; c->w = wc.width = w - 2 * globalborder ;
     42 +	c->oldh = c->h; c->h = wc.height = h - 2 * globalborder ;
     43  	wc.border_width = c->bw;
     44  	XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
     45  	configure(c);