Remove 5 patches applied in new release

Revert "Cherry-pick fixes from upstream gtk-3-24 branch"

This reverts commit 95af6db767.
This commit is contained in:
Jeremy Bícha 2025-01-27 08:23:22 -05:00
parent 5544c68316
commit 96965dae00
6 changed files with 0 additions and 434 deletions

View File

@ -1,27 +0,0 @@
From: yangyingchao <yang.yingchao@qq.com>
Date: Tue, 30 Apr 2024 09:09:39 +0800
Subject: Ensure the staging_cairo_surface is destroyed before re-assigning it
Without doing so, memory regions allocated may not be freed in some cases.
Closes 6675.
(cherry picked from commit b237989bb3a795360e272f22f6edc23ca8f73f7e)
Origin: upstream gtk-3-24 branch, after 3.24.43
---
gdk/wayland/gdkwindow-wayland.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 7b24877..07af2ef 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -954,6 +954,7 @@ buffer_release_callback (void *_data,
/* Release came in, we haven't done any interim updates, so we can just use
* the old committed buffer again.
*/
+ g_clear_pointer (&impl->staging_cairo_surface, cairo_surface_destroy);
impl->staging_cairo_surface = g_steal_pointer (&impl->committed_cairo_surface);
}

View File

@ -1,114 +0,0 @@
From: Michael Weghorn <m.weghorn@posteo.de>
Date: Fri, 9 Aug 2024 18:30:24 +0200
Subject: a11y: Extract helper function to set GtkMessageDialog a11y name
Extract the existing logic to set an accessible name for the
`GtkMessageDialog` based on the message type from `setup_type`
to a new helper function `update_accessible_name`.
That helper function will be reused and extended in a follow-up
commit.
(cherry picked from commit 13f55cd3e664b0fa7c14944572f2b41b73d64d16)
Origin: upstream gtk-3-24 branch, after 3.24.43
---
gtk/gtkmessagedialog.c | 68 +++++++++++++++++++++++++++++---------------------
1 file changed, 40 insertions(+), 28 deletions(-)
diff --git a/gtk/gtkmessagedialog.c b/gtk/gtkmessagedialog.c
index e70c820..1de3118 100644
--- a/gtk/gtkmessagedialog.c
+++ b/gtk/gtkmessagedialog.c
@@ -366,12 +366,50 @@ setup_primary_label_font (GtkMessageDialog *dialog)
}
}
+static void
+update_accessible_name (GtkMessageDialog *dialog)
+{
+ AtkObject *atk_obj = gtk_widget_get_accessible (GTK_WIDGET (dialog));
+ if (!GTK_IS_ACCESSIBLE (atk_obj))
+ return;
+
+ const char *name = NULL;
+
+ switch (dialog->priv->message_type)
+ {
+ case GTK_MESSAGE_INFO:
+ name = _("Information");
+ break;
+
+ case GTK_MESSAGE_QUESTION:
+ name = _("Question");
+ break;
+
+ case GTK_MESSAGE_WARNING:
+ name = _("Warning");
+ break;
+
+ case GTK_MESSAGE_ERROR:
+ name = _("Error");
+ break;
+
+ case GTK_MESSAGE_OTHER:
+ break;
+
+ default:
+ g_warning ("Unknown GtkMessageType %u", dialog->priv->message_type);
+ break;
+ }
+
+ if (name)
+ atk_object_set_name (atk_obj, name);
+}
+
static void
setup_type (GtkMessageDialog *dialog,
GtkMessageType type)
{
GtkMessageDialogPrivate *priv = dialog->priv;
- const gchar *name = NULL;
AtkObject *atk_obj;
if (priv->message_type == type)
@@ -379,38 +417,12 @@ setup_type (GtkMessageDialog *dialog,
priv->message_type = type;
- switch (type)
- {
- case GTK_MESSAGE_INFO:
- name = _("Information");
- break;
-
- case GTK_MESSAGE_QUESTION:
- name = _("Question");
- break;
-
- case GTK_MESSAGE_WARNING:
- name = _("Warning");
- break;
-
- case GTK_MESSAGE_ERROR:
- name = _("Error");
- break;
-
- case GTK_MESSAGE_OTHER:
- break;
-
- default:
- g_warning ("Unknown GtkMessageType %u", type);
- break;
- }
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (dialog));
if (GTK_IS_ACCESSIBLE (atk_obj))
{
atk_object_set_role (atk_obj, ATK_ROLE_ALERT);
- if (name)
- atk_object_set_name (atk_obj, name);
+ update_accessible_name (dialog);
}
g_object_notify (G_OBJECT (dialog), "message-type");

View File

@ -1,65 +0,0 @@
From: Michael Weghorn <m.weghorn@posteo.de>
Date: Fri, 9 Aug 2024 18:37:11 +0200
Subject: a11y: Use non-empty message dialog title as a11y name
If a `GtkMessageDialog` has a non-empty title set, use
that for the accessible name instead of a generic name
indicating the type of the message dialog, as the
window title is generally more informative, if set.
It also better matches the information presented
visually on screen (in the window title, task switchers,...)
and is in line with the handling for non-message-dialog
windows.
This can easily be tested with the "Dialogs and
Message Boxes" sample from gtk3-demo when setting
a title for the message dialog in there like this:
> diff --git a/demos/gtk-demo/dialog.c b/demos/gtk-demo/dialog.c
> index 0eb1c62397..53fb7f8b0e 100644
> --- a/demos/gtk-demo/dialog.c
> +++ b/demos/gtk-demo/dialog.c
> @@ -25,6 +25,8 @@ message_dialog_clicked (GtkButton *button,
> "number of times:");
> gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
> "%d", i);
> + gtk_window_set_title (GTK_WINDOW (dialog), "Some informative title");
> +
> gtk_dialog_run (GTK_DIALOG (dialog));
> gtk_widget_destroy (dialog);
> i++;
(cherry picked from commit 939737c3e72c2deaa0094f35838038df92f2a724)
Origin: upstream gtk-3-24 branch, after 3.24.43
---
gtk/gtkmessagedialog.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/gtk/gtkmessagedialog.c b/gtk/gtkmessagedialog.c
index 1de3118..ee35b26 100644
--- a/gtk/gtkmessagedialog.c
+++ b/gtk/gtkmessagedialog.c
@@ -373,7 +373,12 @@ update_accessible_name (GtkMessageDialog *dialog)
if (!GTK_IS_ACCESSIBLE (atk_obj))
return;
- const char *name = NULL;
+ const char *name = gtk_window_get_title (GTK_WINDOW (dialog));
+ if (name && name[0])
+ {
+ atk_object_set_name (atk_obj, name);
+ return;
+ }
switch (dialog->priv->message_type)
{
@@ -438,6 +443,8 @@ update_title (GObject *dialog,
title = gtk_window_get_title (GTK_WINDOW (dialog));
gtk_label_set_label (GTK_LABEL (label), title);
gtk_widget_set_visible (label, title && title[0]);
+
+ update_accessible_name (GTK_MESSAGE_DIALOG (dialog));
}
static void

View File

@ -1,86 +0,0 @@
From: likai <likai@kylinos.cn>
Date: Wed, 7 Aug 2024 22:01:15 +0800
Subject: gesture: set widget x and y if coordinate translation between
widgets fails
Bug Description: In a GTK+ application with a menu bar, clicking the
menu item displays a dialog. However, when the user opens this dialog
and drags the parent window's menu bar with the cursor, the dialog
gets moved.
Issue: When _gtk_gesture_update_point calls the _update_widget_coordinates
function, the local variables x and y are not explicitly initialized, leading
to arbitrary values. For instance, in my case, x was 32767 and y was
-145750164 . These values are used in the subsequent call to
gtk_widget_translate_coordinates. In gtk_widget_translate_coordinates,
if ancestor is NULL, the function returns FALSE, and dest_x and dest_y
are not updated. The incorrect values of x and y cause data->widget_x
and data->widget_y to be incorrect, ultimately leading to abnormal
x and y values in the gtk_gesture_drag_update function.
To avoid this, we should set x and y to values clearly outside the widget.
Signed-off-by: Li Kai <likai@kylinos.cn>
(cherry picked from commit a1046a13da52e0b4ad4a552d27a535be2a604f5c)
Origin: upstream gtk-3-24 branch, after 3.24.43
---
gtk/gtkgesture.c | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/gtk/gtkgesture.c b/gtk/gtkgesture.c
index 48cf9ba..bfc8ce0 100644
--- a/gtk/gtkgesture.c
+++ b/gtk/gtkgesture.c
@@ -125,6 +125,7 @@
#include "gtkmain.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
+#include <math.h>
typedef struct _GtkGesturePrivate GtkGesturePrivate;
typedef struct _PointData PointData;
@@ -472,7 +473,7 @@ _update_widget_coordinates (GtkGesture *gesture,
GtkWidget *event_widget, *widget;
GtkAllocation allocation;
gdouble event_x, event_y;
- gint wx, wy, x, y;
+ gint x, y;
event_widget = gtk_get_event_widget (data->event);
@@ -486,6 +487,7 @@ _update_widget_coordinates (GtkGesture *gesture,
while (window && window != event_widget_window)
{
+ gint wx, wy;
gdk_window_get_position (window, &wx, &wy);
event_x += wx;
event_y += wy;
@@ -502,13 +504,20 @@ _update_widget_coordinates (GtkGesture *gesture,
event_y -= allocation.y;
}
- gtk_widget_translate_coordinates (event_widget, widget,
- event_x, event_y, &x, &y);
- /* gtk_widget_translate() loses the fractional part so we need to
- * add it back to not lose accuracy */
- data->widget_x = x + (event_x - (int)event_x);
- data->widget_y = y + (event_y - (int)event_y);
-
+ if (gtk_widget_translate_coordinates (event_widget, widget,
+ event_x, event_y, &x, &y))
+ {
+ /* gtk_widget_translate() loses the fractional part so we need to
+ * add it back to not lose accuracy */
+ data->widget_x = x + (event_x - (int)event_x);
+ data->widget_y = y + (event_y - (int)event_y);
+ }
+ else
+ {
+ /* Mark the coordinates well outside the widget, to
+ * signal that the translation has failed */
+ data->widget_x = data->widget_y = NAN;
+ }
}
static GtkEventSequenceState

View File

@ -1,137 +0,0 @@
From: Benjamin Otte <otte@redhat.com>
Date: Tue, 8 Jan 2019 00:16:52 +0100
Subject: immulticontext: Don't have a global_context_id
Context IDs are dependant on the display - both because displays can use
different backends, but also because changing the GtkSetting is a
per-display operation.
So just remove the cache.
If it turns out we need a per-display cache, we can add one to
GtkSettings.
(cherry picked from commit 16d4ce4d0301b7af2a67703e792efdcf27b1d397
with slight changes to use priv->client_window instead of
priv->client_widget)
(cherry picked from commit 39345212e8190aefa55a5266c123b2a7afc5c75f)
Origin: upstream gtk-3-24 branch, after 3.24.43
---
gtk/gtkimmulticontext.c | 55 +++++++++++++++++++++++--------------------------
1 file changed, 26 insertions(+), 29 deletions(-)
diff --git a/gtk/gtkimmulticontext.c b/gtk/gtkimmulticontext.c
index ec67254..5036355 100644
--- a/gtk/gtkimmulticontext.c
+++ b/gtk/gtkimmulticontext.c
@@ -102,8 +102,6 @@ static gboolean gtk_im_multicontext_delete_surrounding_cb (GtkIMContext *
static void propagate_purpose (GtkIMMulticontext *context);
-static const gchar *global_context_id = NULL;
-
G_DEFINE_TYPE_WITH_PRIVATE (GtkIMMulticontext, gtk_im_multicontext, GTK_TYPE_IM_CONTEXT)
static void
@@ -256,10 +254,7 @@ get_effective_context_id (GtkIMMulticontext *multicontext)
if (priv->context_id_aux)
return priv->context_id_aux;
- if (!global_context_id)
- global_context_id = _gtk_im_module_get_default_context_id ();
-
- return global_context_id;
+ return _gtk_im_module_get_default_context_id ();
}
static GtkIMContext *
@@ -267,9 +262,6 @@ gtk_im_multicontext_get_slave (GtkIMMulticontext *multicontext)
{
GtkIMMulticontextPrivate *priv = multicontext->priv;
- if (g_strcmp0 (priv->context_id, get_effective_context_id (multicontext)) != 0)
- gtk_im_multicontext_set_slave (multicontext, NULL, FALSE);
-
if (!priv->slave)
{
GtkIMContext *slave;
@@ -290,23 +282,31 @@ gtk_im_multicontext_get_slave (GtkIMMulticontext *multicontext)
}
static void
-im_module_setting_changed (GtkSettings *settings,
- gpointer data)
+im_module_setting_changed (GtkSettings *settings,
+ GtkIMMulticontext *self)
{
- global_context_id = NULL;
+ gtk_im_multicontext_set_slave (self, NULL, FALSE);
}
-
static void
gtk_im_multicontext_set_client_window (GtkIMContext *context,
GdkWindow *window)
{
- GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context);
- GtkIMMulticontextPrivate *priv = multicontext->priv;
+ GtkIMMulticontext *self = GTK_IM_MULTICONTEXT (context);
+ GtkIMMulticontextPrivate *priv = self->priv;
GtkIMContext *slave;
GdkScreen *screen;
GtkSettings *settings;
- gboolean connected;
+
+ if (priv->client_window != NULL)
+ {
+ screen = gdk_window_get_screen (priv->client_window);
+ settings = gtk_settings_get_for_screen (screen);
+
+ g_signal_handlers_disconnect_by_func (settings,
+ im_module_setting_changed,
+ self);
+ }
priv->client_window = window;
@@ -315,20 +315,12 @@ gtk_im_multicontext_set_client_window (GtkIMContext *context,
screen = gdk_window_get_screen (window);
settings = gtk_settings_get_for_screen (screen);
- connected = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (settings),
- "gtk-im-module-connected"));
- if (!connected)
- {
- g_signal_connect (settings, "notify::gtk-im-module",
- G_CALLBACK (im_module_setting_changed), NULL);
- g_object_set_data (G_OBJECT (settings), "gtk-im-module-connected",
- GINT_TO_POINTER (TRUE));
-
- global_context_id = NULL;
- }
+ g_signal_connect (settings, "notify::gtk-im-module",
+ G_CALLBACK (im_module_setting_changed),
+ self);
}
- slave = gtk_im_multicontext_get_slave (multicontext);
+ slave = gtk_im_multicontext_get_slave (self);
if (slave)
gtk_im_context_set_client_window (slave, window);
}
@@ -723,9 +715,14 @@ gtk_im_multicontext_append_menuitems (GtkIMMulticontext *context,
const char *
gtk_im_multicontext_get_context_id (GtkIMMulticontext *context)
{
+ GtkIMMulticontextPrivate *priv = context->priv;
+
g_return_val_if_fail (GTK_IS_IM_MULTICONTEXT (context), NULL);
- return context->priv->context_id;
+ if (priv->context_id == NULL)
+ gtk_im_multicontext_get_slave (context);
+
+ return priv->context_id;
}
/**

View File

@ -3,8 +3,3 @@
060_ignore-random-icons.patch
reftest_compare_surfaces-Report-how-much-the-images-diffe.patch
reftests-Allow-minor-differences-to-be-tolerated.patch
immulticontext-Don-t-have-a-global_context_id.patch
Ensure-the-staging_cairo_surface-is-destroyed-before-re-a.patch
gesture-set-widget-x-and-y-if-coordinate-translation-betw.patch
a11y-Extract-helper-function-to-set-GtkMessageDialog-a11y.patch
a11y-Use-non-empty-message-dialog-title-as-a11y-name.patch