[mate-desktop] 01/01: debian/patches: Add 0002_hidpi_background_support.patch. Support background fallback on HiDPI.

Martin Wimpress flexiondotorg-guest at moszumanska.debian.org
Tue Apr 10 18:09:24 UTC 2018


This is an automated email from the git hooks/post-receive script.

flexiondotorg-guest pushed a commit to branch master
in repository mate-desktop.

commit c60bf488df04e6355c5f0fd641b52841bdf215be
Author: Martin Wimpress <martin.wimpress at ubuntu.com>
Date:   Tue Apr 10 19:04:20 2018 +0100

    debian/patches: Add 0002_hidpi_background_support.patch. Support background fallback on HiDPI.
---
 debian/patches/0002_hidpi_background_support.patch | 93 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 94 insertions(+)

diff --git a/debian/patches/0002_hidpi_background_support.patch b/debian/patches/0002_hidpi_background_support.patch
new file mode 100644
index 0000000..531937b
--- /dev/null
+++ b/debian/patches/0002_hidpi_background_support.patch
@@ -0,0 +1,93 @@
+Author: Victor Kareh <vkareh at vkareh.net>
+Description: Support background fallback on HiDPI
+
+diff --git a/libmate-desktop/mate-bg.c b/libmate-desktop/mate-bg.c
+index e1d05db..0201552 100644
+--- a/libmate-desktop/mate-bg.c
++++ b/libmate-desktop/mate-bg.c
+@@ -276,6 +276,9 @@ mate_bg_load_from_preferences (MateBG *bg)
+ 
+ 	mate_bg_load_from_gsettings (bg, settings);
+ 	g_object_unref (settings);
++
++	/* Queue change to force background redraw */
++	queue_changed (bg);
+ }
+ 
+ /* This function loads default system settings */
+@@ -1137,6 +1140,36 @@ mate_bg_create_surface (MateBG      *bg,
+ 			int	     width,
+ 			int	     height,
+ 			gboolean     root)
++{
++	return mate_bg_create_surface_scale (bg,
++					     window,
++					     width,
++					     height,
++					     1,
++					     root);
++}
++
++/**
++ * mate_bg_create_surface:
++ * @bg: MateBG
++ * @window:
++ * @width:
++ * @height:
++ * @scale:
++ * @root:
++ *
++ * Create a scaled surface that can be set as background for @window. If @is_root is
++ * TRUE, the surface created will be created by a temporary X server connection
++ * so that if someone calls XKillClient on it, it won't affect the application
++ * who created it.
++ **/
++cairo_surface_t *
++mate_bg_create_surface_scale (MateBG      *bg,
++			      GdkWindow   *window,
++			      int          width,
++			      int          height,
++			      int          scale,
++			      gboolean     root)
+ {
+ 	int pm_width, pm_height;
+ 
+@@ -1156,10 +1189,9 @@ mate_bg_create_surface (MateBG      *bg,
+ 
+ 	mate_bg_get_pixmap_size (bg, width, height, &pm_width, &pm_height);
+ 
+-
+ 	if (root)
+ 	{
+-		surface = make_root_pixmap (window, pm_width, pm_height);
++		surface = make_root_pixmap (window, pm_width * scale, pm_height * scale);
+ 	}
+ 	else
+ 	{
+@@ -1168,6 +1200,8 @@ mate_bg_create_surface (MateBG      *bg,
+ 	}
+ 
+ 	cr = cairo_create (surface);
++	cairo_scale (cr, (double)scale, (double)scale);
++
+ 	if (!bg->filename && bg->color_type == MATE_BG_COLOR_SOLID) {
+ 		gdk_cairo_set_source_rgba (cr, &(bg->primary));
+ 	}
+diff --git a/libmate-desktop/mate-bg.h b/libmate-desktop/mate-bg.h
+index a1adf36..16fda8c 100644
+--- a/libmate-desktop/mate-bg.h
++++ b/libmate-desktop/mate-bg.h
+@@ -127,6 +127,13 @@ cairo_surface_t *mate_bg_create_surface        (MateBG               *bg,
+ 						int                   height,
+ 						gboolean              root);
+ 
++cairo_surface_t *mate_bg_create_surface_scale  (MateBG               *bg,
++						GdkWindow            *window,
++						int                   width,
++						int                   height,
++						int                   scale,
++						gboolean              root);
++
+ gboolean         mate_bg_get_image_size        (MateBG               *bg,
+ 						 MateDesktopThumbnailFactory *factory,
+                                                  int                    best_width,
diff --git a/debian/patches/series b/debian/patches/series
index 0bfc4fa..ceac1c5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 0001_fix_font_color.patch
+0002_hidpi_background_support.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mate/mate-desktop.git



More information about the pkg-mate-commits mailing list