Fix monitor setting overriding follow_mode

Ignore the monitor setting if it's set to a non-zero value and the
follow mode isn't none.

Fixes #755
This commit is contained in:
Nikos Tsipinakis 2020-08-20 13:48:32 +03:00
parent ca6ce6868e
commit e59d203256

View File

@ -304,21 +304,22 @@ struct screen_info *get_active_screen(void)
{
int ret = 0;
bool force_follow_mouse = false;
if (settings.monitor > 0 && settings.monitor < screens_len) {
ret = settings.monitor;
goto sc_cleanup;
}
x_follow_setup_error_handler();
if (settings.f_mode == FOLLOW_NONE) {
if (settings.monitor >= 0 && settings.monitor < screens_len) {
ret = settings.monitor;
} else {
ret = XDefaultScreen(xctx.dpy);
goto sc_cleanup;
}
goto sc_cleanup;
} else {
int x, y;
assert(settings.f_mode == FOLLOW_MOUSE
|| settings.f_mode == FOLLOW_KEYBOARD);
x_follow_setup_error_handler();
Window root =
RootWindow(xctx.dpy, DefaultScreen(xctx.dpy));