improve background handling for HIDPI monitors
This commit is contained in:
parent
49a23847c0
commit
c796e034ce
@ -15,7 +15,7 @@
|
||||
Name: mate-settings-daemon
|
||||
Version: %{branch}.1
|
||||
%if 0%{?rel_build}
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
%else
|
||||
Release: 0.6%{?git_rel}%{?dist}
|
||||
%endif
|
||||
@ -33,6 +33,8 @@ URL: http://mate-desktop.org
|
||||
%if 0%{?rhel}
|
||||
Patch1: mate-settings-daemon_fix-xrdb-plugin-for-rhel.patch
|
||||
%endif
|
||||
# https://github.com/mate-desktop/mate-settings-daemon/pull/217
|
||||
Patch2: mate-settings-daemon_0001-Support-background-fallback-on-HiDPI.patch
|
||||
|
||||
BuildRequires: dbus-glib-devel
|
||||
BuildRequires: dconf-devel
|
||||
@ -134,6 +136,10 @@ desktop-file-validate %{buildroot}%{_sysconfdir}/xdg/autostart/mate-settings-dae
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Apr 18 2018 Wolfgang Ulbrich <fedora@raveit.de> - 1.20.1-2
|
||||
- improve background handling for HIDPI monitors
|
||||
- use https://github.com/mate-desktop/mate-settings-daemon/pull/217
|
||||
|
||||
* Tue Mar 27 2018 Wolfgang Ulbrich <fedora@raveit.de> - 1.20.1-1
|
||||
- update to 1.20.1
|
||||
- drop IconCache rpm scriptlet
|
||||
|
@ -0,0 +1,58 @@
|
||||
From da629637721a95836efd9044ad1b4c978d0abffa Mon Sep 17 00:00:00 2001
|
||||
From: Victor Kareh <vkareh@vkareh.net>
|
||||
Date: Tue, 10 Apr 2018 00:54:35 -0400
|
||||
Subject: [PATCH] Support background fallback on HiDPI
|
||||
|
||||
This change is a super hacky way of supporting the fallback desktop background (without caja) on HiDPI displays. It does this by doing two things: using a new function that scales up the background surface; and by loading settings using an updated function that triggers a redraw.
|
||||
---
|
||||
plugins/background/msd-background-manager.c | 16 +++++++++-------
|
||||
1 file changed, 9 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/plugins/background/msd-background-manager.c b/plugins/background/msd-background-manager.c
|
||||
index b4eaca6..724e01e 100644
|
||||
--- a/plugins/background/msd-background-manager.c
|
||||
+++ b/plugins/background/msd-background-manager.c
|
||||
@@ -185,11 +185,12 @@ real_draw_bg (MsdBackgroundManager *manager,
|
||||
{
|
||||
MsdBackgroundManagerPrivate *p = manager->priv;
|
||||
GdkWindow *window = gdk_screen_get_root_window (screen);
|
||||
- gint width = WidthOfScreen (gdk_x11_screen_get_xscreen (screen));
|
||||
- gint height = HeightOfScreen (gdk_x11_screen_get_xscreen (screen));
|
||||
+ gint scale = gdk_window_get_scale_factor (window);
|
||||
+ gint width = WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale;
|
||||
+ gint height = HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale;
|
||||
|
||||
free_bg_surface (manager);
|
||||
- p->surface = mate_bg_create_surface (p->bg, window, width, height, TRUE);
|
||||
+ p->surface = mate_bg_create_surface_scale (p->bg, window, width, height, scale, TRUE);
|
||||
|
||||
if (p->do_fade)
|
||||
{
|
||||
@@ -255,10 +256,12 @@ on_screen_size_changed (GdkScreen *screen,
|
||||
if (!p->msd_can_draw || p->draw_in_progress || caja_is_drawing_bg (manager))
|
||||
return;
|
||||
|
||||
+ GdkWindow *window = gdk_screen_get_root_window (screen);
|
||||
+ gint scale = gdk_window_get_scale_factor (window);
|
||||
gint scr_num = gdk_x11_screen_get_screen_number (screen);
|
||||
gchar *old_size = g_list_nth_data (manager->priv->scr_sizes, scr_num);
|
||||
- gchar *new_size = g_strdup_printf ("%dx%d", WidthOfScreen (gdk_x11_screen_get_xscreen (screen)),
|
||||
- HeightOfScreen (gdk_x11_screen_get_xscreen (screen)));
|
||||
+ gchar *new_size = g_strdup_printf ("%dx%d", WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale,
|
||||
+ HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale);
|
||||
if (g_strcmp0 (old_size, new_size) != 0)
|
||||
{
|
||||
g_debug ("Screen%d size changed: %s -> %s", scr_num, old_size, new_size);
|
||||
@@ -297,8 +300,7 @@ settings_change_event_idle_cb (MsdBackgroundManager *manager)
|
||||
{
|
||||
mate_settings_profile_start ("settings_change_event_idle_cb");
|
||||
|
||||
- mate_bg_load_from_gsettings (manager->priv->bg,
|
||||
- manager->priv->settings);
|
||||
+ mate_bg_load_from_preferences (manager->priv->bg);
|
||||
|
||||
mate_settings_profile_end ("settings_change_event_idle_cb");
|
||||
|
||||
--
|
||||
2.17.0
|
||||
|
Loading…
Reference in New Issue
Block a user