@ -517,7 +517,8 @@ clientmessage(XEvent *e)
if ( ! c )
return ;
if ( cme - > message_type = = netatom [ NetWMState ] ) {
if ( cme - > data . l [ 1 ] = = netatom [ NetWMFullscreen ] | | cme - > data . l [ 2 ] = = netatom [ NetWMFullscreen ] )
if ( cme - > data . l [ 1 ] = = netatom [ NetWMFullscreen ]
| | cme - > data . l [ 2 ] = = netatom [ NetWMFullscreen ] )
setfullscreen ( c , ( cme - > data . l [ 0 ] = = 1 /* _NET_WM_STATE_ADD */
| | ( cme - > data . l [ 0 ] = = 2 /* _NET_WM_STATE_TOGGLE */ & & ! c - > isfullscreen ) ) ) ;
} else if ( cme - > message_type = = netatom [ NetActiveWindow ] ) {
@ -783,7 +784,6 @@ focus(Client *c)
{
if ( ! c | | ! ISVISIBLE ( c ) )
for ( c = selmon - > stack ; c & & ! ISVISIBLE ( c ) ; c = c - > snext ) ;
/* was if (selmon->sel) */
if ( selmon - > sel & & selmon - > sel ! = c )
unfocus ( selmon - > sel , 0 ) ;
if ( c ) {
@ -804,7 +804,7 @@ focus(Client *c)
drawbars ( ) ;
}
/* there are some broken focus acquiring clients */
/* there are some broken focus acquiring clients needing extra handling */
void
focusin ( XEvent * e )
{
@ -823,8 +823,7 @@ focusmon(const Arg *arg)
return ;
if ( ( m = dirtomon ( arg - > i ) ) = = selmon )
return ;
unfocus ( selmon - > sel , 0 ) ; /* s/1/0/ fixes input focus issues
in gedit and anjuta */
unfocus ( selmon - > sel , 0 ) ;
selmon = m ;
focus ( NULL ) ;
}
@ -1516,7 +1515,7 @@ setlayout(const Arg *arg)
drawbar ( selmon ) ;
}
/* arg > 1.0 will set mfact absolut ly */
/* arg > 1.0 will set mfact absolut e ly */
void
setmfact ( const Arg * arg )
{
@ -1590,10 +1589,11 @@ setup(void)
XChangeProperty ( dpy , root , netatom [ NetSupported ] , XA_ATOM , 32 ,
PropModeReplace , ( unsigned char * ) netatom , NetLast ) ;
XDeleteProperty ( dpy , root , netatom [ NetClientList ] ) ;
/* select for events */
/* select events */
wa . cursor = cursor [ CurNormal ] - > cursor ;
wa . event_mask = SubstructureRedirectMask | SubstructureNotifyMask | ButtonPressMask | PointerMotionMask
| EnterWindowMask | LeaveWindowMask | StructureNotifyMask | PropertyChangeMask ;
wa . event_mask = SubstructureRedirectMask | SubstructureNotifyMask
| ButtonPressMask | PointerMotionMask | EnterWindowMask
| LeaveWindowMask | StructureNotifyMask | PropertyChangeMask ;
XChangeWindowAttributes ( dpy , root , CWEventMask | CWCursor , & wa ) ;
XSelectInput ( dpy , root , wa . event_mask ) ;
grabkeys ( ) ;
@ -1769,12 +1769,11 @@ unmanage(Client *c, int destroyed)
Monitor * m = c - > mon ;
XWindowChanges wc ;
/* The server grab construct avoids race conditions. */
detach ( c ) ;
detachstack ( c ) ;
if ( ! destroyed ) {
wc . border_width = c - > oldbw ;
XGrabServer ( dpy ) ;
XGrabServer ( dpy ) ; /* avoid race conditions */
XSetErrorHandler ( xerrordummy ) ;
XConfigureWindow ( dpy , c - > win , CWBorderWidth , & wc ) ; /* restore border */
XUngrabButton ( dpy , AnyButton , AnyModifier , c - > win ) ;
@ -1871,8 +1870,8 @@ updategeom(void)
memcpy ( & unique [ j + + ] , & info [ i ] , sizeof ( XineramaScreenInfo ) ) ;
XFree ( info ) ;
nn = j ;
if ( n < = nn ) {
for ( i = 0 ; i < ( nn - n ) ; i + + ) { /* new monitors available */
if ( n < = nn ) { /* new monitors available */
for ( i = 0 ; i < ( nn - n ) ; i + + ) {
for ( m = mons ; m & & m - > next ; m = m - > next ) ;
if ( m )
m - > next = createmon ( ) ;
@ -1881,8 +1880,8 @@ updategeom(void)
}
for ( i = 0 , m = mons ; i < nn & & m ; m = m - > next , i + + )
if ( i > = n
| | ( unique [ i ] . x_org ! = m - > mx | | unique [ i ] . y_org ! = m - > my
| | unique [ i ] . width ! = m - > mw | | unique [ i ] . height ! = m - > mh ) )
| | unique [ i ] . x_org ! = m - > mx | | unique [ i ] . y_org ! = m - > my
| | unique [ i ] . width ! = m - > mw | | unique [ i ] . height ! = m - > mh )
{
dirty = 1 ;
m - > num = i ;
@ -1892,13 +1891,11 @@ updategeom(void)
m - > mh = m - > wh = unique [ i ] . height ;
updatebarpos ( m ) ;
}
} else {
/* less monitors available nn < n */
} else { /* less monitors available nn < n */
for ( i = nn ; i < n ; i + + ) {
for ( m = mons ; m & & m - > next ; m = m - > next ) ;
while ( m - > clients ) {
while ( ( c = m - > clients ) ) {
dirty = 1 ;
c = m - > clients ;
m - > clients = c - > next ;
detachstack ( c ) ;
c - > mon = mons ;
@ -1913,8 +1910,7 @@ updategeom(void)
free ( unique ) ;
} else
# endif /* XINERAMA */
/* default monitor setup */
{
{ /* default monitor setup */
if ( ! mons )
mons = createmon ( ) ;
if ( mons - > mw ! = sw | | mons - > mh ! = sh ) {