@ -21,8 +21,7 @@ KEYS
# define CLEANMASK(mask) (mask & ~(numlockmask | LockMask))
# define CLEANMASK(mask) (mask & ~(numlockmask | LockMask))
static void
static void
movemouse ( Client * c )
movemouse ( Client * c ) {
{
int x1 , y1 , ocx , ocy , di ;
int x1 , y1 , ocx , ocy , di ;
unsigned int dui ;
unsigned int dui ;
Window dummy ;
Window dummy ;
@ -37,7 +36,8 @@ movemouse(Client *c)
for ( ; ; ) {
for ( ; ; ) {
XMaskEvent ( dpy , MOUSEMASK | ExposureMask , & ev ) ;
XMaskEvent ( dpy , MOUSEMASK | ExposureMask , & ev ) ;
switch ( ev . type ) {
switch ( ev . type ) {
default : break ;
default :
break ;
case Expose :
case Expose :
handler [ Expose ] ( & ev ) ;
handler [ Expose ] ( & ev ) ;
break ;
break ;
@ -55,8 +55,7 @@ movemouse(Client *c)
}
}
static void
static void
resizemouse ( Client * c )
resizemouse ( Client * c ) {
{
int ocx , ocy ;
int ocx , ocy ;
int nw , nh ;
int nw , nh ;
Corner sticky ;
Corner sticky ;
@ -71,7 +70,8 @@ resizemouse(Client *c)
for ( ; ; ) {
for ( ; ; ) {
XMaskEvent ( dpy , MOUSEMASK | ExposureMask , & ev ) ;
XMaskEvent ( dpy , MOUSEMASK | ExposureMask , & ev ) ;
switch ( ev . type ) {
switch ( ev . type ) {
default : break ;
default :
break ;
case Expose :
case Expose :
handler [ Expose ] ( & ev ) ;
handler [ Expose ] ( & ev ) ;
break ;
break ;
@ -97,8 +97,7 @@ resizemouse(Client *c)
}
}
static void
static void
buttonpress ( XEvent * e )
buttonpress ( XEvent * e ) {
{
int x ;
int x ;
Arg a ;
Arg a ;
Client * c ;
Client * c ;
@ -147,8 +146,7 @@ buttonpress(XEvent *e)
}
}
static void
static void
synconfig ( Client * c , int x , int y , int w , int h , unsigned int border )
synconfig ( Client * c , int x , int y , int w , int h , unsigned int border ) {
{
XEvent synev ;
XEvent synev ;
synev . type = ConfigureNotify ;
synev . type = ConfigureNotify ;
@ -165,8 +163,7 @@ synconfig(Client *c, int x, int y, int w, int h, unsigned int border)
}
}
static void
static void
configurerequest ( XEvent * e )
configurerequest ( XEvent * e ) {
{
unsigned long newmask ;
unsigned long newmask ;
Client * c ;
Client * c ;
XConfigureRequestEvent * ev = & e - > xconfigurerequest ;
XConfigureRequestEvent * ev = & e - > xconfigurerequest ;
@ -219,8 +216,7 @@ configurerequest(XEvent *e)
}
}
static void
static void
destroynotify ( XEvent * e )
destroynotify ( XEvent * e ) {
{
Client * c ;
Client * c ;
XDestroyWindowEvent * ev = & e - > xdestroywindow ;
XDestroyWindowEvent * ev = & e - > xdestroywindow ;
@ -229,8 +225,7 @@ destroynotify(XEvent *e)
}
}
static void
static void
enternotify ( XEvent * e )
enternotify ( XEvent * e ) {
{
Client * c ;
Client * c ;
XCrossingEvent * ev = & e - > xcrossing ;
XCrossingEvent * ev = & e - > xcrossing ;
@ -247,8 +242,7 @@ enternotify(XEvent *e)
}
}
static void
static void
expose ( XEvent * e )
expose ( XEvent * e ) {
{
Client * c ;
Client * c ;
XExposeEvent * ev = & e - > xexpose ;
XExposeEvent * ev = & e - > xexpose ;
@ -261,8 +255,7 @@ expose(XEvent *e)
}
}
static void
static void
keypress ( XEvent * e )
keypress ( XEvent * e ) {
{
static unsigned int len = sizeof ( key ) / sizeof ( key [ 0 ] ) ;
static unsigned int len = sizeof ( key ) / sizeof ( key [ 0 ] ) ;
unsigned int i ;
unsigned int i ;
KeySym keysym ;
KeySym keysym ;
@ -270,8 +263,8 @@ keypress(XEvent *e)
keysym = XKeycodeToKeysym ( dpy , ( KeyCode ) ev - > keycode , 0 ) ;
keysym = XKeycodeToKeysym ( dpy , ( KeyCode ) ev - > keycode , 0 ) ;
for ( i = 0 ; i < len ; i + + ) {
for ( i = 0 ; i < len ; i + + ) {
if ( keysym = = key [ i ] . keysym & &
if ( keysym = = key [ i ] . keysym
CLEANMASK ( key [ i ] . mod ) = = CLEANMASK ( ev - > state ) )
& & CLEANMASK ( key [ i ] . mod ) = = CLEANMASK ( ev - > state ) )
{
{
if ( key [ i ] . func )
if ( key [ i ] . func )
key [ i ] . func ( & key [ i ] . arg ) ;
key [ i ] . func ( & key [ i ] . arg ) ;
@ -281,8 +274,7 @@ keypress(XEvent *e)
}
}
static void
static void
leavenotify ( XEvent * e )
leavenotify ( XEvent * e ) {
{
XCrossingEvent * ev = & e - > xcrossing ;
XCrossingEvent * ev = & e - > xcrossing ;
if ( ( ev - > window = = root ) & & ! ev - > same_screen ) {
if ( ( ev - > window = = root ) & & ! ev - > same_screen ) {
@ -292,8 +284,7 @@ leavenotify(XEvent *e)
}
}
static void
static void
mappingnotify ( XEvent * e )
mappingnotify ( XEvent * e ) {
{
XMappingEvent * ev = & e - > xmapping ;
XMappingEvent * ev = & e - > xmapping ;
XRefreshKeyboardMapping ( ev ) ;
XRefreshKeyboardMapping ( ev ) ;
@ -302,8 +293,7 @@ mappingnotify(XEvent *e)
}
}
static void
static void
maprequest ( XEvent * e )
maprequest ( XEvent * e ) {
{
static XWindowAttributes wa ;
static XWindowAttributes wa ;
XMapRequestEvent * ev = & e - > xmaprequest ;
XMapRequestEvent * ev = & e - > xmaprequest ;
@ -321,8 +311,7 @@ maprequest(XEvent *e)
}
}
static void
static void
propertynotify ( XEvent * e )
propertynotify ( XEvent * e ) {
{
Client * c ;
Client * c ;
Window trans ;
Window trans ;
XPropertyEvent * ev = & e - > xproperty ;
XPropertyEvent * ev = & e - > xproperty ;
@ -354,8 +343,7 @@ propertynotify(XEvent *e)
}
}
static void
static void
unmapnotify ( XEvent * e )
unmapnotify ( XEvent * e ) {
{
Client * c ;
Client * c ;
XUnmapEvent * ev = & e - > xunmap ;
XUnmapEvent * ev = & e - > xunmap ;
@ -380,8 +368,7 @@ void (*handler[LASTEvent]) (XEvent *) = {
} ;
} ;
void
void
grabkeys ( )
grabkeys ( ) {
{
static unsigned int len = sizeof ( key ) / sizeof ( key [ 0 ] ) ;
static unsigned int len = sizeof ( key ) / sizeof ( key [ 0 ] ) ;
unsigned int i ;
unsigned int i ;
KeyCode code ;
KeyCode code ;
@ -401,8 +388,7 @@ grabkeys()
}
}
void
void
procevent ( )
procevent ( ) {
{
XEvent ev ;
XEvent ev ;
while ( XPending ( dpy ) ) {
while ( XPending ( dpy ) ) {
@ -411,4 +397,3 @@ procevent()
( handler [ ev . type ] ) ( & ev ) ; /* call handler */
( handler [ ev . type ] ) ( & ev ) ; /* call handler */
}
}
}
}