diff --git a/mlvwm/config.c b/mlvwm/config.c index 7de9882..3fcfca6 100644 --- a/mlvwm/config.c +++ b/mlvwm/config.c @@ -431,6 +431,11 @@ void SetSloppyFocus( char *line, FILE *fp ) Scr.flags |= SLOPPYFOCUS; } +void SetSwallowFocusClick( char *line, FILE *fp ) +{ + Scr.flags |= SWALLOWFOCUSCLICK; +} + void SetStickyHide( char *line, FILE *fp ) { Scr.flags |= STICKHIDE; @@ -748,6 +753,7 @@ config_func main_config[]={ { "StickyHide", SetStickyHide }, { "Style", SetStyles }, { "Swallow", SetSwallow }, + { "SwallowFocusClick", SetSwallowFocusClick }, { "System8", SetSystem8 }, { "OpaqueMove", SetOpaqueMove }, { "OpaqueResize", SetOpaqueResize }, diff --git a/mlvwm/config.h b/mlvwm/config.h index 05bb0b2..236be8d 100644 --- a/mlvwm/config.h +++ b/mlvwm/config.h @@ -44,6 +44,7 @@ struct configure extern void SetDeskTopNum( char *, FILE * ); extern void SetFollowToMouse( char *, FILE * ); +extern void SetSwallowFocusClick( char *, FILE * ); extern void ReadConfigFile( char * ); extern void FreeStyles( void ); diff --git a/mlvwm/event.c b/mlvwm/event.c index 76d11d6..ff35853 100644 --- a/mlvwm/event.c +++ b/mlvwm/event.c @@ -1384,7 +1384,11 @@ void handle_button_press( XEvent *ev ) ev->xany.window = ev->xbutton.subwindow; context = GetContext( Tmp_win, ev, &win ); } - XAllowEvents(dpy, AsyncPointer, CurrentTime ); + if ( context==C_TITLE || Scr.flags&SWALLOWFOCUSCLICK ) + XAllowEvents(dpy, AsyncPointer, CurrentTime ); + else { + XAllowEvents(dpy, ReplayPointer, CurrentTime ); + } } else XAllowEvents(dpy, ReplayPointer, CurrentTime ); diff --git a/mlvwm/screen.h b/mlvwm/screen.h index 4aafe92..1864972 100644 --- a/mlvwm/screen.h +++ b/mlvwm/screen.h @@ -142,6 +142,7 @@ typedef struct ScreenInfo #define ONECLICKMENU 0x00010000 #define DEBUGOUT 0x00020000 #define ROUNDEDCORNERS 0x00040000 +#define SWALLOWFOCUSCLICK 0x00080000 #ifdef USE_LOCALE #define MENUBARFONT Scr.MenuBarFs