Added focus_follows_mouse config option
This commit is contained in:
parent
7c7756d75f
commit
7f10970fc7
|
@ -77,6 +77,8 @@ struct Config {
|
|||
int container_stack_limit;
|
||||
int container_stack_limit_value;
|
||||
|
||||
bool focus_follows_mouse;
|
||||
|
||||
const char *default_border;
|
||||
|
||||
/** The modifier which needs to be pressed in combination with your mouse
|
||||
|
|
|
@ -44,6 +44,7 @@ ipc-socket { BEGIN(BIND_AWS_COND); return TOKIPCSOCKET; }
|
|||
ipc_socket { BEGIN(BIND_AWS_COND); return TOKIPCSOCKET; }
|
||||
new_container { return TOKNEWCONTAINER; }
|
||||
new_window { return TOKNEWWINDOW; }
|
||||
focus_follows_mouse { return TOKFOCUSFOLLOWSMOUSE; }
|
||||
default { yylval.number = MODE_DEFAULT; return TOKCONTAINERMODE; }
|
||||
stacking { yylval.number = MODE_STACK; return TOKCONTAINERMODE; }
|
||||
tabbed { yylval.number = MODE_TABBED; return TOKCONTAINERMODE; }
|
||||
|
|
|
@ -197,6 +197,7 @@ void parse_file(const char *f) {
|
|||
%token TOKMODE
|
||||
%token TOKNEWCONTAINER
|
||||
%token TOKNEWWINDOW
|
||||
%token TOKFOCUSFOLLOWSMOUSE
|
||||
%token TOKCONTAINERMODE
|
||||
%token TOKSTACKLIMIT
|
||||
|
||||
|
@ -213,6 +214,7 @@ line:
|
|||
| floating_modifier
|
||||
| new_container
|
||||
| new_window
|
||||
| focus_follows_mouse
|
||||
| workspace
|
||||
| assign
|
||||
| ipcsocket
|
||||
|
@ -379,6 +381,13 @@ new_window:
|
|||
}
|
||||
;
|
||||
|
||||
focus_follows_mouse:
|
||||
TOKFOCUSFOLLOWSMOUSE WHITESPACE NUMBER
|
||||
{
|
||||
config.focus_follows_mouse = ($<number>3 == 0 ? 0 : 1);
|
||||
}
|
||||
;
|
||||
|
||||
workspace:
|
||||
TOKWORKSPACE WHITESPACE NUMBER WHITESPACE TOKSCREEN WHITESPACE screen optional_workspace_name
|
||||
{
|
||||
|
|
|
@ -236,6 +236,7 @@ int handle_enter_notify(void *ignored, xcb_connection_t *conn, xcb_enter_notify_
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (config.focus_follows_mouse)
|
||||
set_focus(conn, client, false);
|
||||
|
||||
return 1;
|
||||
|
|
Loading…
Reference in New Issue