Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/gnome-screenshot/files/, media-gfx/gnome-screenshot/
Date: Fri, 11 Jun 2021 21:59:36
Message-Id: 1623448765.a77ec336240eff63f0cd10ba9e5d9d6e707d07f5.mattst88@gentoo
1 commit: a77ec336240eff63f0cd10ba9e5d9d6e707d07f5
2 Author: Matthew S. Turnbull <sparky <AT> bluefang-logic <DOT> com>
3 AuthorDate: Fri Jun 11 21:09:13 2021 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 11 21:59:25 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a77ec336
7
8 media-gfx/gnome-screenshot: Fix X11 HiDPI support
9
10 Signed-off-by: Matthew S. Turnbull <sparky <AT> bluefang-logic.com>
11 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
12
13 .../files/gnome-screenshot-40.0-fix-hidpi.patch | 40 +++++++++++++
14 .../gnome-screenshot-40.0-r1.ebuild | 66 ++++++++++++++++++++++
15 2 files changed, 106 insertions(+)
16
17 diff --git a/media-gfx/gnome-screenshot/files/gnome-screenshot-40.0-fix-hidpi.patch b/media-gfx/gnome-screenshot/files/gnome-screenshot-40.0-fix-hidpi.patch
18 new file mode 100644
19 index 00000000000..6b493ae6d26
20 --- /dev/null
21 +++ b/media-gfx/gnome-screenshot/files/gnome-screenshot-40.0-fix-hidpi.patch
22 @@ -0,0 +1,40 @@
23 +From f29aceacbd99fc905ac6d871351505e8d9aa7264 Mon Sep 17 00:00:00 2001
24 +From: Alexander Mikhaylenko <alexm@×××××.org>
25 +Date: Sun, 25 Apr 2021 20:00:58 +0000
26 +Subject: [PATCH] Revert "backend-x11: Use pixbuf dimensions when masking"
27 +
28 +This reverts commit f53d720c7d9199075369f085cf5a39a6b53268bc
29 +---
30 + src/screenshot-backend-x11.c | 6 ++++--
31 + 1 file changed, 4 insertions(+), 2 deletions(-)
32 +
33 +diff --git a/src/screenshot-backend-x11.c b/src/screenshot-backend-x11.c
34 +index 990e715..bf32de8 100644
35 +--- a/src/screenshot-backend-x11.c
36 ++++ b/src/screenshot-backend-x11.c
37 +@@ -206,18 +206,20 @@ mask_monitors (GdkPixbuf *pixbuf,
38 + GdkWindow *root_window)
39 + {
40 + GdkDisplay *display;
41 ++ GdkScreen *screen;
42 + cairo_region_t *region_with_monitors;
43 + cairo_region_t *invisible_region;
44 + cairo_rectangle_int_t rect;
45 +
46 + display = gdk_window_get_display (root_window);
47 ++ screen = gdk_display_get_default_screen (display);
48 +
49 + region_with_monitors = make_region_with_monitors (display);
50 +
51 + rect.x = 0;
52 + rect.y = 0;
53 +- rect.width = gdk_pixbuf_get_width (pixbuf);
54 +- rect.height = gdk_pixbuf_get_height (pixbuf);
55 ++ rect.width = gdk_screen_get_width (screen);
56 ++ rect.height = gdk_screen_get_height (screen);
57 +
58 + invisible_region = cairo_region_create_rectangle (&rect);
59 + cairo_region_subtract (invisible_region, region_with_monitors);
60 +--
61 +GitLab
62 +
63
64 diff --git a/media-gfx/gnome-screenshot/gnome-screenshot-40.0-r1.ebuild b/media-gfx/gnome-screenshot/gnome-screenshot-40.0-r1.ebuild
65 new file mode 100644
66 index 00000000000..530e596f46d
67 --- /dev/null
68 +++ b/media-gfx/gnome-screenshot/gnome-screenshot-40.0-r1.ebuild
69 @@ -0,0 +1,66 @@
70 +# Copyright 1999-2021 Gentoo Authors
71 +# Distributed under the terms of the GNU General Public License v2
72 +
73 +EAPI=7
74 +inherit gnome.org gnome2-utils meson readme.gentoo-r1 xdg
75 +
76 +DESCRIPTION="Screenshot utility for GNOME"
77 +HOMEPAGE="https://gitlab.gnome.org/GNOME/gnome-screenshot"
78 +
79 +LICENSE="GPL-2+"
80 +SLOT="0"
81 +IUSE="X"
82 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
83 +
84 +DEPEND="
85 + X? (
86 + x11-libs/libX11
87 + x11-libs/libXext
88 + )
89 + >=dev-libs/glib-2.35.1:2[dbus]
90 + >=x11-libs/gtk+-3.12.0:3
91 + >=gui-libs/libhandy-1:1=
92 +"
93 +RDEPEND="${DEPEND}
94 + >=gnome-base/gsettings-desktop-schemas-0.1.0
95 +"
96 +BDEPEND="
97 + dev-libs/appstream-glib
98 + dev-libs/libxml2:2
99 + >=sys-devel/gettext-0.19.8
100 + virtual/pkgconfig
101 + x11-base/xorg-proto
102 +"
103 +
104 +PATCHES=(
105 + # Fix HiDPI handling in X11 fallback
106 + # https://gitlab.gnome.org/GNOME/gnome-screenshot/-/issues/128
107 + "${FILESDIR}"/${PN}-40.0-fix-hidpi.patch
108 +)
109 +
110 +DOC_CONTENTS="${P} saves screenshots in ~/Pictures/ and defaults to
111 + non-interactive mode when launched from a terminal. If you want to choose
112 + where to save the screenshot, run 'gnome-screenshot --interactive'"
113 +
114 +src_configure() {
115 + local emesonargs=(
116 + $(meson_feature X x11)
117 + )
118 + meson_src_configure
119 +}
120 +
121 +src_install() {
122 + meson_src_install
123 + readme.gentoo_create_doc
124 +}
125 +
126 +pkg_postinst() {
127 + xdg_pkg_postinst
128 + gnome2_schemas_update
129 + readme.gentoo_print_elog
130 +}
131 +
132 +pkg_postrm() {
133 + xdg_pkg_postrm
134 + gnome2_schemas_update
135 +}