diff options
| author | mbkma <[email protected]> | 2026-11-12 10:20:38 +0100 |
|---|---|---|
| committer | mbkma <[email protected]> | 2026-11-12 10:20:38 +0100 |
| commit | b25ad28368a37d7d382ede6343e8edc04bb21efb (patch) | |
| tree | e2ca72b31aa1694e2d763d16fde48b20b71cd0e8 | |
| parent | 927e9dc5481c55bd1c5565c4a64606494f6bcd45 (diff) | |
| download | mate-settings-daemon-xrandr-virtual-preferred-mode.tar.bz2 mate-settings-daemon-xrandr-virtual-preferred-mode.tar.xz | |
xrandr: follow preferred mode on hotplug_mode_update outputsxrandr-virtual-preferred-mode
Virtual displays (virtio-gpu, qxl, vmwgfx) change their preferred mode
to match the host window. auto_configure_outputs() kept the current
mode for already-active outputs, so a resize of the host window never
took effect. Use the preferred size for active outputs that have
hotplug_mode_update.
At startup, a stored monitors.xml would also pin a stale size on such
displays, so auto-configure them instead, as on_randr_event() already
does for hotplug events.
| -rw-r--r-- | plugins/xrandr/msd-xrandr-manager.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/plugins/xrandr/msd-xrandr-manager.c b/plugins/xrandr/msd-xrandr-manager.c index f49db50..72538c8 100644 --- a/plugins/xrandr/msd-xrandr-manager.c +++ b/plugins/xrandr/msd-xrandr-manager.c @@ -1464,10 +1464,23 @@ auto_configure_outputs (MsdXrandrManager *manager, guint32 timestamp) continue; if (mate_rr_output_info_is_active (output)) { + MateRROutput *rr_output; int width, height; g_assert (mate_rr_output_info_is_connected (output)); mate_rr_output_info_get_geometry (output, NULL, NULL, &width, &height); + + /* Virtual outputs (hotplug_mode_update) change their + * preferred mode to follow the host window, so switch + * to it instead of keeping the current mode. + */ + rr_output = mate_rr_screen_get_output_by_name (priv->rw_screen, + mate_rr_output_info_get_name (output)); + if (rr_output && mate_rr_output_get_hotplug_mode_update (rr_output)) { + width = mate_rr_output_info_get_preferred_width (output); + height = mate_rr_output_info_get_preferred_height (output); + } + mate_rr_output_info_set_geometry (output, x, 0, width, height); x += width; @@ -2651,7 +2664,14 @@ msd_xrandr_manager_start (MsdXrandrManager *manager, } show_timestamps_dialog (manager, "Startup"); - if (!apply_stored_configuration_at_startup (manager, GDK_CURRENT_TIME)) /* we don't have a real timestamp at startup anyway */ + if (has_hotplug_mode_update (manager->priv->rw_screen)) { + /* Virtual displays follow the host window; a stored + * configuration would pin a stale size, so use the + * preferred mode as on_randr_event() does. + */ + auto_configure_outputs (manager, GDK_CURRENT_TIME); + log_msg (" Automatically configured outputs for hotplug_mode_update at startup\n"); + } else if (!apply_stored_configuration_at_startup (manager, GDK_CURRENT_TIME)) /* we don't have a real timestamp at startup anyway */ if (!apply_default_configuration_from_file (manager, GDK_CURRENT_TIME)) if (!g_settings_get_boolean (manager->priv->settings, CONF_KEY_USE_XORG_MONITOR_SETTINGS)) apply_default_boot_configuration (manager, GDK_CURRENT_TIME); |
