[mutter] wayland-outputs: Respect the scaling-factor override
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] wayland-outputs: Respect the scaling-factor override
- Date: Sun, 22 Feb 2015 19:09:40 +0000 (UTC)
commit adccbc9b7b714453329a1b793bfbb3a7325e9b76
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Sun Feb 22 10:40:14 2015 -0800
wayland-outputs: Respect the scaling-factor override
This allows someone to explicitly set a scaling factor that overrides
the computed scale for all outputs.
src/wayland/meta-wayland-outputs.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/src/wayland/meta-wayland-outputs.c b/src/wayland/meta-wayland-outputs.c
index 349b2c3..c019a58 100644
--- a/src/wayland/meta-wayland-outputs.c
+++ b/src/wayland/meta-wayland-outputs.c
@@ -99,6 +99,18 @@ out:
return scale;
}
+static GSettings *desktop_settings;
+
+static int
+get_output_scale (MetaOutput *output)
+{
+ int scale = g_settings_get_uint (desktop_settings, "scaling-factor");
+ if (scale > 0)
+ return scale;
+ else
+ return compute_scale (output);
+}
+
static void
bind_output (struct wl_client *client,
void *data,
@@ -146,7 +158,7 @@ bind_output (struct wl_client *client,
(int)output->crtc->current_mode->height,
(int)output->crtc->current_mode->refresh_rate);
- output->scale = compute_scale (output);
+ output->scale = get_output_scale (output);
if (version >= WL_OUTPUT_SCALE_SINCE_VERSION)
wl_output_send_scale (resource, output->scale);
@@ -283,6 +295,8 @@ meta_wayland_outputs_init (MetaWaylandCompositor *compositor)
{
MetaMonitorManager *monitors;
+ desktop_settings = g_settings_new ("org.gnome.desktop.interface");
+
monitors = meta_monitor_manager_get ();
g_signal_connect (monitors, "monitors-changed",
G_CALLBACK (on_monitors_changed), compositor);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]