Updated handle_button_press() to appropriately pass initial click in inactive windows, plus added 'SwallowFocusClick' config command to disable the functionality. Issue #24

This commit is contained in:
Morgan Aldridge 2021-09-09 11:01:44 -04:00
parent f6b4a84199
commit 2d324d13cf
4 changed files with 13 additions and 1 deletions

View File

@ -431,6 +431,11 @@ void SetSloppyFocus( char *line, FILE *fp )
Scr.flags |= SLOPPYFOCUS; Scr.flags |= SLOPPYFOCUS;
} }
void SetSwallowFocusClick( char *line, FILE *fp )
{
Scr.flags |= SWALLOWFOCUSCLICK;
}
void SetStickyHide( char *line, FILE *fp ) void SetStickyHide( char *line, FILE *fp )
{ {
Scr.flags |= STICKHIDE; Scr.flags |= STICKHIDE;
@ -748,6 +753,7 @@ config_func main_config[]={
{ "StickyHide", SetStickyHide }, { "StickyHide", SetStickyHide },
{ "Style", SetStyles }, { "Style", SetStyles },
{ "Swallow", SetSwallow }, { "Swallow", SetSwallow },
{ "SwallowFocusClick", SetSwallowFocusClick },
{ "System8", SetSystem8 }, { "System8", SetSystem8 },
{ "OpaqueMove", SetOpaqueMove }, { "OpaqueMove", SetOpaqueMove },
{ "OpaqueResize", SetOpaqueResize }, { "OpaqueResize", SetOpaqueResize },

View File

@ -44,6 +44,7 @@ struct configure
extern void SetDeskTopNum( char *, FILE * ); extern void SetDeskTopNum( char *, FILE * );
extern void SetFollowToMouse( char *, FILE * ); extern void SetFollowToMouse( char *, FILE * );
extern void SetSwallowFocusClick( char *, FILE * );
extern void ReadConfigFile( char * ); extern void ReadConfigFile( char * );
extern void FreeStyles( void ); extern void FreeStyles( void );

View File

@ -1384,7 +1384,11 @@ void handle_button_press( XEvent *ev )
ev->xany.window = ev->xbutton.subwindow; ev->xany.window = ev->xbutton.subwindow;
context = GetContext( Tmp_win, ev, &win ); 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 else
XAllowEvents(dpy, ReplayPointer, CurrentTime ); XAllowEvents(dpy, ReplayPointer, CurrentTime );

View File

@ -142,6 +142,7 @@ typedef struct ScreenInfo
#define ONECLICKMENU 0x00010000 #define ONECLICKMENU 0x00010000
#define DEBUGOUT 0x00020000 #define DEBUGOUT 0x00020000
#define ROUNDEDCORNERS 0x00040000 #define ROUNDEDCORNERS 0x00040000
#define SWALLOWFOCUSCLICK 0x00080000
#ifdef USE_LOCALE #ifdef USE_LOCALE
#define MENUBARFONT Scr.MenuBarFs #define MENUBARFONT Scr.MenuBarFs