Commit 7deeede4 authored by Simon McVittie's avatar Simon McVittie
Browse files

d/patches: Update to upstream gtk-2-24 branch, commit 2.24.32-32-geec3ce0b

Closes: #872729
parent 886d6743
gtk+2.0 (2.24.32-3) UNRELEASED; urgency=medium gtk+2.0 (2.24.32-3) UNRELEASED; urgency=medium
[ Hugh McMaster ]
* debian/control.in: * debian/control.in:
- Mark libgtk2.0-dev Multi-Arch: same (Closes: #689097). - Mark libgtk2.0-dev Multi-Arch: same (Closes: #689097).
- Mark gir1.2-gtk-2.0 Multi-Arch: same. - Mark gir1.2-gtk-2.0 Multi-Arch: same.
...@@ -9,6 +10,13 @@ gtk+2.0 (2.24.32-3) UNRELEASED; urgency=medium ...@@ -9,6 +10,13 @@ gtk+2.0 (2.24.32-3) UNRELEASED; urgency=medium
- Add multi-arch support by no longer packaging the deprecated - Add multi-arch support by no longer packaging the deprecated
dh_gtkmodules script (Closes: #875728). dh_gtkmodules script (Closes: #875728).
[ Simon McVittie ]
* d/patches: Update to upstream gtk-2-24 branch, commit
2.24.32-32-geec3ce0b4e
- Includes patch from Chris Lamb to make immodules.cache reproducible
(Closes: #872729)
* d/copyright: Update
-- Hugh McMaster <hugh.mcmaster@outlook.com> Mon, 18 Jun 2018 22:08:24 +1000 -- Hugh McMaster <hugh.mcmaster@outlook.com> Mon, 18 Jun 2018 22:08:24 +1000
gtk+2.0 (2.24.32-2) unstable; urgency=medium gtk+2.0 (2.24.32-2) unstable; urgency=medium
......
...@@ -13,7 +13,7 @@ Applied-upstream: no, bug was closed due to lack of feedback ...@@ -13,7 +13,7 @@ Applied-upstream: no, bug was closed due to lack of feedback
2 files changed, 17 insertions(+), 1 deletion(-) 2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac diff --git a/configure.ac b/configure.ac
index b75f9c6..58d3492 100644 index 44d3056..0294160 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -182,6 +182,7 @@ fi @@ -182,6 +182,7 @@ fi
......
...@@ -15,7 +15,7 @@ Bug: https://bugzilla.gnome.org/show_bug.cgi?id=665326 ...@@ -15,7 +15,7 @@ Bug: https://bugzilla.gnome.org/show_bug.cgi?id=665326
2 files changed, 10 insertions(+), 5 deletions(-) 2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac diff --git a/configure.ac b/configure.ac
index 58d3492..7eb26f1 100644 index 0294160..3eaa305 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -1325,23 +1325,27 @@ LDFLAGS="$saved_ldflags" @@ -1325,23 +1325,27 @@ LDFLAGS="$saved_ldflags"
......
...@@ -17,7 +17,7 @@ Forwarded: no ...@@ -17,7 +17,7 @@ Forwarded: no
create mode 100644 gtk/stock-icons/ximian-icons.h create mode 100644 gtk/stock-icons/ximian-icons.h
diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c
index d18c307..96e708a 100644 index 245bdf1..084bb63 100644
--- a/gtk/gtkfilesel.c --- a/gtk/gtkfilesel.c
+++ b/gtk/gtkfilesel.c +++ b/gtk/gtkfilesel.c
@@ -80,9 +80,13 @@ @@ -80,9 +80,13 @@
......
...@@ -13,7 +13,7 @@ Applied-upstream: 2.99.1, commit:ec15c405cf6354e9267e7e6b7ce878c519bffe4c ...@@ -13,7 +13,7 @@ Applied-upstream: 2.99.1, commit:ec15c405cf6354e9267e7e6b7ce878c519bffe4c
1 file changed, 19 insertions(+), 4 deletions(-) 1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac diff --git a/configure.ac b/configure.ac
index 7eb26f1..560afbf 100644 index 3eaa305..9797b79 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -241,6 +241,18 @@ AC_ARG_ENABLE(xinerama, @@ -241,6 +241,18 @@ AC_ARG_ENABLE(xinerama,
......
...@@ -20,7 +20,7 @@ Applied-upstream: no ...@@ -20,7 +20,7 @@ Applied-upstream: no
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gtk/updateiconcache.c b/gtk/updateiconcache.c diff --git a/gtk/updateiconcache.c b/gtk/updateiconcache.c
index 32c8f41..a65c855 100644 index 39e1345..9fecf12 100644
--- a/gtk/updateiconcache.c --- a/gtk/updateiconcache.c
+++ b/gtk/updateiconcache.c +++ b/gtk/updateiconcache.c
@@ -679,7 +679,7 @@ scan_directory (const gchar *base_path, @@ -679,7 +679,7 @@ scan_directory (const gchar *base_path,
......
From: Eduard Braun <eduard.braun2@gmx.de>
Date: Sat, 13 Jan 2018 23:09:51 +0100
Subject: Consistently use g_stat and GStatBuf
Replace "stat struct" with "GStatBuf" and "stat" with "g_stat" where
appropriate to fix cross-platform issues, specifically on Windows.
Code should be identical on *nix but fixes some serious issues
on Windows:
- Field widths of "struct stat" are not constant on Windows.
If the stat function does not match the stat struct used
it will cause overwrites and undefined behavior
- The Windows stat function needs a properly encoded filename.
In many places we pass an UTF-8 encoded value which breaks as soon
as non-ASCII characters are involved.
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=787772
Origin: upstream, 2.24.33, commit:eec3ce0b4eb25cf290ff649d3d87f7f0b25c02e4
---
demos/pixbuf-init.c | 8 +++-----
gtk/gtkfilesel.c | 30 +++++++++++++++---------------
gtk/gtkiconcache.c | 4 ++--
gtk/gtkicontheme.c | 6 +++---
gtk/gtkrc.c | 4 ++--
gtk/gtkrecentmanager.c | 4 ++--
gtk/tests/pixbuf-init.c | 8 +++-----
gtk/updateiconcache.c | 4 ++--
tests/testfilechooser.c | 10 +++++-----
tests/testgtk.c | 6 +++---
tests/testtext.c | 6 +++---
11 files changed, 43 insertions(+), 47 deletions(-)
diff --git a/demos/pixbuf-init.c b/demos/pixbuf-init.c
index 898de45..20e35e5 100644
--- a/demos/pixbuf-init.c
+++ b/demos/pixbuf-init.c
@@ -1,15 +1,13 @@
#include "config.h"
#include <glib.h>
-
-#include <sys/stat.h>
-#include <stdlib.h>
+#include <glib/gstdio.h>
static gboolean
file_exists (const char *filename)
{
- struct stat statbuf;
+ GStatBuf statbuf;
- return stat (filename, &statbuf) == 0;
+ return g_stat (filename, &statbuf) == 0;
}
void
diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c
index d18c307..245bdf1 100644
--- a/gtk/gtkfilesel.c
+++ b/gtk/gtkfilesel.c
@@ -325,7 +325,7 @@ static CompletionDir* open_ref_dir (gchar* text_to_complete,
CompletionState* cmpl_state);
#ifndef G_PLATFORM_WIN32
static gboolean check_dir (gchar *dir_name,
- struct stat *result,
+ GStatBuf *result,
gboolean *stat_subdirs);
#endif
static CompletionDir* open_dir (gchar* dir_name,
@@ -337,11 +337,11 @@ static CompletionDir* open_user_dir (const gchar* text_to_complete,
static CompletionDir* open_relative_dir (gchar* dir_name, CompletionDir* dir,
CompletionState *cmpl_state);
static CompletionDirSent* open_new_dir (gchar* dir_name,
- struct stat* sbuf,
+ GStatBuf *sbuf,
gboolean stat_subdirs);
static gint correct_dir_fullname (CompletionDir* cmpl_dir);
static gint correct_parent (CompletionDir* cmpl_dir,
- struct stat *sbuf);
+ GStatBuf *sbuf);
#ifndef G_PLATFORM_WIN32
static gchar* find_parent_dir_fullname (gchar* dirname);
#endif
@@ -2984,9 +2984,9 @@ open_relative_dir (gchar *dir_name,
/* after the cache lookup fails, really open a new directory */
static CompletionDirSent*
-open_new_dir (gchar *dir_name,
- struct stat *sbuf,
- gboolean stat_subdirs)
+open_new_dir (gchar *dir_name,
+ GStatBuf *sbuf,
+ gboolean stat_subdirs)
{
CompletionDirSent *sent;
GDir *directory;
@@ -2995,7 +2995,7 @@ open_new_dir (gchar *dir_name,
gint entry_count = 0;
gint n_entries = 0;
gint i;
- struct stat ent_sbuf;
+ GStatBuf ent_sbuf;
GString *path;
gchar *sys_dir_name;
@@ -3101,9 +3101,9 @@ open_new_dir (gchar *dir_name,
#ifndef G_PLATFORM_WIN32
static gboolean
-check_dir (gchar *dir_name,
- struct stat *result,
- gboolean *stat_subdirs)
+check_dir (gchar *dir_name,
+ GStatBuf *result,
+ gboolean *stat_subdirs)
{
/* A list of directories that we know only contain other directories.
* Trying to stat every file in these directories would be very
@@ -3113,7 +3113,7 @@ check_dir (gchar *dir_name,
static struct {
const gchar name[5];
gboolean present;
- struct stat statbuf;
+ GStatBuf statbuf;
} no_stat_dirs[] = {
{ "/afs", FALSE, { 0 } },
{ "/net", FALSE, { 0 } }
@@ -3172,7 +3172,7 @@ open_dir (gchar *dir_name,
CompletionState *cmpl_state)
{
#ifndef G_PLATFORM_WIN32
- struct stat sbuf;
+ GStatBuf sbuf;
gboolean stat_subdirs;
GList* cdsl;
#endif
@@ -3238,7 +3238,7 @@ correct_dir_fullname (CompletionDir* cmpl_dir)
gint length = strlen (cmpl_dir->fullname);
gchar *first_slash = strchr (cmpl_dir->fullname, G_DIR_SEPARATOR);
gchar *sys_filename;
- struct stat sbuf;
+ GStatBuf sbuf;
/* Does it end with /. (\.) ? */
if (length >= 2 &&
@@ -3338,9 +3338,9 @@ correct_dir_fullname (CompletionDir* cmpl_dir)
static gint
correct_parent (CompletionDir *cmpl_dir,
- struct stat *sbuf)
+ GStatBuf *sbuf)
{
- struct stat parbuf;
+ GStatBuf parbuf;
gchar *last_slash;
gchar *first_slash;
#ifndef G_PLATFORM_WIN32
diff --git a/gtk/gtkiconcache.c b/gtk/gtkiconcache.c
index 576dd94..143f8f1 100644
--- a/gtk/gtkiconcache.c
+++ b/gtk/gtkiconcache.c
@@ -92,8 +92,8 @@ _gtk_icon_cache_new_for_path (const gchar *path)
gchar *cache_filename;
gint fd = -1;
- struct stat st;
- struct stat path_st;
+ GStatBuf st;
+ GStatBuf path_st;
CacheInfo info;
/* Check if we have a cache file */
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index 470158c..60661c8 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -902,7 +902,7 @@ insert_theme (GtkIconTheme *icon_theme, const char *theme_name)
GKeyFile *theme_file;
GError *error = NULL;
IconThemeDirMtime *dir_mtime;
- struct stat stat_buf;
+ GStatBuf stat_buf;
priv = icon_theme->priv;
@@ -1052,7 +1052,7 @@ load_themes (GtkIconTheme *icon_theme)
IconSuffix old_suffix, new_suffix;
GTimeVal tv;
IconThemeDirMtime *dir_mtime;
- struct stat stat_buf;
+ GStatBuf stat_buf;
priv = icon_theme->priv;
@@ -1898,7 +1898,7 @@ rescan_themes (GtkIconTheme *icon_theme)
IconThemeDirMtime *dir_mtime;
GList *d;
int stat_res;
- struct stat stat_buf;
+ GStatBuf stat_buf;
GTimeVal tv;
priv = icon_theme->priv;
diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c
index 50b2563..952010e 100644
--- a/gtk/gtkrc.c
+++ b/gtk/gtkrc.c
@@ -983,7 +983,7 @@ gtk_rc_context_parse_one_file (GtkRcContext *context,
gboolean reload)
{
GtkRcFile *rc_file;
- struct stat statbuf;
+ GStatBuf statbuf;
gint saved_priority;
g_return_if_fail (filename != NULL);
@@ -1764,7 +1764,7 @@ gtk_rc_reparse_all_for_settings (GtkSettings *settings,
GtkRcFile *rc_file;
GSList *tmp_list;
GtkRcContext *context;
- struct stat statbuf;
+ GStatBuf statbuf;
g_return_val_if_fail (GTK_IS_SETTINGS (settings), FALSE);
diff --git a/gtk/gtkrecentmanager.c b/gtk/gtkrecentmanager.c
index 609ee1f..1f67c13 100644
--- a/gtk/gtkrecentmanager.c
+++ b/gtk/gtkrecentmanager.c
@@ -2221,7 +2221,7 @@ gboolean
gtk_recent_info_exists (GtkRecentInfo *info)
{
gchar *filename;
- struct stat stat_buf;
+ GStatBuf stat_buf;
gboolean retval = FALSE;
g_return_val_if_fail (info != NULL, FALSE);
@@ -2233,7 +2233,7 @@ gtk_recent_info_exists (GtkRecentInfo *info)
filename = g_filename_from_uri (info->uri, NULL, NULL);
if (filename)
{
- if (stat (filename, &stat_buf) == 0)
+ if (g_stat (filename, &stat_buf) == 0)
retval = TRUE;
g_free (filename);
diff --git a/gtk/tests/pixbuf-init.c b/gtk/tests/pixbuf-init.c
index 47573ab..5184a38 100644
--- a/gtk/tests/pixbuf-init.c
+++ b/gtk/tests/pixbuf-init.c
@@ -1,15 +1,13 @@
#include "config.h"
#include <glib.h>
-
-#include <sys/stat.h>
-#include <stdlib.h>
+#include <glib/gstdio.h>
static gboolean
file_exists (const char *filename)
{
- struct stat statbuf;
+ GStatBuf statbuf;
- return stat (filename, &statbuf) == 0;
+ return g_stat (filename, &statbuf) == 0;
}
void
diff --git a/gtk/updateiconcache.c b/gtk/updateiconcache.c
index 32c8f41..39e1345 100644
--- a/gtk/updateiconcache.c
+++ b/gtk/updateiconcache.c
@@ -119,7 +119,7 @@ static int check_dir_mtime (const char *dir,
gboolean
is_cache_up_to_date (const gchar *path)
{
- struct stat path_stat, cache_stat;
+ GStatBuf path_stat, cache_stat;
gchar *cache_path;
int retval;
@@ -1478,7 +1478,7 @@ build_cache (const gchar *path)
#endif
GHashTable *files;
FILE *cache;
- struct stat path_stat, cache_stat;
+ GStatBuf path_stat, cache_stat;
struct utimbuf utime_buf;
GList *directories = NULL;
int fd;
diff --git a/tests/testfilechooser.c b/tests/testfilechooser.c
index 443f5c3..86cb14d 100644
--- a/tests/testfilechooser.c
+++ b/tests/testfilechooser.c
@@ -21,13 +21,13 @@
#include <string.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <stdlib.h>
#include <time.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <gtk/gtk.h>
+#include <glib/gstdio.h>
#ifdef G_OS_WIN32
# include <io.h>
@@ -189,7 +189,7 @@ my_new_from_file_at_size (const char *filename,
GdkPixbufLoader *loader;
GdkPixbuf *pixbuf;
int info[2];
- struct stat st;
+ GStatBuf st;
guchar buffer [4096];
int length;
@@ -198,7 +198,7 @@ my_new_from_file_at_size (const char *filename,
g_return_val_if_fail (filename != NULL, NULL);
g_return_val_if_fail (width > 0 && height > 0, NULL);
- if (stat (filename, &st) != 0) {
+ if (g_stat (filename, &st) != 0) {
int errsv = errno;
g_set_error (error,
@@ -298,8 +298,8 @@ update_preview_cb (GtkFileChooser *chooser)
}
else
{
- struct stat buf;
- if (stat (filename, &buf) == 0)
+ GStatBuf buf;
+ if (g_stat (filename, &buf) == 0)
{
gchar *preview_text;
gchar *size_str;
diff --git a/tests/testgtk.c b/tests/testgtk.c
index ec2c57c..b7ea442 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -35,7 +35,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/stat.h>
#include <math.h>
#include <time.h>
#ifdef HAVE_UNISTD_H
@@ -46,6 +45,7 @@
#include "gtk/gtk.h"
#include "gdk/gdk.h"
#include "gdk/gdkkeysyms.h"
+#include "glib/gstdio.h"
#ifdef G_OS_WIN32
#define sleep(n) _sleep(n)
@@ -59,9 +59,9 @@
gboolean
file_exists (const char *filename)
{
- struct stat statbuf;
+ GStatBuf statbuf;
- return stat (filename, &statbuf) == 0;
+ return g_stat (filename, &statbuf) == 0;
}
GtkWidget *
diff --git a/tests/testtext.c b/tests/testtext.c
index 880eaa7..b9678bf 100644
--- a/tests/testtext.c
+++ b/tests/testtext.c
@@ -20,7 +20,6 @@
#include "config.h"
#include <stdio.h>
-#include <sys/stat.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
@@ -30,6 +29,7 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
+#include <glib/gstdio.h>
#include "prop-editor.h"
@@ -2096,9 +2096,9 @@ save_as_ok_func (const char *filename, gpointer data)
if (!buffer->filename || strcmp (filename, buffer->filename) != 0)
{
- struct stat statbuf;
+ GStatBuf statbuf;
- if (stat (filename, &statbuf) == 0)
+ if (g_stat (filename, &statbuf) == 0)
{
gchar *err = g_strdup_printf ("Ovewrite existing file '%s'?", filename);
gint result = msgbox_run (NULL, err, "Yes", "No", NULL, 1);
From: Daniel Boles <dboles.src@gmail.com>
Date: Fri, 22 Jun 2018 15:10:56 +0100
Subject: FileChooserDefault: Avoid printf()ing a NULL char*
If the name of the bookmark is NULL, using it with the printf %s format
specifier is undefined behaviour per the C Standard. Besides, it would
result in a completely unhelpful tooltip even if it were well-defined.
We already have an else case for when nothing is selected, which avoids
trying to use the name, so ensure we go there if it's NULL or empty too.
Bug: https://gitlab.gnome.org/GNOME/gtk/issues/1169
Origin: upstream, 2.24.33, commit:168434c4a1ba90609b6f58d0098436c6be7be75b
---
gtk/gtkfilechooserdefault.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index fb982a3..c113542 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -2810,8 +2810,8 @@ bookmarks_check_remove_sensitivity (GtkFileChooserDefault *impl)
{
GtkTreeIter iter;
gboolean removable = FALSE;
+ gboolean have_name = FALSE;
gchar *name = NULL;
- gchar *tip;
if (shortcuts_get_selected (impl, &iter))
{
@@ -2821,6 +2821,13 @@ bookmarks_check_remove_sensitivity (GtkFileChooserDefault *impl)
-1);
gtk_widget_set_sensitive (impl->browse_shortcuts_remove_button, removable);
+ have_name = name != NULL && name[0] != '\0';
+ }
+
+ if (have_name)
+ {
+ char *tip;
+
if (removable)
tip = g_strdup_printf (_("Remove the bookmark '%s'"), name);
else
From: John Lindgren <john@jlindgren.net>
Date: Tue, 15 May 2018 21:47:12 -0400
Subject: Fix compiler warnings with GCC 8.1.
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
GCC 8.1 added some new warnings, including warning about parentheses
with no effect in variable declarations. GTK2 headers have a few of
these, which produce a lot of warnings in projects using GTK2.
The warnings look like:
/usr/include/gtk-2.0/gtk/gtkfilechooserbutton.h:59:8: warning:
unnecessary parentheses in declaration of ‘__gtk_reserved1’ [-Wparentheses]
void (*__gtk_reserved1);
^
Removing the parentheses is harmless and fixes the warnings.
Origin: upstream, 2.24.33, commit:889a63dffc72c048502d0f7d2b26bfc8532462eb
---
gtk/gtkfilechooserbutton.h | 14 +++++++-------
gtk/gtkstatusicon.h | 4 ++--
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/gtk/gtkfilechooserbutton.h b/gtk/gtkfilechooserbutton.h
index b3d9112..fdacc4b 100644
--- a/gtk/gtkfilechooserbutton.h
+++ b/gtk/gtkfilechooserbutton.h
@@ -56,13 +56,13 @@ struct _GtkFileChooserButtonClass
void (* file_set) (GtkFileChooserButton *fc);
- void (*__gtk_reserved1);
- void (*__gtk_reserved2);
- void (*__gtk_reserved3);
- void (*__gtk_reserved4);
- void (*__gtk_reserved5);
- void (*__gtk_reserved6);
- void (*__gtk_reserved7);
+ void *__gtk_reserved1;
+ void *__gtk_reserved2;
+ void *__gtk_reserved3;
+ void *__gtk_reserved4;
+ void *__gtk_reserved5;
+ void *__gtk_reserved6;
+ void *__gtk_reserved7;
};
diff --git a/gtk/gtkstatusicon.h b/gtk/gtkstatusicon.h
index 19dbd1c..c45caca 100644
--- a/gtk/gtkstatusicon.h
+++ b/gtk/gtkstatusicon.h
@@ -73,8 +73,8 @@ struct _GtkStatusIconClass
gboolean keyboard_mode,
GtkTooltip *tooltip);
- void (*__gtk_reserved1);
- void (*__gtk_reserved2);
+ void *__gtk_reserved1;
+ void *__gtk_reserved2;
};
GType gtk_status_icon_get_type (void) G_GNUC_CONST;
From: John Lindgren <john@jlindgren.net>
Date: Sat, 17 Feb 2018 22:03:27 -0500
Subject: Fix incorrect optimization in find_builtin_icon().
When we found an icon with exactly the requested size, we'd stop
searching immediately (good), but we'd neglect to set the returned
min_difference to 0 (bad). This caused theme_lookup_icon() to
prefer other, potentially much worse, matches over the exact one.
Cherry-picked from 5aa939dc (gtk-3-22)
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=792738
Origin: upstream, 2.24.33, commit:9ce6f8086e3b264f30add5bd5bfab005c359ac66
---
gtk/gtkicontheme.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index 532d94b..470158c 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -3396,6 +3396,7 @@ find_builtin_icon (const gchar *icon_name,
if (difference == 0)
{
+ min_difference = 0;
min_icon = default_icon;
break;
}
From: Jeremy Tan <jtanx@outlook.com>
Date: Sat, 17 Sep 2016 17:19:59 +0800
Subject: GDK W32: Always process all available messages
The GLib main loop blocks on MsgWaitForMultipleObjectsEx to
determine if there are any incoming messages while also allowing
for background tasks to run. If all available messages are not
processed after MsgWaitForMultipleObjectsEx has signaled that
there are available, CPU usage will skyrocket.
From my limited understanding (by inspection of profiling
under Visual Studio):
Key is pressed - MsgWaitForMultipleObjectsEx unblocks, and
sends message to GDK's event handler. Some event is now queued.
g_poll unblocks, calls the g_event_dispatch which finally
resolves to gdk_event_dispatch. This then calls
_gdk_win32_display_queue_events, but since a message is already
queued, it fails to call PeekMessage and returns immediately.
At the next iteration, g_poll again calls MsgWaitForMultipleObjectsEx
which queues yet another event and returns almost immediately, since
there are events available which haven't been processed by PeekMessage.
The dispatch function is then called and the process repeats.
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=771568
Origin: upstream, 2.24.33, commit:bfdac2f70e005b2504cc3f4ebbdab328974d005a
---
gdk/win32/gdkevents-win32.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index 9b09edd..e52f21c 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -3622,8 +3622,7 @@ _gdk_events_queue (GdkDisplay *display)
if (modal_win32_dialog != NULL)
return;
- while (!_gdk_event_queue_find_first (display) &&
- PeekMessageW (&msg, NULL, 0, 0, PM_REMOVE))
+ while (PeekMessageW (&msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage (&msg);
DispatchMessageW (&msg);
From: Jeremy Tan <jtanx@outlook.com>
Date: Sat, 17 Sep 2016 20:46:30 +0800
Subject: GDK W32: Ignore autorepeated key presses on modifier keys
The X11 backend does not send autorepeated messages for modifier keys,
and doing so prevents motion compression from working.
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=771568
Origin: upstream, 2.24.33, commit:61162225f712df648f38fd12bc0817cfa9f79a64
---
gdk/win32/gdkevents-win32.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index e52f21c..ac91fa6 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -2274,6 +2274,14 @@ gdk_event_translate (MSG *msg,
in_ime_composition)
break;
+ /* Ignore autorepeats on modifiers */
+ if (msg->message == WM_KEYDOWN &&
+ (msg->wParam == VK_MENU ||
+ msg->wParam == VK_CONTROL ||
+ msg->wParam == VK_SHIFT) &&
+ ((HIWORD(msg->lParam) & KF_REPEAT) >= 1))
+ break;
+
if (!propagate (&window, msg,
_gdk_display->keyboard_grab.window,
_gdk_display->keyboard_grab.owner_events,
From: Dennis Schridde <devurandom@gmx.net>
Date: Sun, 18 Mar 2018 19:49:38 +0100
Subject: Make gtk+-2.24.31 compatible with the changed API of glib-2.54.3
glib-2.54.3 changed API, compared to glib-2.52.3 and gtk+-2.24.31's
expectations. This commit fixes the resulting issue in a backwards
compatible way.
See-Also: https://bugs.gentoo.org/650536
Applied-upstream: 2.24.33, commit:88bb7ecc47f5cd4d9ca9d2a7a8e096fec0d2e867
---
gtk/gtk.symbols | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index 6d5d5b6..a264df8 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -2498,8 +2498,8 @@ gtk_input_dialog_new
#endif
#endif
-#if IN_HEADER(__gtk_marshal_MARSHAL_H__)
-#if IN_FILE(__gtk_marshal_MARSHAL_C__)
+#if IN_HEADER(__gtk_marshal_MARSHAL_H__) || IN_HEADER(__GTK_MARSHAL_MARSHAL_H__)
+#if IN_FILE(__gtk_marshal_MARSHAL_C__) || IN_FILE(__GTK_MARSHAL_MARSHAL_C__)
#ifndef GTK_DISABLE_DEPRECATED
gtk_marshal_BOOLEAN__POINTER
gtk_marshal_BOOLEAN__POINTER_INT_INT
From: Emmanuele Bassi <ebassi@gnome.org>
Date: Sat, 10 Feb 2018 18:55:59 +0000
Subject: Revert "Fix abicheck"
This reverts commit 331877fe367f9c4e9472f5a211499b4225ef2513.
The newly visible symbols were the result of a bug in the Python port of
glib-genmarshal, which was fixed in GLib 2.54.
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=793057
Origin: upstream, 2.24.33, commit:f14fbca64509a5b79607f20ecbbe69239eb24e15
---
gtk/abicheck.sh | 2 +-
gtk/gtk.symbols | 9 ---------
2 files changed, 1 insertion(+), 10 deletions(-)
diff --git a/gtk/abicheck.sh b/gtk/abicheck.sh
index 23b2b0a..0d033fb 100755
--- a/gtk/abicheck.sh
+++ b/gtk/abicheck.sh
@@ -1,5 +1,5 @@
#! /bin/sh
cpp -DINCLUDE_VARIABLES -P -DG_OS_UNIX -DGTK_WINDOWING_X11 -DALL_FILES ${srcdir:-.}/gtk.symbols | sed -e '/^$/d' -e 's/ G_GNUC.*$//' -e 's/ PRIVATE//' | sort > expected-abi
-nm -D -g --defined-only .libs/libgtk-x11-2.0.so | cut -d ' ' -f 3 | egrep -v '^(__bss_start|_edata|_end)' | egrep -v '^g_cclosure_marshal' | sort > actual-abi
+nm -D -g --defined-only .libs/libgtk-x11-2.0.so | cut -d ' ' -f 3 | egrep -v '^(__bss_start|_edata|_end)' | sort > actual-abi
diff -u expected-abi actual-abi && rm -f expected-abi actual-abi
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index 5f9ba56..6d5d5b6 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -2510,16 +2510,10 @@ gtk_marshal_BOOLEAN__VOID
gtk_marshal_ENUM__ENUM
gtk_marshal_INT__POINTER
gtk_marshal_INT__POINTER_CHAR_CHAR
-gtk_marshal_VOID__BOOLEAN
-gtk_marshal_VOID__BOXED
-gtk_marshal_VOID__ENUM
gtk_marshal_VOID__ENUM_FLOAT
gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN
-gtk_marshal_VOID__INT
gtk_marshal_VOID__INT_INT
gtk_marshal_VOID__INT_INT_POINTER
-gtk_marshal_VOID__OBJECT
-gtk_marshal_VOID__POINTER
gtk_marshal_VOID__POINTER_INT
gtk_marshal_VOID__POINTER_INT_INT_POINTER_UINT_UINT
gtk_marshal_VOID__POINTER_POINTER
@@ -2529,13 +2523,10 @@ gtk_marshal_VOID__POINTER_STRING_STRING
gtk_marshal_VOID__POINTER_UINT
gtk_marshal_VOID__POINTER_UINT_ENUM
gtk_marshal_VOID__POINTER_UINT_UINT
-gtk_marshal_VOID__STRING
gtk_marshal_VOID__STRING_INT_POINTER
-gtk_marshal_VOID__UINT
gtk_marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER
gtk_marshal_VOID__UINT_POINTER_UINT_UINT_ENUM
gtk_marshal_VOID__UINT_STRING
-gtk_marshal_VOID__VOID
#endif
#endif
#endif
From: Rafal Luzynski <digitalfreak@lingonborough.com>
Date: Sat, 10 Feb 2018 14:07:56 +0100
Subject: calendar: Use the new "%OB" format if supported
Due to the recent changes introduced in glibc 2.27 "%OB" is the
correct format to obtain a month name as used in the calendar
header. The same rule has been working in BSD family (including
OS X) since 1990s. This simple hack checks whether "%OB" is supported
at runtime and uses it if it is, falls back to the old "%B" otherwise.
Bug: #9
Origin: upstream, 2.24.33, commit:2ea743ab466703091a44a74e1a4ac7db983c0bca
---
gtk/gtkcalendar.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index 2dd68d6..28baba1 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -689,6 +689,7 @@ gtk_calendar_init (GtkCalendar *calendar)
#ifdef G_OS_WIN32
wchar_t wbuffer[100];
#else
+ static const char *month_format = NULL;
char buffer[255];
time_t tmp_time;
#endif
@@ -714,7 +715,7 @@ gtk_calendar_init (GtkCalendar *calendar)
{
#ifndef G_OS_WIN32
tmp_time= (i+3)*86400;
- strftime ( buffer, sizeof (buffer), "%a", gmtime (&tmp_time));
+ strftime (buffer, sizeof (buffer), "%a", gmtime (&tmp_time));
default_abbreviated_dayname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
#else
if (!GetLocaleInfoW (GetThreadLocale (), LOCALE_SABBREVDAYNAME1 + (i+6)%7,
@@ -730,7 +731,21 @@ gtk_calendar_init (GtkCalendar *calendar)
{
#ifndef G_OS_WIN32
tmp_time=i*2764800;
- strftime ( buffer, sizeof (buffer), "%B", gmtime (&tmp_time));
+ if (G_UNLIKELY (month_format == NULL))
+ {
+ buffer[0] = '\0';
+ month_format = "%OB";
+ strftime (buffer, sizeof (buffer), month_format, gmtime (&tmp_time));
+ /* "%OB" is not supported in Linux with glibc < 2.27 */
+ if (!strcmp (buffer, "%OB") || !strcmp (buffer, "OB") || !strcmp (buffer, ""))
+ {
+ month_format = "%B";
+ strftime (buffer, sizeof (buffer), month_format, gmtime (&tmp_time));
+ }
+ }
+ else
+ strftime (buffer, sizeof (buffer), month_format, gmtime (&tmp_time));
+
default_monthname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
#else
if (!GetLocaleInfoW (GetThreadLocale (), LOCALE_SMONTHNAME1 + i,
From: Ting-Wei Lan <lantw@src.gnome.org>
Date: Sat, 20 Jan 2018 17:52:33 +0800
Subject: configure: Move all includes to the first argument of AC_TRY_LINK
Putting includes in the second argument of AC_TRY_LINK is not safe. If
a header having inline functions is included inside the main function,
it becomes a nested function. This is not supported by clang.
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=792720
Origin: upstream, 2.24.33, commit:c3ededb119405c26c684cef569177b73255b7a22
---
configure.ac | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index b75f9c6..44d3056 100644
--- a/configure.ac
+++ b/configure.ac
@@ -715,7 +715,7 @@ oLIBS="$LIBS"
LIBS="$LIBS $GDK_WLIBS"
# The following is necessary for Linux libc-5.4.38
AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
-AC_TRY_LINK([#include <stdlib.h>],[
+AC_TRY_LINK([#include <stdlib.h>
#if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
# ifdef HAVE_WCTYPE_H
# include <wctype.h>
@@ -726,7 +726,7 @@ AC_TRY_LINK([#include <stdlib.h>],[
# endif
#else
# define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
-#endif
+#endif],[
iswalnum((wchar_t) 0);
], gdk_working_wctype=yes, gdk_working_wctype=no)
LIBS="$oLIBS"
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Fri, 1 Jun 2018 16:43:01 +0200
Subject: gdk: activate window on keyboard grabs
In 01455399e83a ("gdk: do not deactivate surface on keyboard grabs"), we
made gdk avoid deactivating surfaces when another application takes a
keyboard grab, by using has_focus_window instead of has_focus. That however
broke activating surfaces when the gdk application acquired a grab itself,
in which case has_focus_window is false but has_focus is true.
We thus actually need to use both: surfaces should be activated either
because we have normal keyboard focus, or because we grabbed the keyboard.
This also renames HAS_FOCUS to APPEARS_FOCUSED to better reflect its
role.
Bug: #85
(cherry picked from commit 3287ac96e02ff236d74db10164c5b0c1e7b2b0bf)
(cherry picked from commit 039285deb92b6baf6ef594b0d718e8f7a7e1d0ac)
Origin: upstream, 2.24.33, commit:853f786727a954d10ed78405adc18e0772ccd1cb
---
gdk/x11/gdkevents-x11.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/gdk/x11/gdkevents-x11.c b/gdk/x11/gdkevents-x11.c
index 360b0c7..bef77b5 100644
--- a/gdk/x11/gdkevents-x11.c
+++ b/gdk/x11/gdkevents-x11.c
@@ -621,8 +621,8 @@ gdk_check_wm_state_changed (GdkWindow *window)
do_net_wm_state_changes (window);
}
-#define HAS_FOCUS(toplevel) \
- ((toplevel)->has_focus_window || (toplevel)->has_pointer_focus)
+#define APPEARS_FOCUSED(toplevel) \
+ ((toplevel)->has_focus || (toplevel)->has_focus_window || (toplevel)->has_pointer_focus)
static void
generate_focus_event (GdkWindow *window,
@@ -1344,11 +1344,11 @@ gdk_event_translate (GdkDisplay *display,
if (xevent->xcrossing.focus && !toplevel->has_focus_window)
{
- gboolean had_focus = HAS_FOCUS (toplevel);
+ gboolean had_focus = APPEARS_FOCUSED (toplevel);
toplevel->has_pointer_focus = TRUE;
- if (HAS_FOCUS (toplevel) != had_focus)
+ if (APPEARS_FOCUSED (toplevel) != had_focus)
generate_focus_event (window, TRUE);
}
}
@@ -1441,11 +1441,11 @@ gdk_event_translate (GdkDisplay *display,
if (xevent->xcrossing.focus && !toplevel->has_focus_window)
{
- gboolean had_focus = HAS_FOCUS (toplevel);
+ gboolean had_focus = APPEARS_FOCUSED (toplevel);
toplevel->has_pointer_focus = FALSE;
- if (HAS_FOCUS (toplevel) != had_focus)
+ if (APPEARS_FOCUSED (toplevel) != had_focus)
generate_focus_event (window, FALSE);
}
}
@@ -1523,7 +1523,7 @@ gdk_event_translate (GdkDisplay *display,
if (toplevel)
{
- gboolean had_focus = HAS_FOCUS (toplevel);
+ gboolean had_focus = APPEARS_FOCUSED (toplevel);
switch (xevent->xfocus.detail)
{
@@ -1569,7 +1569,7 @@ gdk_event_translate (GdkDisplay *display,
break;
}
- if (HAS_FOCUS (toplevel) != had_focus)
+ if (APPEARS_FOCUSED (toplevel) != had_focus)
generate_focus_event (window, TRUE);
}
break;
@@ -1582,7 +1582,7 @@ gdk_event_translate (GdkDisplay *display,
if (toplevel)
{
- gboolean had_focus = HAS_FOCUS (toplevel);
+ gboolean had_focus = APPEARS_FOCUSED (toplevel);
switch (xevent->xfocus.detail)
{
@@ -1620,7 +1620,7 @@ gdk_event_translate (GdkDisplay *display,
break;
}
- if (HAS_FOCUS (toplevel) != had_focus)
+ if (APPEARS_FOCUSED (toplevel) != had_focus)
generate_focus_event (window, FALSE);
}
break;
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Thu, 19 Apr 2018 14:10:23 +0200
Subject: gdk: do not deactivate surface on keyboard grabs
When pressing e.g. a window manager shortcut, which acquires keyboard grab,
Xorg would send FocusOut NotifyGrab then FocusIn NotifyUngrab. Currently
gdk would then deactivate the current surface, which makes accessibility
screen readers think that we have switched to a non-accessible application
and came back again, and thus reannounce the application frame etc. which we
don't want when e.g. just raising volume.
And actually, receiving FocusOut NotifyGrab does not mean losing the
X focus, it only means an application aqcuired a grab, i.e. it is
temporarily stealing keyboard events. On Wayland, this isn't even
notified actually.
This commit makes gdk only deactivate surfaces when there was an actual
focus switch to another window, as determined by has_focus_window (instead
of just has_focus), which happens either normally through FocusOut with
NotifyNormal, or during grabs through FocusOut with NotifyWhileGrabbed.
Bug: #85
(cherry picked from commit 01455399e83a3dbafb0cdc6e12c7003b2f472a40)
Origin: upstream, 2.24.33, commit:00b17063ac8e58d436b7ee5e79da83e74cbbbb30
---
gdk/x11/gdkevents-x11.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdk/x11/gdkevents-x11.c b/gdk/x11/gdkevents-x11.c
index 186a8f5..360b0c7 100644
--- a/gdk/x11/gdkevents-x11.c
+++ b/gdk/x11/gdkevents-x11.c
@@ -622,7 +622,7 @@ gdk_check_wm_state_changed (GdkWindow *window)
}
#define HAS_FOCUS(toplevel) \
- ((toplevel)->has_focus || (toplevel)->has_pointer_focus)
+ ((toplevel)->has_focus_window || (toplevel)->has_pointer_focus)
static void
generate_focus_event (GdkWindow *window,
From: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri, 25 Aug 2017 16:24:38 +0100
Subject: gtk/queryimmodules.c: Make the output deterministic.
Whilst working on the Reproducible Builds effort [0], we noticed that
queryimmodules generates non-reproducible output as it iterates over the
filesystem without sorting.
Patch attached.
[0] https://reproducible-builds.org/
Signed-off-by: Chris Lamb <lamby@debian.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=786528
Bug-Debian: https://bugs.debian.org/872729
Applied-upstream: 2.24.33, commit:78c34e11c3021cdf1f2f6beadad9c40c6da76464
---
gtk/queryimmodules.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/gtk/queryimmodules.c b/gtk/queryimmodules.c
index a91ea47..e87391b 100644
--- a/gtk/queryimmodules.c
+++ b/gtk/queryimmodules.c
@@ -204,13 +204,19 @@ int main (int argc, char **argv)
if (dir)
{
const char *dent;
+ GList *list = NULL, *iterator = NULL;
while ((dent = g_dir_read_name (dir)))
+ list = g_list_prepend (list, g_strdup (dent));
+
+ list = g_list_sort (list, (GCompareFunc) strcmp);
+ for (iterator = list; iterator; iterator = iterator->next)
{
- if (g_str_has_suffix (dent, SOEXT))
- error |= query_module (dirs[i], dent, contents);
+ if (g_str_has_suffix (iterator->data, SOEXT))
+ error |= query_module (dirs[i], iterator->data, contents);
}
+ g_list_free_full (list, g_free);
g_dir_close (dir);
}
From: Ivan Zakharyaschev <imz@altlinux.org>
Date: Sat, 17 Feb 2018 06:19:56 +0300
Subject: gtkprintbackendcups.c: fix \n at end of a debugging note
Origin: upstream, 2.24.33, commit:7461ceebe34bfc6f882145e89e1ba2f187d08303
---
modules/printbackends/cups/gtkprintbackendcups.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c
index 24d4d8b..2a000dc 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
@@ -2184,7 +2184,7 @@ cups_printer_handle_attribute (GtkPrintBackendCups *cups_backend,
else
{
GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: Attribute %s ignored", ippGetName (attr)));
+ g_print ("CUPS Backend: Attribute %s ignored\n", ippGetName (attr)));
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment