Skip to content

Commit 6abd40d

Browse files
author
Dmitry Lavnikevich
committed
Apply pointer_follows_focus option only if it was modified
This prevents pointer being centered on a node when the option is configured. It helps in case when xbanish only enables pointer following focus when the pointer is visible. Which is needed to prevent 'caging' pointer on some modal dialog windows.
1 parent 32b7fd9 commit 6abd40d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/messages.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1698,14 +1698,22 @@ void set_setting(coordinates_t loc, char *name, char *value, FILE *rsp)
16981698
SET_BOOL(borderless_monocle)
16991699
SET_BOOL(gapless_monocle)
17001700
SET_BOOL(swallow_first_click)
1701-
SET_BOOL(pointer_follows_focus)
17021701
SET_BOOL(pointer_follows_monitor)
17031702
SET_BOOL(ignore_ewmh_focus)
17041703
SET_BOOL(ignore_ewmh_struts)
17051704
SET_BOOL(center_pseudo_tiled)
17061705
SET_BOOL(honor_size_hints)
17071706
SET_BOOL(removal_adjustment)
17081707
#undef SET_BOOL
1708+
} else if (streq("pointer_follows_focus", name)) {
1709+
bool pff = pointer_follows_focus;
1710+
if (!parse_bool(value, &pointer_follows_focus)) {
1711+
fail(rsp, "config: %s: Invalid value: '%s'.\n", name, value);
1712+
return;
1713+
}
1714+
if (pff == pointer_follows_focus) {
1715+
return;
1716+
}
17091717
#define SET_MON_BOOL(s) \
17101718
} else if (streq(#s, name)) { \
17111719
if (!parse_bool(value, &s)) { \

0 commit comments

Comments
 (0)