From 9ba0512ec7cad2a54c898e9954ed7b4fda79b05b Mon Sep 17 00:00:00 2001 From: Adel Gadllah Date: Feb 18 2014 22:46:38 +0000 Subject: hdpi: Now that the "proper" patch got fixed upstream use it --- diff --git a/0001-layout-Set-high-dpi-scaling-factor.patch b/0001-layout-Set-high-dpi-scaling-factor.patch deleted file mode 100644 index 2d3fc33..0000000 --- a/0001-layout-Set-high-dpi-scaling-factor.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 3864581d8f3616aa4ce400b41843e48ffbb7fd47 Mon Sep 17 00:00:00 2001 -From: Adel Gadllah -Date: Wed, 12 Feb 2014 17:40:01 +0100 -Subject: [PATCH] layout: Set high dpi scaling factor - -Set the scaling factor when the dpi is above the hidpi threshold. - -https://bugzilla.gnome.org/show_bug.cgi?id=705410 ---- - js/ui/layout.js | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/js/ui/layout.js b/js/ui/layout.js -index 6f7bceb..b636971 100644 ---- a/js/ui/layout.js -+++ b/js/ui/layout.js -@@ -31,6 +31,9 @@ const MESSAGE_TRAY_PRESSURE_TIMEOUT = 1000; // ms - const HOT_CORNER_PRESSURE_THRESHOLD = 100; // pixels - const HOT_CORNER_PRESSURE_TIMEOUT = 1000; // ms - -+// We scale up when the dpi is higher then this (same value used by gsd) -+const HIGH_DPI_LIMIT = 192; -+ - function isPopupMetaWindow(actor) { - switch(actor.meta_window.get_window_type()) { - case Meta.WindowType.DROPDOWN_MENU: -@@ -486,8 +489,19 @@ const LayoutManager = new Lang.Class({ - return false; - }, - -+ _updateScaling: function() { -+ let primary = this.monitors[this.primaryIndex]; -+ let dpi_x = primary.width / (global.gdk_screen.get_monitor_width_mm(this.primaryIndex) / 25.4); -+ let dpi_y = primary.height / (global.gdk_screen.get_monitor_height_mm(this.primaryIndex) / 25.4); -+ if (dpi_x > HIGH_DPI_LIMIT && dpi_y > HIGH_DPI_LIMIT) -+ St.ThemeContext.get_for_stage(global.stage).scale_factor = 2; -+ else -+ St.ThemeContext.get_for_stage(global.stage).scale_factor = 1; -+ }, -+ - _monitorsChanged: function() { - this._updateMonitors(); -+ this._updateScaling(); - this._updateBoxes(); - this._updateTrayBarrier(); - this._updateHotCorners(); --- -1.8.5.3 - diff --git a/0002-shell-global-Set-high-dpi-scaling-factor.patch b/0002-shell-global-Set-high-dpi-scaling-factor.patch index 483bca3..3df6b36 100644 --- a/0002-shell-global-Set-high-dpi-scaling-factor.patch +++ b/0002-shell-global-Set-high-dpi-scaling-factor.patch @@ -44,8 +44,8 @@ index cc82566..b2b6e52 100644 + * a race condition. GdkScreen's monitors-changed signal is + * emitted *after* the xsetting has been updated. + */ -+ g_signal_connect (global->gdk_screen, "monitors-changed", -+ G_CALLBACK (update_scale_factor), global); ++ g_signal_connect_swapped (global->gdk_screen, "monitors-changed", ++ G_CALLBACK (update_scale_factor), global); + gdk_event_handler_set (gnome_shell_gdk_event_handler, global, NULL); diff --git a/gnome-shell.spec b/gnome-shell.spec index 30ba6f4..59b6ef6 100644 --- a/gnome-shell.spec +++ b/gnome-shell.spec @@ -1,6 +1,6 @@ Name: gnome-shell Version: 3.10.3 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Window management and application launching for GNOME Group: User Interface/Desktops @@ -18,8 +18,7 @@ Patch11: track-skip-taskbar-changes.patch Patch12: 0001-window-tracker-Be-more-cautious-when-setting-focus-a.patch Patch13: 0001-shell-app-Don-t-crash-when-trying-to-dispose.patch Patch14: 0001-st-Add-high-dpi-support.patch -Patch15: 0001-layout-Set-high-dpi-scaling-factor.patch -Patch16: hidpi-vnc-fix.patch +Patch15: 0002-shell-global-Set-high-dpi-scaling-factor.patch %define clutter_version 1.13.4 %define gnome_bluetooth_version 1:3.9.0 @@ -130,7 +129,6 @@ easy to use experience. %patch13 -p1 -b .fix-app-dispose-crash %patch14 -p1 -b .hdpi-st %patch15 -p1 -b .hdpi-layout -%patch16 -p1 -b .hdpi-vnc %build (if ! test -x configure; then NOCONFIGURE=1 ./autogen.sh; fi; @@ -190,6 +188,10 @@ glib-compile-schemas --allow-any-name %{_datadir}/glib-2.0/schemas &> /dev/null %exclude %{_datadir}/gtk-doc %changelog +* Tue Feb 18 2014 Adel Gadllah - 3.10.4-8 +- Don't duplicate gsd code and just use the xsetting it + exports + * Mon Feb 17 2014 Adel Gadllah - 3.10.4-7 - Don't enable high dpi scaling for vnc / xrdp - Fixes RH #1065563 diff --git a/hidpi-vnc-fix.patch b/hidpi-vnc-fix.patch deleted file mode 100644 index 5aeff81..0000000 --- a/hidpi-vnc-fix.patch +++ /dev/null @@ -1,60 +0,0 @@ -From e5c982351f3e47824194262733586fa4fd7e47f5 Mon Sep 17 00:00:00 2001 -From: Adel Gadllah -Date: Mon, 17 Feb 2014 13:34:42 +0100 -Subject: [PATCH 1/2] layout: Protect against broken monitor size reports - -VNC / XRDP reports nonsensial (i.e 0) monitor dimensions causing us to -end up with a dpi of "Infinity" and thus scale even though we shouldn't. - -https://bugzilla.redhat.com/show_bug.cgi?id=1065788 ---- - js/ui/layout.js | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/js/ui/layout.js b/js/ui/layout.js -index ab03f51..c68ba9d 100644 ---- a/js/ui/layout.js -+++ b/js/ui/layout.js -@@ -489,6 +489,12 @@ const LayoutManager = new Lang.Class({ - - _updateScaling: function() { - let primary = this.monitors[this.primaryIndex]; -+ let width_mm = global.gdk_screen.get_monitor_width_mm(this.primaryIndex); -+ let height_mm = global.gdk_screen.get_monitor_height_mm(this.primaryIndex); -+ if (width_mm == 0 || height_mm == 0) { -+ St.ThemeContext.get_for_stage(global.stage).scale_factor = 1; -+ return; -+ } - let dpi_x = primary.width / (global.gdk_screen.get_monitor_width_mm(this.primaryIndex) / 25.4); - let dpi_y = primary.height / (global.gdk_screen.get_monitor_height_mm(this.primaryIndex) / 25.4); - if (dpi_x > HIGH_DPI_LIMIT && dpi_y > HIGH_DPI_LIMIT) --- -1.8.5.3 - -From 03b46a551055cbffce12b89d6c2a58825fbfa15f Mon Sep 17 00:00:00 2001 -From: Adel Gadllah -Date: Mon, 17 Feb 2014 13:42:20 +0100 -Subject: [PATCH 2/2] layout: Don't query the monitor size twice - ---- - js/ui/layout.js | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/js/ui/layout.js b/js/ui/layout.js -index c68ba9d..59dcc03 100644 ---- a/js/ui/layout.js -+++ b/js/ui/layout.js -@@ -495,8 +495,8 @@ const LayoutManager = new Lang.Class({ - St.ThemeContext.get_for_stage(global.stage).scale_factor = 1; - return; - } -- let dpi_x = primary.width / (global.gdk_screen.get_monitor_width_mm(this.primaryIndex) / 25.4); -- let dpi_y = primary.height / (global.gdk_screen.get_monitor_height_mm(this.primaryIndex) / 25.4); -+ let dpi_x = primary.width / (width_mm / 25.4); -+ let dpi_y = primary.height / (height_mm / 25.4); - if (dpi_x > HIGH_DPI_LIMIT && dpi_y > HIGH_DPI_LIMIT) - St.ThemeContext.get_for_stage(global.stage).scale_factor = 2; - else --- -1.8.5.3 -