summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew S. Turnbull <sparky@bluefang-logic.com>2021-06-11 17:09:13 -0400
committerMatt Turner <mattst88@gentoo.org>2021-06-11 14:59:25 -0700
commita77ec336240eff63f0cd10ba9e5d9d6e707d07f5 (patch)
tree0bb4265ff0dc72984cd5ffaebd4daa94e27282bb
parentprofiles/package.mask: Mask gnat-gpl-2016 compilers (diff)
downloadgentoo-a77ec336240eff63f0cd10ba9e5d9d6e707d07f5.tar.gz
gentoo-a77ec336240eff63f0cd10ba9e5d9d6e707d07f5.tar.bz2
gentoo-a77ec336240eff63f0cd10ba9e5d9d6e707d07f5.zip
media-gfx/gnome-screenshot: Fix X11 HiDPI support
Signed-off-by: Matthew S. Turnbull <sparky@bluefang-logic.com> Signed-off-by: Matt Turner <mattst88@gentoo.org>
-rw-r--r--media-gfx/gnome-screenshot/files/gnome-screenshot-40.0-fix-hidpi.patch40
-rw-r--r--media-gfx/gnome-screenshot/gnome-screenshot-40.0-r1.ebuild66
2 files changed, 106 insertions, 0 deletions
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
new file mode 100644
index 00000000000..6b493ae6d26
--- /dev/null
+++ b/media-gfx/gnome-screenshot/files/gnome-screenshot-40.0-fix-hidpi.patch
@@ -0,0 +1,40 @@
+From f29aceacbd99fc905ac6d871351505e8d9aa7264 Mon Sep 17 00:00:00 2001
+From: Alexander Mikhaylenko <alexm@gnome.org>
+Date: Sun, 25 Apr 2021 20:00:58 +0000
+Subject: [PATCH] Revert "backend-x11: Use pixbuf dimensions when masking"
+
+This reverts commit f53d720c7d9199075369f085cf5a39a6b53268bc
+---
+ src/screenshot-backend-x11.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/screenshot-backend-x11.c b/src/screenshot-backend-x11.c
+index 990e715..bf32de8 100644
+--- a/src/screenshot-backend-x11.c
++++ b/src/screenshot-backend-x11.c
+@@ -206,18 +206,20 @@ mask_monitors (GdkPixbuf *pixbuf,
+ GdkWindow *root_window)
+ {
+ GdkDisplay *display;
++ GdkScreen *screen;
+ cairo_region_t *region_with_monitors;
+ cairo_region_t *invisible_region;
+ cairo_rectangle_int_t rect;
+
+ display = gdk_window_get_display (root_window);
++ screen = gdk_display_get_default_screen (display);
+
+ region_with_monitors = make_region_with_monitors (display);
+
+ rect.x = 0;
+ rect.y = 0;
+- rect.width = gdk_pixbuf_get_width (pixbuf);
+- rect.height = gdk_pixbuf_get_height (pixbuf);
++ rect.width = gdk_screen_get_width (screen);
++ rect.height = gdk_screen_get_height (screen);
+
+ invisible_region = cairo_region_create_rectangle (&rect);
+ cairo_region_subtract (invisible_region, region_with_monitors);
+--
+GitLab
+
diff --git a/media-gfx/gnome-screenshot/gnome-screenshot-40.0-r1.ebuild b/media-gfx/gnome-screenshot/gnome-screenshot-40.0-r1.ebuild
new file mode 100644
index 00000000000..530e596f46d
--- /dev/null
+++ b/media-gfx/gnome-screenshot/gnome-screenshot-40.0-r1.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit gnome.org gnome2-utils meson readme.gentoo-r1 xdg
+
+DESCRIPTION="Screenshot utility for GNOME"
+HOMEPAGE="https://gitlab.gnome.org/GNOME/gnome-screenshot"
+
+LICENSE="GPL-2+"
+SLOT="0"
+IUSE="X"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+DEPEND="
+ X? (
+ x11-libs/libX11
+ x11-libs/libXext
+ )
+ >=dev-libs/glib-2.35.1:2[dbus]
+ >=x11-libs/gtk+-3.12.0:3
+ >=gui-libs/libhandy-1:1=
+"
+RDEPEND="${DEPEND}
+ >=gnome-base/gsettings-desktop-schemas-0.1.0
+"
+BDEPEND="
+ dev-libs/appstream-glib
+ dev-libs/libxml2:2
+ >=sys-devel/gettext-0.19.8
+ virtual/pkgconfig
+ x11-base/xorg-proto
+"
+
+PATCHES=(
+ # Fix HiDPI handling in X11 fallback
+ # https://gitlab.gnome.org/GNOME/gnome-screenshot/-/issues/128
+ "${FILESDIR}"/${PN}-40.0-fix-hidpi.patch
+)
+
+DOC_CONTENTS="${P} saves screenshots in ~/Pictures/ and defaults to
+ non-interactive mode when launched from a terminal. If you want to choose
+ where to save the screenshot, run 'gnome-screenshot --interactive'"
+
+src_configure() {
+ local emesonargs=(
+ $(meson_feature X x11)
+ )
+ meson_src_configure
+}
+
+src_install() {
+ meson_src_install
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ xdg_pkg_postinst
+ gnome2_schemas_update
+ readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+ xdg_pkg_postrm
+ gnome2_schemas_update
+}