summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vdagent-x11-priv.h1
-rw-r--r--src/vdagent-x11-randr.c13
-rw-r--r--src/vdagent-x11.c1
3 files changed, 15 insertions, 0 deletions
diff --git a/src/vdagent-x11-priv.h b/src/vdagent-x11-priv.h
index 2812c3e..89c1080 100644
--- a/src/vdagent-x11-priv.h
+++ b/src/vdagent-x11-priv.h
@@ -121,6 +121,7 @@ struct vdagent_x11 {
int max_height;
int num_monitors;
struct monitor_size monitor_sizes[MONITOR_SIZE_COUNT];
+ VDAgentMonitorsConfig *failed_conf;
} randr;
/* NB: we cache this assuming the driver isn't changed under our feet */
diff --git a/src/vdagent-x11-randr.c b/src/vdagent-x11-randr.c
index e48e519..88abb56 100644
--- a/src/vdagent-x11-randr.c
+++ b/src/vdagent-x11-randr.c
@@ -756,6 +756,11 @@ void vdagent_x11_set_monitor_config(struct vdagent_x11 *x11,
goto exit;
}
+ if (same_monitor_configs(mon_config, x11->randr.failed_conf)) {
+ syslog(LOG_WARNING, "Ignoring previous failed client monitor config");
+ goto exit;
+ }
+
for (i = mon_config->num_of_monitors; i < x11->randr.res->noutput; i++)
xrandr_disable_output(x11, i);
@@ -791,6 +796,14 @@ void vdagent_x11_set_monitor_config(struct vdagent_x11 *x11,
syslog(LOG_WARNING, "Restoring previous config");
vdagent_x11_set_monitor_config(x11, curr, 1);
free(curr);
+ /* Remember this config failed, if the client is maximized or
+ fullscreen it will keep sending the failing config. */
+ free(x11->randr.failed_conf);
+ x11->randr.failed_conf =
+ malloc(config_size(mon_config->num_of_monitors));
+ if (x11->randr.failed_conf)
+ memcpy(x11->randr.failed_conf, mon_config,
+ config_size(mon_config->num_of_monitors));
return;
}
}
diff --git a/src/vdagent-x11.c b/src/vdagent-x11.c
index 1fd36df..401adf5 100644
--- a/src/vdagent-x11.c
+++ b/src/vdagent-x11.c
@@ -184,6 +184,7 @@ void vdagent_x11_destroy(struct vdagent_x11 *x11, int vdagentd_disconnected)
}
XCloseDisplay(x11->display);
+ free(x11->randr.failed_conf);
free(x11);
}