From 45c14e600b5d34e691d4fe6a9e582874e82cdd75 Mon Sep 17 00:00:00 2001 From: leigh123linux Date: Oct 26 2017 23:02:22 +0000 Subject: Add upstream fix for desktop scale --- diff --git a/fix_desktop_scale.patch b/fix_desktop_scale.patch new file mode 100644 index 0000000..26a766b --- /dev/null +++ b/fix_desktop_scale.patch @@ -0,0 +1,80 @@ +From ae778dd90cac95456d224106be3f3df1b35e23ec Mon Sep 17 00:00:00 2001 +From: Michael Webster +Date: Thu, 26 Oct 2017 18:25:30 -0400 +Subject: [PATCH] nemo-desktop-manager.c: Account for scale factor when using + cinnamon- supplied monitor info. Cinnamon runs at a scale factor of 1 + always, and things are scaled internally. + +Fixes desktop layout in hidpi mode, when running cinnamon. +--- + libnemo-private/nemo-desktop-utils.c | 18 ++++++++++++++++++ + libnemo-private/nemo-desktop-utils.h | 1 + + src/nemo-desktop-manager.c | 9 +++++++++ + 3 files changed, 28 insertions(+) + +diff --git a/libnemo-private/nemo-desktop-utils.c b/libnemo-private/nemo-desktop-utils.c +index 844190d9c..ecfaaea8e 100644 +--- a/libnemo-private/nemo-desktop-utils.c ++++ b/libnemo-private/nemo-desktop-utils.c +@@ -162,4 +162,22 @@ nemo_desktop_utils_get_monitor_cloned (gint monitor, gint x_primary) + return FALSE; + } + ++gint ++nemo_desktop_utils_get_scale_factor (void) ++{ ++ guint scale; ++ GValue value = G_VALUE_INIT; ++ ++ ensure_screen (); ++ ++ g_value_init (&value, G_TYPE_UINT); ++ ++ if (gdk_screen_get_setting (default_screen, "gdk-window-scaling-factor", &value)) { ++ scale = g_value_get_uint (&value); ++ } else { ++ scale = 1; ++ } ++ ++ return (gint) scale; ++} + +diff --git a/libnemo-private/nemo-desktop-utils.h b/libnemo-private/nemo-desktop-utils.h +index 4eaac2fe0..bb025cf23 100644 +--- a/libnemo-private/nemo-desktop-utils.h ++++ b/libnemo-private/nemo-desktop-utils.h +@@ -33,6 +33,7 @@ gint nemo_desktop_utils_get_primary_monitor (void); + gint nemo_desktop_utils_get_monitor_for_widget (GtkWidget *widget); + gint nemo_desktop_utils_get_num_monitors (void); + gboolean nemo_desktop_utils_get_monitor_cloned (gint monitor, gint x_primary); ++gint nemo_desktop_utils_get_scale_factor (void); + + G_END_DECLS + +diff --git a/src/nemo-desktop-manager.c b/src/nemo-desktop-manager.c +index 26bff4fd0..9b81ae3c4 100644 +--- a/src/nemo-desktop-manager.c ++++ b/src/nemo-desktop-manager.c +@@ -208,6 +208,7 @@ get_window_rect_for_monitor (NemoDesktopManager *manager, + GVariant *out_rect_var; + GdkRectangle out_rect; + gsize n_elem; ++ gint scale_factor; + GError *error; + + error = NULL; +@@ -235,6 +236,14 @@ get_window_rect_for_monitor (NemoDesktopManager *manager, + + out_rect = *( (GdkRectangle *) g_variant_get_fixed_array (out_rect_var, &n_elem, sizeof(gint)) ); + ++ /* GdkScreen sizes are scaled for hidpi already. But if we've gotten this far, we're using ++ * Cinnamon-provided numbers, which aren't scaled. */ ++ ++ scale_factor = nemo_desktop_utils_get_scale_factor (); ++ ++ out_rect.width /= scale_factor; ++ out_rect.height /= scale_factor; ++ + out: + + rect->x = out_rect.x; diff --git a/nemo.spec b/nemo.spec index 358afd8..ed6eb31 100644 --- a/nemo.spec +++ b/nemo.spec @@ -1,7 +1,7 @@ Name: nemo Summary: File manager for Cinnamon Version: 3.6.2 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ and LGPLv2+ URL: https://github.com/linuxmint/ Source0: %url/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz @@ -9,6 +9,7 @@ Source1: nemo-fedora.gschema.override Patch0: remove_desktop_search.patch Patch1: %url/%{name}/pull/1513.patch#/Don-t-scale-text-size-when-zooming.patch Patch3: %url/%{name}/pull/1598.patch#/fix_gdrive.patch +Patch4: %url/%{name}/commit/ae778dd90cac95456d224106be3f3df1b35e23ec.patch#/fix_desktop_scale.patch Requires: redhat-menus Requires: gvfs%{_isa} @@ -173,6 +174,9 @@ fi %{_datadir}/gir-1.0/*.gir %changelog +* Thu Oct 26 2017 Leigh Scott - 3.6.2-2 +- Add upstream fix for desktop scale + * Tue Oct 24 2017 Leigh Scott - 3.6.2-1 - update to 3.6.2 release