public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: raveit65 <raveit65.sun@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/mate-utils] f44: update to 1.28.1
Date: Tue, 09 Jun 2026 19:57:32 GMT [thread overview]
Message-ID: <178103505290.1.15028106434538522553.rpms-mate-utils-cc326662d1df@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/mate-utils
Branch : f44
Commit : cc326662d1df8e45d72a2cd80d2be70b6185d5b3
Author : raveit65 <raveit65.sun@gmail.com>
Date : 2026-06-09T21:39:07+02:00
Stats : +125/-371 in 6 file(s)
URL : https://src.fedoraproject.org/rpms/mate-utils/c/cc326662d1df8e45d72a2cd80d2be70b6185d5b3?branch=f44
Log:
update to 1.28.1
- Fix window screenshot including invisible borders
---
diff --git a/.gitignore b/.gitignore
index 33d1420..f256011 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,3 +37,4 @@
/mate-utils-1.26.0.tar.xz
/mate-utils-1.26.1.tar.xz
/mate-utils-1.28.0.tar.xz
+/mate-utils-1.28.1.tar.xz
diff --git a/mate-utils.spec b/mate-utils.spec
index a7cb769..9d6d142 100644
--- a/mate-utils.spec
+++ b/mate-utils.spec
@@ -1,7 +1,7 @@
%global branch 1.28
Name: mate-utils
-Version: %{branch}.0
+Version: %{branch}.1
Release: %autorelease
Summary: MATE utility programs
# Automatically converted from old format: GPLv2+ and LGPLv2+ - review is highly recommended.
@@ -9,8 +9,7 @@ License: GPL-2.0-or-later AND LicenseRef-Callaway-LGPLv2+
URL: http://mate-desktop.org
Source0: http://pub.mate-desktop.org/releases/%{branch}/%{name}-%{version}.tar.xz
-Patch1: mate-utils_0001-mate-screenshot-Toggle-shutter-sound.patch
-Patch2: mate-utils_0002-mate-screenshot-Replace-fork-save-with-sync-save.patch
+Patch1: mate-utils_Fix_window_screenshot_including_invisible_borders.patch
BuildRequires: desktop-file-utils
BuildRequires: e2fsprogs-devel
@@ -29,10 +28,7 @@ BuildRequires: mesa-libGL-devel
BuildRequires: popt-devel
BuildRequires: usermode
BuildRequires: yelp-tools
-
-%if 0%{?fedora} && 0%{?fedora} >= 29
BuildRequires: gcc-c++
-%endif
Requires: mate-dictionary = %{version}-%{release}
Requires: mate-screenshot = %{version}-%{release}
diff --git a/mate-utils_0001-mate-screenshot-Toggle-shutter-sound.patch b/mate-utils_0001-mate-screenshot-Toggle-shutter-sound.patch
deleted file mode 100644
index 62eae19..0000000
--- a/mate-utils_0001-mate-screenshot-Toggle-shutter-sound.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From f760c0fed9a093412dcff4801c3b6ede8b9c0458 Mon Sep 17 00:00:00 2001
-From: Victor Kareh <vkareh@redhat.com>
-Date: Wed, 20 Aug 2025 00:18:30 -0400
-Subject: [PATCH 1/2] mate-screenshot: Toggle shutter sound
-
-This setting allows user to enable/disable the shutter sound when taking
-a screenshot. Default is enabled to maintain current behavior.
-
-Fixes #134
----
- mate-screenshot/data/org.mate.screenshot.gschema.xml.in | 5 +++++
- mate-screenshot/src/mate-screenshot.c | 4 +++-
- 2 files changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/mate-screenshot/data/org.mate.screenshot.gschema.xml.in b/mate-screenshot/data/org.mate.screenshot.gschema.xml.in
-index caaff341..1af576bf 100644
---- a/mate-screenshot/data/org.mate.screenshot.gschema.xml.in
-+++ b/mate-screenshot/data/org.mate.screenshot.gschema.xml.in
-@@ -25,5 +25,10 @@
- <summary>Border Effect</summary>
- <description>Effect to add to the outside of a border. Possible values are "shadow", "none", and "border".</description>
- </key>
-+ <key name="enable-sound" type="b">
-+ <default>true</default>
-+ <summary>Enable sound</summary>
-+ <description>Whether to play a sound when taking a screenshot</description>
-+ </key>
- </schema>
- </schemalist>
-diff --git a/mate-screenshot/src/mate-screenshot.c b/mate-screenshot/src/mate-screenshot.c
-index 9786c994..b652f79a 100644
---- a/mate-screenshot/src/mate-screenshot.c
-+++ b/mate-screenshot/src/mate-screenshot.c
-@@ -55,6 +55,7 @@
- #define LAST_SAVE_DIRECTORY_KEY "last-save-directory"
- #define BORDER_EFFECT_KEY "border-effect"
- #define DELAY_KEY "delay"
-+#define ENABLE_SOUND_KEY "enable-sound"
- #define CAJA_PREFERENCES_SCHEMA "org.mate.caja.preferences"
-
- enum
-@@ -852,7 +853,8 @@ finish_prepare_screenshot (char *initial_uri, GdkWindow *window, GdkRectangle *r
- exit (1);
- }
-
-- play_sound_effect (window);
-+ if (g_settings_get_boolean (settings, ENABLE_SOUND_KEY))
-+ play_sound_effect (window);
-
- if (noninteractive_clipboard_arg) {
- save_screenshot_in_clipboard (gdk_window_get_display (window), screenshot);
---
-2.50.1
-
diff --git a/mate-utils_0002-mate-screenshot-Replace-fork-save-with-sync-save.patch b/mate-utils_0002-mate-screenshot-Replace-fork-save-with-sync-save.patch
deleted file mode 100644
index ec4d881..0000000
--- a/mate-utils_0002-mate-screenshot-Replace-fork-save-with-sync-save.patch
+++ /dev/null
@@ -1,310 +0,0 @@
-From 4aeaa30cfbcb6f9b3bf494165bb33239edbb9851 Mon Sep 17 00:00:00 2001
-From: Victor Kareh <vkareh@redhat.com>
-Date: Mon, 25 Aug 2025 15:14:46 -0400
-Subject: [PATCH 2/2] mate-screenshot: Replace fork save with sync save
-
-Newer versions of gdk-pixbuf use libglycin's asynchronous image save
-mechanism. This makes the fork-save redundant and has a potential of
-hanging when saving a screenshot.
----
- mate-screenshot/src/screenshot-save.c | 227 +++++---------------------
- 1 file changed, 44 insertions(+), 183 deletions(-)
-
-diff --git a/mate-screenshot/src/screenshot-save.c b/mate-screenshot/src/screenshot-save.c
-index 1acf898f..dd9c032c 100644
---- a/mate-screenshot/src/screenshot-save.c
-+++ b/mate-screenshot/src/screenshot-save.c
-@@ -24,7 +24,6 @@
- #include <stdlib.h>
- #include <unistd.h>
- #include <errno.h>
--#include <signal.h>
- #include <string.h>
- #include <glib/gi18n.h>
-
-@@ -33,150 +32,53 @@
- static char *parent_dir = NULL;
- static char *tmp_filename = NULL;
-
--static SaveFunction save_callback = NULL;
--static gpointer save_user_data = NULL;
--
--/* Strategy for saving:
-- *
-- * We keep another process around to handle saving the image. This is
-- * done for two reasons. One, the saving takes a non-zero amount of
-- * time (about a quarter of a second on my box.) This will make it
-- * more interactive. The second reason is to make the child
-- * responsible for cleaning up the temp dir. If the parent process is
-- * killed or segfaults, the child process can clean up the temp dir.
-- */
- static void
--clean_up_temporary_dir (gboolean gui_on_error)
-+clean_up_temporary_dir (void)
- {
- char *message;
- gboolean error_occurred = FALSE;
-- if (g_file_test (tmp_filename, G_FILE_TEST_EXISTS))
-+ if (tmp_filename && g_file_test (tmp_filename, G_FILE_TEST_EXISTS))
- error_occurred = unlink (tmp_filename);
-- if (g_file_test (parent_dir, G_FILE_TEST_EXISTS))
-+ if (parent_dir && g_file_test (parent_dir, G_FILE_TEST_EXISTS))
- error_occurred = rmdir (parent_dir) || error_occurred;
-
- if (error_occurred)
- {
- message = g_strdup_printf (_("Unable to clear the temporary folder:\n%s"),
- tmp_filename);
-- if (gui_on_error)
-- {
-- GtkWidget *dialog;
--
-- dialog = gtk_message_dialog_new (NULL, 0,
-- GTK_MESSAGE_ERROR,
-- GTK_BUTTONS_OK,
-- "%s", message);
-- gtk_dialog_run (GTK_DIALOG (dialog));
-- gtk_widget_destroy (dialog);
-- }
-- else
-- {
-- g_warning ("%s", message);
-- }
-+ g_warning ("%s", message);
- g_free (message);
- }
- g_free (tmp_filename);
- g_free (parent_dir);
--}
--
--static void
--child_done_notification (GPid pid,
-- gint status,
-- gpointer data)
--{
-- /* This should never be called. */
--
-- /* We expect the child to die after the parent. If the child dies
-- * than it either segfaulted, or was randomly killed. In either
-- * case, we can't reasonably continue. */
-- GtkWidget *dialog;
--
-- dialog = gtk_message_dialog_new (NULL, 0,
-- GTK_MESSAGE_ERROR,
-- GTK_BUTTONS_OK,
-- _("The child save process unexpectedly exited. We are unable to write the screenshot to disk."));
-- gtk_dialog_run (GTK_DIALOG (dialog));
-- gtk_widget_destroy (dialog);
--
-- clean_up_temporary_dir (TRUE);
--
-- exit (1);
--}
--
--static gboolean
--read_pipe_from_child (GIOChannel *source,
-- GIOCondition condition,
-- gpointer data)
--{
-- if (condition & G_IO_IN)
-- {
-- gchar *message = NULL;
-- gchar *error_message = NULL;
-- GtkWidget *dialog;
-- GIOStatus status;
--
-- status = g_io_channel_read_line (source, &error_message, NULL, NULL, NULL);
--
-- if (status == G_IO_STATUS_NORMAL)
-- {
-- message = g_strdup_printf ("Unable to save the screenshot to disk:\n\n%s", error_message);
-- dialog = gtk_message_dialog_new (NULL, 0,
-- GTK_MESSAGE_ERROR,
-- GTK_BUTTONS_OK,
-- "%s", message);
-- gtk_dialog_run (GTK_DIALOG (dialog));
-- gtk_widget_destroy (dialog);
-- exit (1);
-- }
-- }
--
-- (*save_callback) (save_user_data);
--
-- return FALSE;
-+ tmp_filename = NULL;
-+ parent_dir = NULL;
- }
-
- static char *
- make_temp_directory (void)
- {
-- gint result, i;
- gchar *dir_name;
-
-- i = 0;
-- do
-- {
-- gchar *tmp_dir = g_strdup_printf ("mate-screenshot.%u.%d",
-- (unsigned int) getpid (),
-- i++);
--
-- dir_name = g_build_filename (g_get_tmp_dir (),
-- tmp_dir,
-- NULL);
-- g_free (tmp_dir);
--
-- result = g_mkdir_with_parents (dir_name, 0777);
-- if (result < 0)
-- {
-- g_free (dir_name);
-+ // mkdtemp uses XXXXXX as a template to create a unique name for the temp dir
-+ dir_name = g_build_filename (g_get_tmp_dir (),
-+ "mate-screenshot.XXXXXX",
-+ NULL);
-
-- if (errno != EEXIST)
-- return NULL;
-- else
-- continue;
-- }
-- else
-- return dir_name;
-+ if (mkdtemp (dir_name) == NULL)
-+ {
-+ g_warning ("Failed to create temporary directory: %s", g_strerror (errno));
-+ g_free (dir_name);
-+ return NULL;
- }
-- while (TRUE);
-+
-+ return dir_name;
- }
-
- static void
--signal_handler (int sig)
-+cleanup_handler (void)
- {
-- clean_up_temporary_dir (FALSE);
--
-- signal (sig, SIG_DFL);
-- kill (getpid (), sig);
-+ clean_up_temporary_dir ();
- }
-
- void
-@@ -184,87 +86,46 @@ screenshot_save_start (GdkPixbuf *pixbuf,
- SaveFunction callback,
- gpointer user_data)
- {
-- GPid pid;
-- int parent_exit_notification[2];
-- int pipe_from_child[2];
-+ GError *error = NULL;
-
-- if (pipe (parent_exit_notification) == -1)
-- perror("pipe error");
-+ static gboolean cleanup_registered = FALSE;
-+ if (!cleanup_registered)
-+ {
-+ atexit (cleanup_handler);
-+ cleanup_registered = TRUE;
-+ }
-
-- if (pipe (pipe_from_child) == -1)
-- perror("pipe error");
-+ clean_up_temporary_dir ();
-
- parent_dir = make_temp_directory ();
- if (parent_dir == NULL)
-- return;
-+ {
-+ if (callback)
-+ callback (user_data);
-+ return;
-+ }
-
- tmp_filename = g_build_filename (parent_dir,
- _("Screenshot.png"),
- NULL);
-- save_callback = callback;
-- save_user_data = user_data;
-
-- pid = fork ();
-- if (pid == 0)
-+ if (! gdk_pixbuf_save (pixbuf, tmp_filename,
-+ "png", &error,
-+ "tEXt::Software", "mate-screenshot",
-+ NULL))
- {
-- GError *error = NULL;
-- char c;
--
-- signal (SIGINT, signal_handler);
-- signal (SIGTERM, signal_handler);
--
-- close (parent_exit_notification [1]);
-- close (pipe_from_child [0]);
--
-- if (! gdk_pixbuf_save (pixbuf, tmp_filename,
-- "png", &error,
-- "tEXt::Software", "mate-screenshot",
-- NULL))
-- {
-- if (error && error->message)
-- {
-- if (write (pipe_from_child[1], error->message, strlen (error->message)) == -1)
-- perror("write error");
-- }
-- else
-- {
--#define ERROR_MESSAGE _("Unknown error saving screenshot to disk")
-- if (write (pipe_from_child[1], ERROR_MESSAGE, strlen (ERROR_MESSAGE)) == -1)
-- perror("write error");
-- }
-- }
-- /* By closing the pipe, we let the main process know that we're
-- * done saving it. */
-- close (pipe_from_child[1]);
-+ if (error && error->message)
-+ g_warning ("Failed to save screenshot: %s", error->message);
-+ else
-+ g_warning ("Failed to save screenshot: Unknown error");
-
-- if (read (parent_exit_notification[0], &c, 1) == -1)
-- perror("read error");
-+ g_error_free (error);
-
-- clean_up_temporary_dir (FALSE);
-- _exit (0);
-+ clean_up_temporary_dir ();
- }
-- else if (pid > 0)
-- {
-- GIOChannel *channel;
-
-- close (parent_exit_notification[0]);
-- close (pipe_from_child[1]);
--
-- channel = g_io_channel_unix_new (pipe_from_child[0]);
-- g_io_add_watch (channel,
-- G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
-- read_pipe_from_child,
-- NULL);
-- g_io_channel_unref (channel);
-- g_child_watch_add (pid, child_done_notification, NULL);
-- }
-- else
-- /* George awesomely wrote code originally to handle the
-- * could-not-fork case synchronously. I'm not copying it, as I'm
-- * guessing that the system is pretty hosed if that's the case.
-- * However, he gets major kudos for trying. (-:
-- */
-- g_assert_not_reached ();
-+ if (callback)
-+ callback (user_data);
- }
-
- const char *
---
-2.50.1
-
diff --git a/mate-utils_Fix_window_screenshot_including_invisible_borders.patch b/mate-utils_Fix_window_screenshot_including_invisible_borders.patch
new file mode 100644
index 0000000..0742496
--- /dev/null
+++ b/mate-utils_Fix_window_screenshot_including_invisible_borders.patch
@@ -0,0 +1,121 @@
+From ebfb1e7dbe128829a244dd3fcbbaf188f58b31b6 Mon Sep 17 00:00:00 2001
+From: Victor Kareh <vkareh@redhat.com>
+Date: Wed, 20 May 2026 21:41:47 -0400
+Subject: [PATCH] Fix window screenshot including invisible borders
+
+When marco resize borders are enabled, window screenshots had the entire
+frame window and included the invisible resize borders, causing
+artifacts around the window and leaking whatever was behind it.
+
+This reads the frame extents and compares with the client window
+position to determine the offset of the invisible borders and so we can
+adjust the dimensions to remove it.
+
+Fixes #236
+---
+ mate-screenshot/src/screenshot-utils.c | 66 +++++++++++++++++++++++++-
+ 1 file changed, 64 insertions(+), 2 deletions(-)
+
+diff --git a/mate-screenshot/src/screenshot-utils.c b/mate-screenshot/src/screenshot-utils.c
+index 6ee457c90..527c68c09 100644
+--- a/mate-screenshot/src/screenshot-utils.c
++++ b/mate-screenshot/src/screenshot-utils.c
+@@ -608,14 +608,18 @@ screenshot_get_pixbuf (GdkWindow *window,
+ gint x_real_orig, y_real_orig, x_orig, y_orig;
+ gint width, real_width, height, real_height;
+ gint screen_width, screen_height, scale;
++ gint invis_x = 0, invis_y = 0;
+
+ /* If the screenshot should include the border, we look for the WM window. */
+
++ Window client_xid = None;
++
+ if (include_border)
+ {
+ Window xid, wm;
+
+ xid = GDK_WINDOW_XID (window);
++ client_xid = xid;
+ wm = find_wm_window (xid);
+
+ if (wm != None)
+@@ -640,6 +644,47 @@ screenshot_get_pixbuf (GdkWindow *window,
+ width = real_width;
+ height = real_height;
+
++ if (include_border && client_xid != None && width > 0 && height > 0)
++ {
++ Display *xdpy = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
++ Atom frame_extents = XInternAtom (xdpy, "_NET_FRAME_EXTENTS", False);
++ Atom type;
++ int fmt;
++ unsigned long nitems, bytes;
++ unsigned char *data = NULL;
++
++ if (XGetWindowProperty (xdpy, client_xid, frame_extents, 0, 4, False,
++ XA_CARDINAL, &type, &fmt, &nitems, &bytes,
++ &data) == Success && data && nitems >= 4)
++ {
++ unsigned long *ext = (unsigned long *) data;
++ XWindowAttributes wa;
++
++ if (XGetWindowAttributes (xdpy, client_xid, &wa))
++ {
++ int vis_w = (int)(wa.width + ext[0] + ext[1]) / scale;
++ int vis_h = (int)(wa.height + ext[2] + ext[3]) / scale;
++ int border_x = (wa.x - (int) ext[0]) / scale;
++ int border_y = (wa.y - (int) ext[2]) / scale;
++
++ if (border_x > 0 && vis_w < real_width)
++ {
++ invis_x = (wa.x - (int) ext[0]);
++ x_orig += border_x;
++ width = vis_w;
++ }
++ if (border_y > 0 && vis_h < real_height)
++ {
++ invis_y = (wa.y - (int) ext[2]);
++ y_orig += border_y;
++ height = vis_h;
++ }
++ }
++ }
++ if (data)
++ XFree (data);
++ }
++
+ if (x_orig < 0)
+ {
+ width = width + x_orig;
+@@ -711,11 +756,28 @@ screenshot_get_pixbuf (GdkWindow *window,
+ gint rec_width, rec_height;
+ gint y;
+
+- rec_x = rectangles[i].x;
+- rec_y = rectangles[i].y;
++ rec_x = rectangles[i].x - invis_x;
++ rec_y = rectangles[i].y - invis_y;
+ rec_width = rectangles[i].width / scale;
+ rec_height = rectangles[i].height / scale;
+
++ if (rec_x < 0)
++ {
++ rec_width += rec_x;
++ rec_x = 0;
++ }
++ if (rec_y < 0)
++ {
++ rec_height += rec_y;
++ rec_y = 0;
++ }
++ if (rec_x + rec_width > width)
++ rec_width = width - rec_x;
++ if (rec_y + rec_height > height)
++ rec_height = height - rec_y;
++ if (rec_width <= 0 || rec_height <= 0)
++ continue;
++
+ if (x_real_orig < 0)
+ {
+ rec_x += x_real_orig;
+
diff --git a/sources b/sources
index 3524c46..14346d4 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (mate-utils-1.28.0.tar.xz) = bf64e0458bc60ebcda219201bb552239503cfddf576ebfba957d4d73ed69766d003fa7af8df9a271a795c6eb2db268a58a97b4251f9528d261edb98a4e94c72a
+SHA512 (mate-utils-1.28.1.tar.xz) = b69bdc452fc41eaa18384fd71771749b2bd5c6a87e451eff7576b6604dffe97fcd5d70c2ee11cdf599fd351b2239a102d933a752905ab470da4a210b8809a5f3
reply other threads:[~2026-06-09 19:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178103505290.1.15028106434538522553.rpms-mate-utils-cc326662d1df@fedoraproject.org \
--to=raveit65.sun@gmail.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox