summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2026-05-04 15:49:10 -0400
committerVictor Kareh <[email protected]>2026-05-27 17:49:21 -0400
commit13b2430ee3e55b0a84918d97a6469ea87cebeda7 (patch)
tree5fc9d53d42338796250bdd104930d564d725d814 /plugins
parent42ceb8b7b8f09d6180ac5e506943cd070cf3bfc3 (diff)
downloadmate-settings-daemon-13b2430ee3e55b0a84918d97a6469ea87cebeda7.tar.bz2
mate-settings-daemon-13b2430ee3e55b0a84918d97a6469ea87cebeda7.tar.xz
xrandr: Handle hotplug_mode_update for VM guest resizingHEADmaster
When an output has the hotplug_mode_update property (e.g. SPICE/QXL virtual displays), auto-configure to the new preferred mode on hotplug events instead of applying stored configuration from monitors.xml. This allows VM guest resolutions to follow host window resizes, which stopped working when spice-vdagent switched from reconfiguring displays directly to sending hotplug events expecting the DE to handle them. Fixes #78
Diffstat (limited to 'plugins')
-rw-r--r--plugins/xrandr/msd-xrandr-manager.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/plugins/xrandr/msd-xrandr-manager.c b/plugins/xrandr/msd-xrandr-manager.c
index 78e538f..4402fd9 100644
--- a/plugins/xrandr/msd-xrandr-manager.c
+++ b/plugins/xrandr/msd-xrandr-manager.c
@@ -1572,6 +1572,22 @@ apply_color_profiles (void)
}
}
+static gboolean
+has_hotplug_mode_update (MateRRScreen *screen)
+{
+ MateRROutput **outputs;
+ int i;
+
+ outputs = mate_rr_screen_list_outputs (screen);
+
+ for (i = 0; outputs[i] != NULL; i++) {
+ if (mate_rr_output_get_hotplug_mode_update (outputs[i]))
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static void
on_randr_event (MateRRScreen *screen, gpointer data)
{
@@ -1600,6 +1616,24 @@ on_randr_event (MateRRScreen *screen, gpointer data)
*/
show_timestamps_dialog (manager, "ignoring since change > config");
log_msg (" Ignoring event since change >= config\n");
+ } else if (has_hotplug_mode_update (screen)) {
+ /* An output has the hotplug_mode_update property, which
+ * means that the driver is requesting that the desktop
+ * environment apply a new preferred mode on hotplug events
+ * to handle dynamic guest resizing (e.g. SPICE/QXL in VMs).
+ *
+ * In this case, always auto-configure to use the new
+ * preferred mode rather than applying stored configurations.
+ */
+
+ show_timestamps_dialog (manager, "hotplug_mode_update detected, auto-configuring");
+
+ if (config_timestamp != priv->last_config_timestamp) {
+ priv->last_config_timestamp = config_timestamp;
+ auto_configure_outputs (manager, config_timestamp);
+ log_msg (" Automatically configured outputs for hotplug_mode_update\n");
+ } else
+ log_msg (" Ignored hotplug_mode_update event as timestamps are the same\n");
} else {
/* Here, config_timestamp > change_timestamp. This means that
* the screen got reconfigured because of hotplug/unplug; the X