mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
monitor-manager: check for underscan setting validity upfront
Instead of doing a roundtrip to the X server before setting it, rely on the previous value fetched before the configuration was sent over DBus. This matches the argument check we already do elsewhere, and will allow us to more easily add an additional condition to determine if underscan is supported. https://gitlab.gnome.org/GNOME/mutter/merge_requests/673
This commit is contained in:
parent
62072838c9
commit
8665084df1
@ -1649,6 +1649,7 @@ create_monitor_config_from_variant (MetaMonitorManager *manager,
|
|||||||
MetaMonitorModeSpec *monitor_mode_spec;
|
MetaMonitorModeSpec *monitor_mode_spec;
|
||||||
g_autoptr (GVariant) properties_variant = NULL;
|
g_autoptr (GVariant) properties_variant = NULL;
|
||||||
gboolean enable_underscanning = FALSE;
|
gboolean enable_underscanning = FALSE;
|
||||||
|
gboolean set_underscanning = FALSE;
|
||||||
|
|
||||||
g_variant_get (monitor_config_variant, "(ss@a{sv})",
|
g_variant_get (monitor_config_variant, "(ss@a{sv})",
|
||||||
&connector,
|
&connector,
|
||||||
@ -1671,7 +1672,18 @@ create_monitor_config_from_variant (MetaMonitorManager *manager,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_variant_lookup (properties_variant, "underscanning", "b", &enable_underscanning);
|
set_underscanning =
|
||||||
|
g_variant_lookup (properties_variant, "underscanning", "b",
|
||||||
|
&enable_underscanning);
|
||||||
|
if (set_underscanning)
|
||||||
|
{
|
||||||
|
if (enable_underscanning && !meta_monitor_supports_underscanning (monitor))
|
||||||
|
{
|
||||||
|
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||||
|
"Underscanning requested but unsupported");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
monitor_spec = meta_monitor_spec_clone (meta_monitor_get_spec (monitor));
|
monitor_spec = meta_monitor_spec_clone (meta_monitor_get_spec (monitor));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user