[gnome-settings-daemon/gnome-3-10] xsettings: Enable hidpi scaling on 4K monitors
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/gnome-3-10] xsettings: Enable hidpi scaling on 4K monitors
- Date: Fri, 14 Mar 2014 14:42:57 +0000 (UTC)
commit 28cba9f3b8501f002e132491747693190a567c51
Author: Bastien Nocera <hadess hadess net>
Date: Wed Nov 20 13:25:54 2013 +0100
xsettings: Enable hidpi scaling on 4K monitors
Even if HDMI is used.
https://bugzilla.gnome.org/show_bug.cgi?id=709859
plugins/xsettings/gsd-xsettings-manager.c | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/plugins/xsettings/gsd-xsettings-manager.c b/plugins/xsettings/gsd-xsettings-manager.c
index 520d837..9373a0b 100644
--- a/plugins/xsettings/gsd-xsettings-manager.c
+++ b/plugins/xsettings/gsd-xsettings-manager.c
@@ -229,6 +229,9 @@
#define HIDPI_LIMIT (DPI_FALLBACK * 2)
+/* From http://en.wikipedia.org/wiki/4K_resolution#Resolutions_of_common_formats */
+#define SMALLEST_4K_WIDTH 3656
+
typedef struct _TranslationEntry TranslationEntry;
typedef void (* TranslationFunc) (GnomeXSettingsManager *manager,
TranslationEntry *trans,
@@ -473,6 +476,17 @@ primary_monitor_at_native_resolution (GnomeRROutput *primary)
}
static gboolean
+primary_monitor_is_4k (GnomeRROutput *primary)
+{
+ GnomeRRMode *mode;
+
+ mode = gnome_rr_output_get_current_mode (primary);
+ if (gnome_rr_mode_get_width (mode) >= SMALLEST_4K_WIDTH)
+ return TRUE;
+ return FALSE;
+}
+
+static gboolean
primary_monitor_on_hdmi (GnomeRROutput *primary)
{
const char *name;
@@ -512,8 +526,9 @@ get_window_scale (GnomeXSettingsManager *manager)
output = get_primary_output (rr_screen);
if (!output)
goto out;
- if (!primary_monitor_at_native_resolution (output) ||
- primary_monitor_on_hdmi (output))
+ if (!primary_monitor_at_native_resolution (output))
+ goto out;
+ if (!primary_monitor_is_4k (output) && primary_monitor_on_hdmi (output))
goto out;
display = gdk_display_get_default ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]