changed debian/source/format to native

This commit is contained in:
openKylinBot 2022-05-23 18:36:17 +08:00
parent 85d14322c5
commit aa76ec0e83
23 changed files with 1 additions and 2515 deletions

View File

@ -1,194 +0,0 @@
From: Lars Uebernickel <lars.uebernickel@canonical.com>
Date: Thu, 1 Oct 2015 15:35:09 +0200
Subject: [PATCH] calendar: always emit "day-selected" once
"day-selected" was emitted twice when clicking on a day of the previous
or next month. This was because calendar_set_month{next,prev}() always
selected the first (or last) day of the newly focussed month. Callers
that wanted a different day to be selected had to do so after calling
one of those functions.
Fix this by passing the desired day into those functions directly.
https://bugzilla.gnome.org/show_bug.cgi?id=755941
---
gtk/gtkcalendar.c | 72 +++++++++++++++++++++++++++++++++----------------------
1 file changed, 43 insertions(+), 29 deletions(-)
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index 5f1a5d5..adc01d4 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -887,11 +887,15 @@ calendar_queue_refresh (GtkCalendar *calendar)
}
static void
-calendar_set_month_next (GtkCalendar *calendar)
+calendar_set_month_next (GtkCalendar *calendar,
+ gint day)
{
gint month_len;
GtkCalendarPrivate *priv = calendar->priv;
+ if (day < 0)
+ day = priv->selected_day;
+
if (priv->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE)
return;
@@ -913,13 +917,13 @@ calendar_set_month_next (GtkCalendar *calendar)
month_len = month_length[leap (priv->year)][priv->month + 1];
- if (month_len < priv->selected_day)
+ if (month_len < day)
{
priv->selected_day = 0;
gtk_calendar_select_day (calendar, month_len);
}
else
- gtk_calendar_select_day (calendar, priv->selected_day);
+ gtk_calendar_select_day (calendar, day);
calendar_queue_refresh (calendar);
}
@@ -1312,11 +1316,15 @@ calendar_day_rectangle (GtkCalendar *calendar,
}
static void
-calendar_set_month_prev (GtkCalendar *calendar)
+calendar_set_month_prev (GtkCalendar *calendar,
+ gint day)
{
GtkCalendarPrivate *priv = calendar->priv;
gint month_len;
+ if (day < 0)
+ day = priv->selected_day;
+
if (priv->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE)
return;
@@ -1339,16 +1347,16 @@ calendar_set_month_prev (GtkCalendar *calendar)
gtk_calendar_signals[MONTH_CHANGED_SIGNAL],
0);
- if (month_len < priv->selected_day)
+ if (month_len < day)
{
priv->selected_day = 0;
gtk_calendar_select_day (calendar, month_len);
}
else
{
- if (priv->selected_day < 0)
- priv->selected_day = priv->selected_day + 1 + month_length[leap (priv->year)][priv->month + 1];
- gtk_calendar_select_day (calendar, priv->selected_day);
+ if (day < 0)
+ day = day + 1 + month_length[leap (priv->year)][priv->month + 1];
+ gtk_calendar_select_day (calendar, day);
}
calendar_queue_refresh (calendar);
@@ -2842,10 +2850,10 @@ calendar_arrow_action (GtkCalendar *calendar,
calendar_set_year_next (calendar);
break;
case ARROW_MONTH_LEFT:
- calendar_set_month_prev (calendar);
+ calendar_set_month_prev (calendar, -1);
break;
case ARROW_MONTH_RIGHT:
- calendar_set_month_next (calendar);
+ calendar_set_month_next (calendar, -1);
break;
default:;
/* do nothing */
@@ -2944,21 +2952,27 @@ calendar_main_button_press (GtkCalendar *calendar,
day = priv->day[row][col];
if (day_month == MONTH_PREV)
- calendar_set_month_prev (calendar);
+ {
+ calendar_set_month_prev (calendar, day);
+ }
else if (day_month == MONTH_NEXT)
- calendar_set_month_next (calendar);
-
- if (!gtk_widget_has_focus (widget))
- gtk_widget_grab_focus (widget);
-
- if (event->button == GDK_BUTTON_PRIMARY)
{
- priv->in_drag = 1;
- priv->drag_start_x = x;
- priv->drag_start_y = y;
+ calendar_set_month_next (calendar, day);
}
+ else
+ {
+ if (!gtk_widget_has_focus (widget))
+ gtk_widget_grab_focus (widget);
+
+ if (event->button == GDK_BUTTON_PRIMARY)
+ {
+ priv->in_drag = 1;
+ priv->drag_start_x = x;
+ priv->drag_start_y = y;
+ }
- calendar_select_and_focus_day (calendar, day);
+ calendar_select_and_focus_day (calendar, day);
+ }
}
else if (event->type == GDK_2BUTTON_PRESS)
{
@@ -3129,13 +3143,13 @@ gtk_calendar_scroll (GtkWidget *widget,
{
if (!gtk_widget_has_focus (widget))
gtk_widget_grab_focus (widget);
- calendar_set_month_prev (calendar);
+ calendar_set_month_prev (calendar, -1);
}
else if (event->direction == GDK_SCROLL_DOWN)
{
if (!gtk_widget_has_focus (widget))
gtk_widget_grab_focus (widget);
- calendar_set_month_next (calendar);
+ calendar_set_month_next (calendar, -1);
}
else
return FALSE;
@@ -3210,7 +3224,7 @@ gtk_calendar_key_press (GtkWidget *widget,
case GDK_KEY_Left:
return_val = TRUE;
if (event->state & GDK_CONTROL_MASK)
- calendar_set_month_prev (calendar);
+ calendar_set_month_prev (calendar, -1);
else
{
move_focus (calendar, -1);
@@ -3223,7 +3237,7 @@ gtk_calendar_key_press (GtkWidget *widget,
case GDK_KEY_Right:
return_val = TRUE;
if (event->state & GDK_CONTROL_MASK)
- calendar_set_month_next (calendar);
+ calendar_set_month_next (calendar, -1);
else
{
move_focus (calendar, 1);
@@ -3277,11 +3291,11 @@ gtk_calendar_key_press (GtkWidget *widget,
day = priv->day[row][col];
if (priv->day_month[row][col] == MONTH_PREV)
- calendar_set_month_prev (calendar);
+ calendar_set_month_prev (calendar, day);
else if (priv->day_month[row][col] == MONTH_NEXT)
- calendar_set_month_next (calendar);
-
- calendar_select_and_focus_day (calendar, day);
+ calendar_set_month_next (calendar, day);
+ else
+ calendar_select_and_focus_day (calendar, day);
}
}

View File

@ -1,35 +0,0 @@
From: Iain Lane <iain@orangesquash.org.uk>
Date: Fri, 23 Jan 2015 17:05:40 +0000
Subject: [PATCH] gtk-reftest: Force icon theme to Adwaita
Since reftests are developed against Adwaita, they sometimes fail on
other icon themes.
---
testsuite/reftests/gtk-reftest.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/testsuite/reftests/gtk-reftest.c b/testsuite/reftests/gtk-reftest.c
index 497c979..b0bdb55 100644
--- a/testsuite/reftests/gtk-reftest.c
+++ b/testsuite/reftests/gtk-reftest.c
@@ -392,6 +392,7 @@ int
main (int argc, char **argv)
{
const char *basedir;
+ GtkSettings *settings;
/* I don't want to fight fuzzy scaling algorithms in GPUs,
* so unless you explicitly set it to something else, we
@@ -402,6 +403,12 @@ main (int argc, char **argv)
if (!parse_command_line (&argc, &argv))
return 1;
+ settings = gtk_settings_get_default ();
+
+ g_assert_nonnull (settings);
+
+ gtk_settings_set_string_property (settings, "gtk-icon-theme-name", "Adwaita", "");
+
if (arg_base_dir)
basedir = arg_base_dir;
else

View File

@ -1,23 +0,0 @@
From: Lars Uebernickel <lars.uebernickel@canonical.com>
Date: Tue, 24 Nov 2015 12:08:46 +0100
Subject: [PATCH] gtkwindow: set transparent background color
To reduce black flickering when new windows are created on compiz.
---
gtk/gtkwindow.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index c8fb476..2ae56a0 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -7495,6 +7495,9 @@ gtk_window_realize (GtkWidget *widget)
gtk_widget_register_window (widget, gdk_window);
gtk_widget_set_realized (widget, TRUE);
+ GdkRGBA transparent = { 1.0, 1.0, 1.0, 0.0 };
+ gdk_window_set_background_rgba (gdk_window, &transparent);
+
attributes.x = allocation.x;
attributes.y = allocation.y;
attributes.width = allocation.width;

View File

@ -1,32 +0,0 @@
From: Cody Russell <bratsche@gnome.org>
Date: Wed, 30 Nov 2011 00:25:29 +0100
Subject: Don't let offscreen widget do grabbing
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=607668
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=658563
Bug: https://gitlab.gnome.org/GNOME/gtk/issues/368
Bug-Ubuntu: https://bugs.launchpad.net/bugs/512427
Forwarded: yes
---
gtk/gtkmain.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index f7cbb34..de0abbb 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -2233,9 +2233,14 @@ gtk_grab_add (GtkWidget *widget)
{
GtkWindowGroup *group;
GtkWidget *old_grab_widget;
+ GtkWidget *toplevel;
g_return_if_fail (widget != NULL);
+ toplevel = gtk_widget_get_toplevel (widget);
+ if (toplevel && gdk_window_get_window_type (gtk_widget_get_window (toplevel)) == GDK_WINDOW_OFFSCREEN)
+ return;
+
if (!gtk_widget_has_grab (widget) && gtk_widget_is_sensitive (widget))
{
_gtk_widget_set_has_grab (widget, TRUE);

View File

@ -1,31 +0,0 @@
From: Robert Carr <racarr@canonical.com>
Date: Wed, 30 Nov 2011 00:25:29 +0100
Subject: Do not allow devices in an offscreen hierarchy to take grabs.
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=658563
Bug: https://gitlab.gnome.org/GNOME/gtk/issues/368
Bug-Ubuntu: https://launchpad.net/bugs/804009
Forwarded: yes
---
gtk/gtkmain.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index de0abbb..bf78de4 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -2326,9 +2326,14 @@ gtk_device_grab_add (GtkWidget *widget,
{
GtkWindowGroup *group;
GtkWidget *old_grab_widget;
+ GdkWindow *toplevel;
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (GDK_IS_DEVICE (device));
+
+ toplevel = gdk_window_get_toplevel (gtk_widget_get_window (widget));
+ if (toplevel && gdk_window_get_window_type (toplevel) == GDK_WINDOW_OFFSCREEN)
+ return;
group = gtk_main_get_window_group (widget);
old_grab_widget = gtk_window_group_get_current_device_grab (group, device);

View File

@ -1,34 +0,0 @@
From: Loic Minier <lool@dooz.org>
Date: Sun, 21 Oct 2007 22:05:42 +0200
Subject: Don't list images from unknown directories in icon cache
After GTK 2.12.0, gtk-update-icon-cache fails if there is a PNG file
placed directly in /usr/share/icons/hicolor (not in a correct
subdirectory like 48x48/apps).
TODO: This is believed to have been fixed differently upstream, so maybe
this change is no longer necessary:
"I believe a slightly different fix that I did some time ago fixes this
too." --Matthias Clasen, 2008-02-16 04:43:10 UTC
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=451634
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=444285
Forwarded: yes
Applied-upstream: no
---
gtk/updateiconcache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gtk/updateiconcache.c b/gtk/updateiconcache.c
index 6703c8b..fd66ac8 100644
--- a/gtk/updateiconcache.c
+++ b/gtk/updateiconcache.c
@@ -684,7 +684,7 @@ scan_directory (const gchar *base_path,
directories = g_list_append (directories, g_strdup (subdir));
}
else
- dir_index = 0xffff;
+ continue;
}
image = g_new0 (Image, 1);

View File

@ -1,82 +0,0 @@
From: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Date: Thu, 13 Dec 2018 18:00:42 -0500
Subject: "ubuntu-almost-fixed-height" private property to speed-up
software-center
Bug: https://bugzilla.gnome.org/607447
Bug-Ubuntu: https://launchpad.net/bugs/514879
=== modified file 'gtk/gtktreeview.c'
---
gtk/gtktreeview.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 20f09ef..ce8beb7 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -467,6 +467,7 @@ struct _GtkTreeViewPrivate
guint fixed_height_mode : 1;
guint fixed_height_check : 1;
+ guint ubuntu_almost_fixed_height_mode : 1;
guint activate_on_single_click : 1;
guint reorderable : 1;
@@ -554,6 +555,7 @@ enum {
PROP_ENABLE_SEARCH,
PROP_SEARCH_COLUMN,
PROP_FIXED_HEIGHT_MODE,
+ PROP_UBUNTU_ALMOST_FIXED_HEIGHT_MODE,
PROP_HOVER_SELECTION,
PROP_HOVER_EXPAND,
PROP_SHOW_EXPANDERS,
@@ -1109,6 +1111,14 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
FALSE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+ /* Private ubuntu extension to fix bugzilla bug #607447 */
+ tree_view_props[PROP_UBUNTU_ALMOST_FIXED_HEIGHT_MODE] =
+ g_param_spec_boolean ("ubuntu-almost-fixed-height-mode",
+ "Private Ubuntu extension",
+ "Private Ubuntu extension",
+ FALSE,
+ G_PARAM_WRITABLE);
+
/**
* GtkTreeView:hover-selection:
*
@@ -1847,6 +1857,7 @@ gtk_tree_view_init (GtkTreeView *tree_view)
priv->fixed_height = -1;
priv->fixed_height_mode = FALSE;
priv->fixed_height_check = 0;
+ priv->ubuntu_almost_fixed_height_mode = FALSE;
priv->selection = _gtk_tree_selection_new_with_tree_view (tree_view);
priv->enable_search = TRUE;
priv->search_column = -1;
@@ -1987,6 +1998,9 @@ G_GNUC_END_IGNORE_DEPRECATIONS
case PROP_FIXED_HEIGHT_MODE:
gtk_tree_view_set_fixed_height_mode (tree_view, g_value_get_boolean (value));
break;
+ case PROP_UBUNTU_ALMOST_FIXED_HEIGHT_MODE:
+ tree_view->priv->ubuntu_almost_fixed_height_mode = g_value_get_boolean (value);
+ break;
case PROP_HOVER_SELECTION:
if (tree_view->priv->hover_selection != g_value_get_boolean (value))
{
@@ -9030,7 +9044,15 @@ gtk_tree_view_row_changed (GtkTreeModel *model,
_gtk_tree_view_accessible_changed (tree_view, tree, node);
- if (tree_view->priv->fixed_height_mode
+ if (tree_view->priv->ubuntu_almost_fixed_height_mode
+ && tree_view->priv->fixed_height >= 0)
+ {
+ _gtk_rbtree_node_mark_invalid (tree, node);
+ validate_visible_area (tree_view);
+ if (gtk_widget_get_realized (GTK_WIDGET (tree_view)))
+ gtk_tree_view_node_queue_redraw (tree_view, tree, node);
+ }
+ else if (tree_view->priv->fixed_height_mode
&& tree_view->priv->fixed_height >= 0)
{
_gtk_rbtree_node_set_height (tree, node, tree_view->priv->fixed_height);

View File

@ -1,34 +0,0 @@
From: Simon McVittie <smcv@debian.org>
Date: Wed, 17 Jul 2019 17:20:23 +0100
Subject: Disable accessibility-dump (aka a11ytests) test
This test seems to be unreliable, with its results depending on
unknown environmental factors. Upstream disable it for CI purposes,
so we should probably do the same.
Forwarded: no
---
testsuite/a11y/Makefile.am | 3 ---
1 file changed, 3 deletions(-)
diff --git a/testsuite/a11y/Makefile.am b/testsuite/a11y/Makefile.am
index 73519e9..9b475b4 100644
--- a/testsuite/a11y/Makefile.am
+++ b/testsuite/a11y/Makefile.am
@@ -28,8 +28,6 @@ TESTS_ENVIRONMENT = \
GTK_CSD=1 \
G_ENABLE_DIAGNOSTIC=0
-TEST_PROGS += accessibility-dump
-
TEST_PROGS += tree-performance
TEST_PROGS += text
@@ -89,7 +87,6 @@ testdata = \
$(NULL)
test_in_files = \
- a11ytests.test.in \
a11ychildren.test.in \
a11ytree.test.in \
a11yvalue.test.in \

View File

@ -1,119 +0,0 @@
From: Ryan Lortie <desrt@desrt.ca>
Date: Wed, 22 Oct 2014 11:58:34 -0400
Subject: [PATCH] accel cell renderer: support modifier 'tapping'
Introduce a new GTK_CELL_RENDERER_ACCEL_MODE_MODIFIER_TAP that accepts
tapping modifier keys (eg: simply pressing and releasing the Windows
key) as accelerators.
https://bugzilla.gnome.org/show_bug.cgi?id=673360
---
gtk/gtkcellrendereraccel.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
gtk/gtkcellrendereraccel.h | 4 +++-
2 files changed, 47 insertions(+), 1 deletion(-)
diff --git a/gtk/gtkcellrendereraccel.c b/gtk/gtkcellrendereraccel.c
index e8fce86..a840571 100644
--- a/gtk/gtkcellrendereraccel.c
+++ b/gtk/gtkcellrendereraccel.c
@@ -188,6 +188,10 @@ gtk_cell_renderer_accel_class_init (GtkCellRendererAccelClass *cell_accel_class)
* accepted by GTK+ are allowed, and the accelerators are rendered
* in the same way as they are in menus.
*
+ * If the mode is set to %GTK_CELL_RENDERER_ACCEL_MODE_MODIFIER_TAP
+ * then bare modifiers can be set as accelerators by tapping (ie:
+ * pressing and immediately releasing) them.
+ *
* Since: 2.10
*/
g_object_class_install_property (object_class,
@@ -519,6 +523,13 @@ struct _GtkCellEditableEventBox
GtkCellRendererAccelMode accel_mode;
gchar *path;
GtkCellRenderer *cell;
+
+ /* Used to track the last modifier that was pressed down.
+ * We can then treat a directly-following release of the same key as a
+ * 'tap'.
+ */
+ GdkModifierType last_saw_state;
+ guint last_saw_keyval;
};
enum {
@@ -561,6 +572,9 @@ gtk_cell_editable_event_box_key_press_event (GtkWidget *widget,
display = gtk_widget_get_display (widget);
+ box->last_saw_keyval = event->keyval;
+ box->last_saw_state = event->state;
+
if (event->is_modifier)
return TRUE;
@@ -642,6 +656,35 @@ gtk_cell_editable_event_box_key_press_event (GtkWidget *widget,
return TRUE;
}
+static gboolean
+gtk_cell_editable_event_box_key_release_event (GtkWidget *widget,
+ GdkEventKey *event)
+{
+ GtkCellEditableEventBox *box = (GtkCellEditableEventBox*)widget;
+
+ /* User released a modifier key right after pressing it and we're
+ * in 'modifier tap' mode: this is our new accel.
+ */
+ if (box->accel_mode == GTK_CELL_RENDERER_ACCEL_MODE_MODIFIER_TAP &&
+ event->is_modifier && event->keyval == box->last_saw_keyval)
+ {
+ /* We use the mask from the down press -- the release event
+ * has the modifier mask from the modifier key itself.
+ */
+ gtk_grab_remove (widget);
+ gtk_cell_renderer_accel_ungrab (GTK_CELL_RENDERER_ACCEL (box->cell));
+ gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (widget));
+ gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (widget));
+
+ g_signal_emit (box->cell, signals[ACCEL_EDITED], 0, box->path,
+ event->keyval, box->last_saw_state, event->hardware_keycode);
+ }
+
+
+ /* ignore all other key release events */
+ return TRUE;
+}
+
static void
gtk_cell_editable_event_box_unrealize (GtkWidget *widget)
{
@@ -724,6 +767,7 @@ gtk_cell_editable_event_box_class_init (GtkCellEditableEventBoxClass *class)
object_class->get_property = gtk_cell_editable_event_box_get_property;
widget_class->key_press_event = gtk_cell_editable_event_box_key_press_event;
+ widget_class->key_release_event = gtk_cell_editable_event_box_key_release_event;
widget_class->unrealize = gtk_cell_editable_event_box_unrealize;
g_object_class_override_property (object_class,
diff --git a/gtk/gtkcellrendereraccel.h b/gtk/gtkcellrendereraccel.h
index 6d7b420..a023a06 100644
--- a/gtk/gtkcellrendereraccel.h
+++ b/gtk/gtkcellrendereraccel.h
@@ -41,6 +41,7 @@ typedef struct _GtkCellRendererAccelClass GtkCellRendererAccelClass;
* GtkCellRendererAccelMode:
* @GTK_CELL_RENDERER_ACCEL_MODE_GTK: GTK+ accelerators mode
* @GTK_CELL_RENDERER_ACCEL_MODE_OTHER: Other accelerator mode
+ * GTK_CELL_RENDERER_ACCEL_MODE_MODIFIER_TAP: Bare modifiers mode
*
* Determines if the edited accelerators are GTK+ accelerators. If
* they are, consumed modifiers are suppressed, only accelerators
@@ -50,7 +51,8 @@ typedef struct _GtkCellRendererAccelClass GtkCellRendererAccelClass;
typedef enum
{
GTK_CELL_RENDERER_ACCEL_MODE_GTK,
- GTK_CELL_RENDERER_ACCEL_MODE_OTHER
+ GTK_CELL_RENDERER_ACCEL_MODE_OTHER,
+ GTK_CELL_RENDERER_ACCEL_MODE_MODIFIER_TAP
} GtkCellRendererAccelMode;

View File

@ -1,369 +0,0 @@
From: Simon McVittie <smcv@debian.org>
Date: Thu, 18 Jul 2019 09:56:06 +0100
Subject: demos, examples, tests: Don't distribute built files
Signed-off-by: Simon McVittie <smcv@debian.org>
Forwarded: https://gitlab.gnome.org/GNOME/gtk/merge_requests/1001
Bug: https://gitlab.gnome.org/GNOME/gtk/issues/357
---
demos/gtk-demo/Makefile.am | 14 +++++++++-----
demos/icon-browser/Makefile.am | 9 +++++----
demos/widget-factory/Makefile.am | 9 ++++-----
examples/application10/Makefile.am | 4 +++-
examples/application2/Makefile.am | 7 +++++--
examples/application3/Makefile.am | 7 +++++--
examples/application4/Makefile.am | 7 +++++--
examples/application5/Makefile.am | 4 +++-
examples/application6/Makefile.am | 4 +++-
examples/application7/Makefile.am | 4 +++-
examples/application8/Makefile.am | 4 +++-
examples/application9/Makefile.am | 4 +++-
testsuite/css/style/Makefile.am | 5 ++++-
testsuite/gtk/Makefile.am | 4 +++-
14 files changed, 58 insertions(+), 28 deletions(-)
diff --git a/demos/gtk-demo/Makefile.am b/demos/gtk-demo/Makefile.am
index f035c76..444979d 100644
--- a/demos/gtk-demo/Makefile.am
+++ b/demos/gtk-demo/Makefile.am
@@ -133,13 +133,14 @@ demos.h: $(demos) geninclude.pl
demos.h.win32: $(demos_base) geninclude.pl
$(AM_V_GEN) (here=`pwd` ; cd $(srcdir) && $(PERL) $$here/geninclude.pl $(demos_base)) > demos.h.win32
-nodist_gtk3_demo_SOURCES = demos.h
+nodist_gtk3_demo_SOURCES = \
+ demos.h \
+ demo_resources.c
gtk3_demo_SOURCES = \
$(demos) \
gtkfishbowl.c \
gtkfishbowl.h \
- demo_resources.c \
main.c
gtk3_demo_DEPENDENCIES = $(DEPS)
@@ -147,9 +148,12 @@ gtk3_demo_LDADD = $(LDADDS)
gtk3_demo_LDFLAGS = -export-dynamic
gtk3_demo_application_SOURCES = \
- application.c \
+ application.c
+nodist_gtk3_demo_application_SOURCES = \
demo_resources.c
+CLEANFILES = $(BUILT_SOURCES)
+
gtk3_demo_application_LDADD = $(LDADDS)
resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/demo.gresource.xml)
@@ -190,10 +194,10 @@ uninstall-update-icon-cache:
# ------------------- MSVC Build Items ----------------
MSVCPROJS = gtk3-demo gtk3-demo-application
-gtk3_demo_FILES = $(gtk3_demo_SOURCES)
+gtk3_demo_FILES = $(gtk3_demo_SOURCES) $(nodist_gtk3_demo_SOURCES)
gtk3_demo_EXCLUDES = font_features.c|pagesetup.c
-gtk3_demo_application_FILES = $(gtk3_demo_application_SOURCES)
+gtk3_demo_application_FILES = $(gtk3_demo_application_SOURCES) $(nodist_gtk3_demo_application_SOURCES)
gtk3_demo_application_EXCLUDES = dummy
include $(top_srcdir)/build/Makefile.msvcproj
diff --git a/demos/icon-browser/Makefile.am b/demos/icon-browser/Makefile.am
index d5f933b..627b724 100644
--- a/demos/icon-browser/Makefile.am
+++ b/demos/icon-browser/Makefile.am
@@ -20,11 +20,12 @@ gtk3_icon_browser_SOURCES = \
main.c \
iconbrowserapp.c iconbrowserapp.h \
iconbrowserwin.c iconbrowserwin.h \
- iconstore.c iconstore.h \
+ iconstore.c iconstore.h
+nodist_gtk3_icon_browser_SOURCES = \
resources.c
-BUILT_SOURCES = \
- resources.c
+BUILT_SOURCES = $(nodist_gtk3_icon_browser_SOURCES)
+CLEANFILES = $(BUILT_SOURCES)
resources.c: iconbrowser.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/iconbrowser.gresource.xml)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/iconbrowser.gresource.xml \
@@ -40,7 +41,7 @@ EXTRA_DIST = \
# ------------------- MSVC Build Items ----------------
MSVCPROJS = gtk3-icon-browser
-gtk3_icon_browser_FILES = $(gtk3_icon_browser_SOURCES)
+gtk3_icon_browser_FILES = $(gtk3_icon_browser_SOURCES) $(nodist_gtk3_icon_browser_SOURCES)
gtk3_icon_browser_EXCLUDES = dummy
include $(top_srcdir)/build/Makefile.msvcproj
diff --git a/demos/widget-factory/Makefile.am b/demos/widget-factory/Makefile.am
index c33a6d0..a0d6239 100644
--- a/demos/widget-factory/Makefile.am
+++ b/demos/widget-factory/Makefile.am
@@ -5,12 +5,11 @@ bin_PROGRAMS = gtk3-widget-factory
desktopdir = $(datadir)/applications
dist_desktop_DATA = gtk3-widget-factory.desktop
-gtk3_widget_factory_SOURCES = \
- widget-factory.c \
- widget_factory_resources.c
+gtk3_widget_factory_SOURCES = widget-factory.c
+nodist_gtk3_widget_factory_SOURCES = widget_factory_resources.c
-BUILT_SOURCES = \
- widget_factory_resources.c
+BUILT_SOURCES = $(nodist_gtk3_widget_factory_SOURCES)
+CLEANFILES = $(nodist_gtk3_widget_factory_SOURCES)
gtk3_widget_factory_DEPENDENCIES = \
$(top_builddir)/gtk/libgtk-3.la
diff --git a/examples/application10/Makefile.am b/examples/application10/Makefile.am
index c5bda45..355c2c0 100644
--- a/examples/application10/Makefile.am
+++ b/examples/application10/Makefile.am
@@ -16,7 +16,8 @@ exampleapp_SOURCES = \
main.c \
exampleapp.c exampleapp.h \
exampleappwin.c exampleappwin.h \
- exampleappprefs.c exampleappprefs.h \
+ exampleappprefs.c exampleappprefs.h
+nodist_exampleapp_SOURCES = \
resources.c
BUILT_SOURCES = \
@@ -45,6 +46,7 @@ EXTRA_DIST = \
meson.build
CLEANFILES = \
+ $(nodist_exampleapp_SOURCES) \
gschemas.compiled
-include $(top_srcdir)/git.mk
diff --git a/examples/application2/Makefile.am b/examples/application2/Makefile.am
index 8fc0478..964e249 100644
--- a/examples/application2/Makefile.am
+++ b/examples/application2/Makefile.am
@@ -15,10 +15,11 @@ exampleapp_LDADD = $(GTK_LIBS)
exampleapp_SOURCES = \
main.c \
exampleapp.c exampleapp.h \
- exampleappwin.c exampleappwin.h \
+ exampleappwin.c exampleappwin.h
+nodist_exampleapp_SOURCES = \
resources.c
-BUILT_SOURCES = resources.c
+BUILT_SOURCES = $(nodist_exampleapp_SOURCES)
resources.c: exampleapp.gresource.xml window.ui
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/exampleapp.gresource.xml \
@@ -29,4 +30,6 @@ EXTRA_DIST = \
exampleapp.gresource.xml \
meson.build
+CLEANFILES = $(BUILT_SOURCES)
+
-include $(top_srcdir)/git.mk
diff --git a/examples/application3/Makefile.am b/examples/application3/Makefile.am
index 8fc0478..964e249 100644
--- a/examples/application3/Makefile.am
+++ b/examples/application3/Makefile.am
@@ -15,10 +15,11 @@ exampleapp_LDADD = $(GTK_LIBS)
exampleapp_SOURCES = \
main.c \
exampleapp.c exampleapp.h \
- exampleappwin.c exampleappwin.h \
+ exampleappwin.c exampleappwin.h
+nodist_exampleapp_SOURCES = \
resources.c
-BUILT_SOURCES = resources.c
+BUILT_SOURCES = $(nodist_exampleapp_SOURCES)
resources.c: exampleapp.gresource.xml window.ui
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/exampleapp.gresource.xml \
@@ -29,4 +30,6 @@ EXTRA_DIST = \
exampleapp.gresource.xml \
meson.build
+CLEANFILES = $(BUILT_SOURCES)
+
-include $(top_srcdir)/git.mk
diff --git a/examples/application4/Makefile.am b/examples/application4/Makefile.am
index 7bc91ba..c95e6d6 100644
--- a/examples/application4/Makefile.am
+++ b/examples/application4/Makefile.am
@@ -15,10 +15,11 @@ exampleapp_LDADD = $(GTK_LIBS)
exampleapp_SOURCES = \
main.c \
exampleapp.c exampleapp.h \
- exampleappwin.c exampleappwin.h \
+ exampleappwin.c exampleappwin.h
+nodist_exampleapp_SOURCES = \
resources.c
-BUILT_SOURCES = resources.c
+BUILT_SOURCES = $(nodist_exampleapp_SOURCES)
resources.c: exampleapp.gresource.xml window.ui app-menu.ui
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/exampleapp.gresource.xml \
@@ -30,4 +31,6 @@ EXTRA_DIST = \
exampleapp.gresource.xml \
meson.build
+CLEANFILES = $(BUILT_SOURCES)
+
-include $(top_srcdir)/git.mk
diff --git a/examples/application5/Makefile.am b/examples/application5/Makefile.am
index b6f34e7..d195699 100644
--- a/examples/application5/Makefile.am
+++ b/examples/application5/Makefile.am
@@ -15,7 +15,8 @@ exampleapp_LDADD = $(GTK_LIBS)
exampleapp_SOURCES = \
main.c \
exampleapp.c exampleapp.h \
- exampleappwin.c exampleappwin.h \
+ exampleappwin.c exampleappwin.h
+nodist_exampleapp_SOURCES = \
resources.c
BUILT_SOURCES = \
@@ -42,6 +43,7 @@ EXTRA_DIST = \
meson.build
CLEANFILES = \
+ $(nodist_exampleapp_SOURCES) \
gschemas.compiled
-include $(top_srcdir)/git.mk
diff --git a/examples/application6/Makefile.am b/examples/application6/Makefile.am
index 9cf885e..18b9a49 100644
--- a/examples/application6/Makefile.am
+++ b/examples/application6/Makefile.am
@@ -16,7 +16,8 @@ exampleapp_SOURCES = \
main.c \
exampleapp.c exampleapp.h \
exampleappwin.c exampleappwin.h \
- exampleappprefs.c exampleappprefs.h \
+ exampleappprefs.c exampleappprefs.h
+nodist_exampleapp_SOURCES = \
resources.c
BUILT_SOURCES = \
@@ -44,6 +45,7 @@ EXTRA_DIST = \
meson.build
CLEANFILES = \
+ $(nodist_exampleapp_SOURCES) \
gschemas.compiled
-include $(top_srcdir)/git.mk
diff --git a/examples/application7/Makefile.am b/examples/application7/Makefile.am
index 9cf885e..012ddc2 100644
--- a/examples/application7/Makefile.am
+++ b/examples/application7/Makefile.am
@@ -16,7 +16,8 @@ exampleapp_SOURCES = \
main.c \
exampleapp.c exampleapp.h \
exampleappwin.c exampleappwin.h \
- exampleappprefs.c exampleappprefs.h \
+ exampleappprefs.c exampleappprefs.h
+nodist_exampleapp_SOURCES = \
resources.c
BUILT_SOURCES = \
@@ -44,6 +45,7 @@ EXTRA_DIST = \
meson.build
CLEANFILES = \
+ $(nodist_exampleapp_SOURCES) \
gschemas.compiled
-include $(top_srcdir)/git.mk
diff --git a/examples/application8/Makefile.am b/examples/application8/Makefile.am
index c5bda45..355c2c0 100644
--- a/examples/application8/Makefile.am
+++ b/examples/application8/Makefile.am
@@ -16,7 +16,8 @@ exampleapp_SOURCES = \
main.c \
exampleapp.c exampleapp.h \
exampleappwin.c exampleappwin.h \
- exampleappprefs.c exampleappprefs.h \
+ exampleappprefs.c exampleappprefs.h
+nodist_exampleapp_SOURCES = \
resources.c
BUILT_SOURCES = \
@@ -45,6 +46,7 @@ EXTRA_DIST = \
meson.build
CLEANFILES = \
+ $(nodist_exampleapp_SOURCES) \
gschemas.compiled
-include $(top_srcdir)/git.mk
diff --git a/examples/application9/Makefile.am b/examples/application9/Makefile.am
index c5bda45..355c2c0 100644
--- a/examples/application9/Makefile.am
+++ b/examples/application9/Makefile.am
@@ -16,7 +16,8 @@ exampleapp_SOURCES = \
main.c \
exampleapp.c exampleapp.h \
exampleappwin.c exampleappwin.h \
- exampleappprefs.c exampleappprefs.h \
+ exampleappprefs.c exampleappprefs.h
+nodist_exampleapp_SOURCES = \
resources.c
BUILT_SOURCES = \
@@ -45,6 +46,7 @@ EXTRA_DIST = \
meson.build
CLEANFILES = \
+ $(nodist_exampleapp_SOURCES) \
gschemas.compiled
-include $(top_srcdir)/git.mk
diff --git a/testsuite/css/style/Makefile.am b/testsuite/css/style/Makefile.am
index 2ef0e55..57c54b2 100644
--- a/testsuite/css/style/Makefile.am
+++ b/testsuite/css/style/Makefile.am
@@ -25,6 +25,8 @@ test_css_style_LDADD = \
test_css_style_SOURCES = \
test-css-style.c \
+ $(NULL)
+nodist_test_css_style_SOURCES = \
resources.c \
$(NULL)
@@ -39,7 +41,8 @@ test_data = \
nth-child.ui nth-child.css nth-child.nodes \
$(NULL)
-BUILT_SOURCES = resources.c
+BUILT_SOURCES = $(nodist_test_css_style_SOURCES)
+CLEANFILES += $(BUILT_SOURCES)
resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(builddir)/test-css-style.gresource.xml)
diff --git a/testsuite/gtk/Makefile.am b/testsuite/gtk/Makefile.am
index 843a515..b2ef0cf 100644
--- a/testsuite/gtk/Makefile.am
+++ b/testsuite/gtk/Makefile.am
@@ -150,9 +150,11 @@ keyhash_CFLAGS = \
keyhash_SOURCES = \
keyhash.c \
gtkkeyhash.c \
- gtkresources.c \
gtkprivate.c \
$(NULL)
+nodist_keyhash_SOURCES = \
+ gtkresources.c \
+ $(NULL)
gtkkeyhash.c: $(top_srcdir)/gtk/gtkkeyhash.c
$(AM_V_GEN) $(LN_S) $^ $@

View File

@ -1,85 +0,0 @@
From: Simon McVittie <smcv@debian.org>
Date: Wed, 17 Jul 2019 13:54:41 +0100
Subject: gdk: Don't distribute generated files in tarballs
gdkversionmacros.h is generated by configure, so it should be in
DISTCLEANFILES. The rest of $(gdk_built_sources) are built at compile
time by GLib tools, so in principle they should be in CLEANFILES, but
DISTCLEANFILES is close enough.
This is a continuation of the same general topic as commit dad773b1.
Signed-off-by: Simon McVittie <smcv@debian.org>
Forwarded: https://gitlab.gnome.org/GNOME/gtk/merge_requests/1001
Bug: https://gitlab.gnome.org/GNOME/gtk/issues/357
---
gdk/Makefile.am | 29 ++++++-----------------------
1 file changed, 6 insertions(+), 23 deletions(-)
diff --git a/gdk/Makefile.am b/gdk/Makefile.am
index 3635864..c40d0e3 100644
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -203,16 +203,8 @@ nodist_gdkinclude_HEADERS = gdkconfig.h gdkenumtypes.h gdkversionmacros.h
deprecatedincludedir = $(includedir)/gtk-3.0/gdk/deprecated
deprecatedinclude_HEADERS = $(deprecated_h_sources)
-common_sources = \
- $(gdk_private_headers) \
- $(gdk_c_sources) \
- gdkenumtypes.c \
- gdkmarshalers.c \
- gdkmarshalers.h \
- gdkresources.h \
- gdkresources.c
-
-libgdk_3_la_SOURCES = $(common_sources)
+libgdk_3_la_SOURCES = $(gdk_private_headers) $(gdk_c_sources)
+nodist_libgdk_3_la_SOURCES = $(gdk_built_sources)
libgdk_3_la_CFLAGS = $(AM_CFLAGS) $(GDK_HIDDEN_VISIBILITY_CFLAGS)
libgdk_3_la_LIBADD = $(GDK_DEP_LIBS) $(SHM_LIBS)
libgdk_3_la_LDFLAGS = $(LDADD)
@@ -412,10 +404,8 @@ endif
lib_LTLIBRARIES = libgdk-3.la
-MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
-EXTRA_DIST += \
- $(gdk_built_sources) \
- fallback-c89.c
+DISTCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
+EXTRA_DIST += fallback-c89.c
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
@@ -499,7 +489,7 @@ gdkresources.c: gdk.gresource.xml $(resource_files)
# ------------------- MSVC Build Items ----------------
MSVCPROJS = gdk-3
-gdk_3_FILES = $(libgdk_3_la_SOURCES)
+gdk_3_FILES = $(libgdk_3_la_SOURCES) $(nodist_libgdk_3_la_SOURCES)
gdk_3_EXCLUDES = dummy
gdk_3_HEADERS_DIR = $(gdkincludedir)
@@ -553,20 +543,13 @@ dist-hook: \
$(top_builddir)/build/win32/vs9/gdk-3.headers \
$(INTROSPECTION_INTERMEDIATE_ITEMS)
-DISTCLEANFILES = gdkconfig.h stamp-gc-h
+DISTCLEANFILES += gdkconfig.h stamp-gc-h
install-data-local: install-ms-lib install-def-file
uninstall-local: uninstall-ms-lib uninstall-def-file
rm -f $(DESTDIR)$(configexecincludedir)/gdkconfig.h
-# if srcdir!=builddir, clean out maintainer-clean files from builddir
-# this allows dist to pass.
-distclean-local:
- if test $(srcdir) != .; then \
- rm -f $(MAINTAINERCLEANFILES); \
- fi
-
.PHONY: files
files:

View File

@ -1,76 +0,0 @@
From: Simon McVittie <smcv@debian.org>
Date: Thu, 18 Jul 2019 09:48:40 +0100
Subject: gtk: Really don't distribute built files
This is a continuation of commit dad773b1.
Signed-off-by: Simon McVittie <smcv@debian.org>
Forwarded: https://gitlab.gnome.org/GNOME/gtk/merge_requests/1001
Bug: https://gitlab.gnome.org/GNOME/gtk/issues/357
---
gtk/Makefile.am | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 9559595..94cb921 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -554,7 +554,6 @@ gtk_private_h_sources = \
gtkrenderborderprivate.h \
gtkrendericonprivate.h \
gtkrenderprivate.h \
- gtkresources.h \
gtkroundedboxprivate.h \
gtksearchengine.h \
gtksearchenginesimple.h \
@@ -1172,20 +1171,18 @@ gtk_extra_sources = \
#
# setup GTK+ sources and their dependencies
#
-MAINTAINERCLEANFILES = \
+DISTCLEANFILES = \
$(gtk_built_sources) \
$(gtk_dbus_built_sources) \
$(print_portal_built_sources) \
- $(stamp_files)
-
-DISTCLEANFILES = gtktypefuncs.inc
+ $(stamp_files) \
+ gtktypefuncs.inc
if OS_WIN32
DISTCLEANFILES += gtk-win32.rc
endif
EXTRA_DIST += $(gtk_all_private_h_sources) $(gtk_extra_sources)
-EXTRA_DIST += $(gtk_built_sources)
pkgdatadir = $(datadir)/gtk-$(GTK_API_VERSION)
@@ -1456,7 +1453,8 @@ $(srcdir)/gtktestutils.c: gtktypefuncs.inc
lib_LTLIBRARIES = libgtk-3.la
gtkincludedir = $(includedir)/gtk-3.0/gtk
-gtkinclude_HEADERS = $(gtk_public_h_sources) $(gtk_semi_private_h_sources) $(gtk_built_public_sources) gtkversion.h
+gtkinclude_HEADERS = $(gtk_public_h_sources) $(gtk_semi_private_h_sources)
+nodist_gtkinclude_HEADERS = $(gtk_built_public_sources) gtkversion.h
a11yincludedir = $(includedir)/gtk-3.0/gtk/a11y
a11yinclude_HEADERS= $(a11y_h_sources)
@@ -1515,6 +1513,7 @@ gtk_3_HEADERS_DIR = $(gtkincludedir)
gtk_3_HEADERS_INST = \
$(gtkinclude_HEADERS) \
+ $(nodist_gtkinclude_HEADERS) \
$(a11y_h_sources) \
$(deprecated_h_sources)
@@ -1596,7 +1595,7 @@ distclean-local:
fi
if HAVE_INTROSPECTION
-introspected_pub_headers = $(filter-out %private.h gtktextdisplay.h gtktextlayout.h gtkx.h, $(gtkinclude_HEADERS) $(a11yinclude_HEADERS) $(deprecatedinclude_HEADERS))
+introspected_pub_headers = $(filter-out %private.h gtktextdisplay.h gtktextlayout.h gtkx.h, $(gtkinclude_HEADERS) $(a11yinclude_HEADERS) $(deprecatedinclude_HEADERS) $(nodist_gtkinclude_HEADERS))
introspection_files = \
$(introspected_pub_headers) \

View File

@ -1,191 +0,0 @@
From: Lars Uebernickel <lars.uebernickel@canonical.com>
Date: Thu, 23 Oct 2014 10:01:04 -0400
Subject: [PATCH] message dialog: restore traditional look on unity
---
gtk/gtkmessagedialog.c | 60 +++++++++++++++++++++++++++++++++++++++-
gtk/ui/gtkmessagedialog.ui | 18 ++++++++++++
testsuite/a11y/messagedialog.txt | 15 +++++++++-
3 files changed, 91 insertions(+), 2 deletions(-)
diff --git a/gtk/gtkmessagedialog.c b/gtk/gtkmessagedialog.c
index e70c820..ba10f25 100644
--- a/gtk/gtkmessagedialog.c
+++ b/gtk/gtkmessagedialog.c
@@ -104,6 +104,9 @@ struct _GtkMessageDialogPrivate
GtkWidget *label;
GtkWidget *message_area; /* vbox for the primary and secondary labels, and any extra content from the caller */
GtkWidget *secondary_label;
+ GtkWidget *icon;
+ GtkWidget *box;
+ GtkWidget *vbox;
guint has_primary_markup : 1;
guint has_secondary_text : 1;
@@ -300,11 +303,38 @@ gtk_message_dialog_class_init (GtkMessageDialogClass *class)
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/libgtk/ui/gtkmessagedialog.ui");
gtk_widget_class_bind_template_child_private (widget_class, GtkMessageDialog, label);
gtk_widget_class_bind_template_child_private (widget_class, GtkMessageDialog, secondary_label);
+ gtk_widget_class_bind_template_child_private (widget_class, GtkMessageDialog, image);
+ gtk_widget_class_bind_template_child_private (widget_class, GtkMessageDialog, box);
+ gtk_widget_class_bind_template_child_full (widget_class, "dialog-vbox1", FALSE, G_PRIVATE_OFFSET (GtkMessageDialog, vbox));
gtk_widget_class_bind_template_child_internal_private (widget_class, GtkMessageDialog, message_area);
gtk_widget_class_set_css_name (widget_class, "messagedialog");
}
+static gboolean
+in_desktop (const gchar *name)
+{
+ const gchar *desktop_name_list;
+ gchar **names;
+ gboolean in_list = FALSE;
+ gint i;
+
+ desktop_name_list = g_getenv ("XDG_CURRENT_DESKTOP");
+ if (!desktop_name_list)
+ return FALSE;
+
+ names = g_strsplit (desktop_name_list, ":", -1);
+ for (i = 0; names[i] && !in_list; i++)
+ if (strcmp (names[i], name) == 0)
+ {
+ in_list = TRUE;
+ break;
+ }
+ g_strfreev (names);
+
+ return in_list;
+}
+
static void
gtk_message_dialog_init (GtkMessageDialog *dialog)
{
@@ -327,7 +357,25 @@ gtk_message_dialog_init (GtkMessageDialog *dialog)
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
G_GNUC_END_IGNORE_DEPRECATIONS
- gtk_button_box_set_layout (GTK_BUTTON_BOX (action_area), GTK_BUTTONBOX_EXPAND);
+
+ if (in_desktop ("Unity"))
+ {
+ gtk_container_set_border_width (GTK_CONTAINER (dialog), 6);
+
+ gtk_box_set_spacing (GTK_BOX (priv->vbox), 6);
+
+ gtk_container_set_border_width (GTK_CONTAINER (priv->box), 0);
+ gtk_box_set_spacing (GTK_BOX (priv->box), 12);
+ gtk_widget_set_margin_start (priv->box, 12);
+ gtk_widget_set_margin_end (priv->box, 12);
+
+ gtk_widget_set_halign (priv->label, GTK_ALIGN_START);
+ gtk_widget_set_margin_top (priv->label, 0);
+
+ gtk_widget_set_halign (priv->secondary_label, GTK_ALIGN_START);
+ }
+ else
+ gtk_button_box_set_layout (GTK_BUTTON_BOX (action_area), GTK_BUTTONBOX_EXPAND);
settings = gtk_widget_get_settings (GTK_WIDGET (dialog));
g_object_get (settings, "gtk-keynav-use-caret", &use_caret, NULL);
@@ -372,6 +420,7 @@ setup_type (GtkMessageDialog *dialog,
{
GtkMessageDialogPrivate *priv = dialog->priv;
const gchar *name = NULL;
+ const gchar *icon_name = NULL;
AtkObject *atk_obj;
if (priv->message_type == type)
@@ -383,18 +432,22 @@ setup_type (GtkMessageDialog *dialog,
{
case GTK_MESSAGE_INFO:
name = _("Information");
+ icon_name = "dialog-information-symbolic";
break;
case GTK_MESSAGE_QUESTION:
name = _("Question");
+ icon_name = "dialog-question-symbolic";
break;
case GTK_MESSAGE_WARNING:
name = _("Warning");
+ icon_name = "dialog-warning-symbolic";
break;
case GTK_MESSAGE_ERROR:
name = _("Error");
+ icon_name = "dialog-error-symbolic";
break;
case GTK_MESSAGE_OTHER:
@@ -405,6 +458,11 @@ setup_type (GtkMessageDialog *dialog,
break;
}
+ if (icon_name)
+ gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), icon_name, GTK_ICON_SIZE_DIALOG);
+
+ gtk_widget_set_visible (priv->image, icon_name);
+
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (dialog));
if (GTK_IS_ACCESSIBLE (atk_obj))
{
diff --git a/gtk/ui/gtkmessagedialog.ui b/gtk/ui/gtkmessagedialog.ui
index bc3532f..9cd18dd 100644
--- a/gtk/ui/gtkmessagedialog.ui
+++ b/gtk/ui/gtkmessagedialog.ui
@@ -22,6 +22,24 @@
<property name="margin-start">30</property>
<property name="margin-end">30</property>
<property name="spacing">30</property>
+ <child>
+ <object class="GtkImage" id="image">
+ <property name="visible">False</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">start</property>
+ <property name="icon_name">image-missing</property>
+ <property name="use_fallback">True</property>
+ <property name="icon_size">6</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
<object class="GtkBox" id="message_area">
<property name="visible">1</property>
diff --git a/testsuite/a11y/messagedialog.txt b/testsuite/a11y/messagedialog.txt
index af5abf7..871e2be 100644
--- a/testsuite/a11y/messagedialog.txt
+++ b/testsuite/a11y/messagedialog.txt
@@ -75,10 +75,23 @@ window1
<AtkComponent>
layer: widget
alpha: 1
+ image
+ "icon"
+ parent: box
+ index: 0
+ name: Information
+ state: enabled sensitive showing visible
+ toolkit: gtk
+ <AtkComponent>
+ layer: widget
+ alpha: 1
+ <AtkImage>
+ image size: 48 x 48
+ image description: (null)
message_area
"filler"
parent: box
- index: 0
+ index: 1
state: enabled sensitive showing vertical visible
toolkit: gtk
<AtkComponent>

View File

@ -1,33 +0,0 @@
From: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Date: Thu, 13 Dec 2018 18:00:42 -0500
Subject: print-dialog-show-options-of-remote-dnssd-printers
Bug-Upstream: https://bugzilla.gnome.org/show_bug.cgi?id=684533
---
modules/printbackends/cups/gtkprintbackendcups.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c
index 610d688..953cda7 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
@@ -2465,6 +2465,19 @@ cups_create_printer (GtkPrintBackendCups *cups_backend,
&port,
resource, sizeof (resource));
+ if (strncmp (method, "dnssd", 5) == 0)
+ {
+ _httpResolveURI(cups_printer->printer_uri,
+ uri, sizeof(uri), 0, NULL, NULL);
+ httpSeparateURI (HTTP_URI_CODING_ALL,
+ uri,
+ method, sizeof (method),
+ username, sizeof (username),
+ hostname, sizeof (hostname),
+ &port,
+ resource, sizeof (resource));
+ }
+
if (strncmp (resource, "/printers/", 10) == 0)
{
cups_printer->ppd_name = g_strdup (resource + 10);

View File

@ -1,49 +0,0 @@
From: Michael Biebl <biebl@debian.org>
Date: Mon, 2 May 2016 01:18:04 +0200
Subject: Mark known failing tests as non-fatal
Forwarded: no
---
testsuite/reftests/gtk-reftest.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/testsuite/reftests/gtk-reftest.c b/testsuite/reftests/gtk-reftest.c
index 585e1c3..497c979 100644
--- a/testsuite/reftests/gtk-reftest.c
+++ b/testsuite/reftests/gtk-reftest.c
@@ -260,6 +260,20 @@ save_image (cairo_surface_t *surface,
g_free (filename);
}
+static gboolean
+known_fail(const char *test_name)
+{
+ char *filename = get_test_file (test_name, ".ui.known_fail", TRUE);
+
+ if (filename)
+ {
+ g_free (filename);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static void
test_ui_file (GFile *file)
{
@@ -292,7 +306,13 @@ test_ui_file (GFile *file)
if (diff_image)
{
save_image (diff_image, ui_file, ".diff.png");
- g_test_fail ();
+ if (known_fail(ui_file))
+ {
+ printf("KNOWN FAIL: ");
+ g_test_message ("KNOWN FAIL: %s", ui_file);
+ }
+ else
+ g_test_fail ();
}
remove_extra_css (provider);

21
debian/patches/series vendored
View File

@ -1,21 +0,0 @@
updateiconcache-Sort-list-of-entries.patch
gdk-Don-t-distribute-generated-files-in-tarballs.patch
gtk-Really-don-t-distribute-built-files.patch
demos-examples-tests-Don-t-distribute-built-files.patch
016_no_offscreen_widgets_grabbing.patch
017_no_offscreen_device_grabbing.patch
060_ignore-random-icons.patch
reftest-known-fail.patch
Disable-accessibility-dump-aka-a11ytests-test.patch
073_treeview_almost_fixed.patch
bzg_gtkcellrenderer_grabbing_modifier.patch
ubuntu_gtk_custom_menu_items.patch
print-dialog-show-options-of-remote-dnssd-printers.patch
uimanager-guard-against-nested-node-updates.patch
x-canonical-accel.patch
message-dialog-restore-traditional-look-on-unity.patch
0001-gtk-reftest-Force-icon-theme-to-Adwaita.patch
0001-calendar-always-emit-day-selected-once.patch
0001-gtkwindow-set-transparent-background-color.patch
unity-border-radius.patch
unity-headerbar-maximized-mode.patch

View File

@ -1,358 +0,0 @@
From: Lars Uebernickel <lars.uebernickel@canonical.com>
Date: Wed, 6 Nov 2013 14:48:19 +0100
Subject: [PATCH] Add UbuntuMenuItemFactory
UbuntuMenuItemFactory is an interface for creating widgets for menu
items in a GMenuModel that have an 'x-canonical-type' attribute.
It is needed by unity and should not be considered public API.
---
gtk/Makefile.am | 3 ++
gtk/gtkmenushell.c | 69 ++++++++++++++++++++++++++++++++++++++++++++
gtk/gtkmenutrackeritem.c | 16 +++++++++++
gtk/gtkmenutrackeritem.h | 4 +++
gtk/ubuntu-private.h | 32 +++++++++++++++++++++
gtk/ubuntumenuitemfactory.c | 70 +++++++++++++++++++++++++++++++++++++++++++++
gtk/ubuntumenuitemfactory.h | 61 +++++++++++++++++++++++++++++++++++++++
7 files changed, 255 insertions(+)
create mode 100644 gtk/ubuntu-private.h
create mode 100644 gtk/ubuntumenuitemfactory.c
create mode 100644 gtk/ubuntumenuitemfactory.h
Index: gtk+3.0-3.24.17/gtk/Makefile.am
===================================================================
--- gtk+3.0-3.24.17.orig/gtk/Makefile.am
+++ gtk+3.0-3.24.17/gtk/Makefile.am
@@ -122,6 +122,8 @@ include $(srcdir)/inspector/Makefile.inc
gtk_public_h_sources = \
gtk.h \
gtk-autocleanups.h \
+ ubuntu-private.h \
+ ubuntumenuitemfactory.h \
gtkx.h \
gtkx-autocleanups.h \
gtk-a11y.h \
@@ -610,6 +612,7 @@ gtk_base_c_sources = \
$(a11y_c_sources) \
$(deprecated_c_sources) \
$(inspector_c_sources) \
+ ubuntumenuitemfactory.c \
gtkactionmuxer.c \
gtkactionobserver.c \
gtkactionobservable.c \
Index: gtk+3.0-3.24.17/gtk/gtkmenushell.c
===================================================================
--- gtk+3.0-3.24.17.orig/gtk/gtkmenushell.c
+++ gtk+3.0-3.24.17/gtk/gtkmenushell.c
@@ -81,6 +81,8 @@
#include "a11y/gtkmenushellaccessible.h"
+#include "ubuntu-private.h"
+
#define MENU_SHELL_TIMEOUT 500
#define MENU_POPUP_DELAY 225
@@ -2048,6 +2050,58 @@ gtk_menu_shell_tracker_remove_func (gint
gtk_widget_destroy (child);
}
+static GtkWidget *
+create_custom_menu_item (GMenuItem *item,
+ GtkWidget *parent,
+ const gchar *action_namespace)
+{
+ gchar *type;
+ GActionGroup *actions;
+ GtkMenuItem *widget = NULL;
+ GList *it;
+
+ g_menu_item_get_attribute (item, "x-canonical-type", "s", &type);
+
+ if (action_namespace)
+ {
+ gchar *action;
+
+ /* Rewrite the menu item to include the fully qualified action
+ * name to make writing widgets easier. This won't break, as
+ * we don't use the tracker item for custom items.
+ */
+ if (g_menu_item_get_attribute (item, "action", "s", &action))
+ {
+ gchar *fullname;
+
+ fullname = g_strconcat (action_namespace, ".", action, NULL);
+ g_menu_item_set_attribute (item, "action", "s", fullname);
+
+ g_free (fullname);
+ g_free (action);
+ }
+ }
+
+ /* Passing the parent muxer is wrong, but we'll only have access
+ * to the menuitem's muxer after the widget has been created.
+ * Thus we'd need some other form of passing the action group to
+ * the widget, which would complicate things for no practical
+ * reason: the panel service is the only consumer of this API and
+ * it will never call gtk_widget_insert_action_group() on the
+ * returned menu item.
+ */
+ actions = G_ACTION_GROUP (_gtk_widget_get_action_muxer (parent, TRUE));
+
+ for (it = ubuntu_menu_item_factory_get_all (); it != NULL && widget == NULL; it = it->next)
+ widget = ubuntu_menu_item_factory_create_menu_item (it->data, type, item, actions);
+
+ if (widget == NULL)
+ g_warning ("Cannot create custom menu item of type '%s'", type);
+
+ g_free (type);
+ return GTK_WIDGET (widget);
+}
+
static void
gtk_menu_shell_tracker_insert_func (GtkMenuTrackerItem *item,
gint position,
@@ -2055,6 +2109,9 @@ gtk_menu_shell_tracker_insert_func (GtkM
{
GtkMenuShell *menu_shell = user_data;
GtkWidget *widget;
+ GMenuItem *menuitem;
+
+ menuitem = gtk_menu_tracker_item_get_menu_item (item);
if (gtk_menu_tracker_item_get_is_separator (item))
{
@@ -2116,6 +2173,18 @@ gtk_menu_shell_tracker_insert_func (GtkM
gtk_widget_show (widget);
}
+ else if (g_menu_item_get_attribute (menuitem, "x-canonical-type", "s", NULL))
+ {
+ const gchar *namespace;
+
+ namespace = gtk_menu_tracker_item_get_action_namespace (item);
+ widget = create_custom_menu_item (menuitem, GTK_WIDGET (menu_shell), namespace);
+
+ if (widget == NULL)
+ return;
+
+ gtk_widget_show (widget);
+ }
else
{
widget = gtk_model_menu_item_new ();
Index: gtk+3.0-3.24.17/gtk/gtkmenutrackeritem.c
===================================================================
--- gtk+3.0-3.24.17.orig/gtk/gtkmenutrackeritem.c
+++ gtk+3.0-3.24.17/gtk/gtkmenutrackeritem.c
@@ -990,3 +990,19 @@ gtk_menu_tracker_item_may_disappear (Gtk
{
return self->hidden_when != HIDDEN_NEVER;
}
+
+GMenuItem *
+gtk_menu_tracker_item_get_menu_item (GtkMenuTrackerItem *self)
+{
+ g_return_val_if_fail (GTK_IS_MENU_TRACKER_ITEM (self), NULL);
+
+ return self->item;
+}
+
+const gchar *
+gtk_menu_tracker_item_get_action_namespace (GtkMenuTrackerItem *self)
+{
+ g_return_val_if_fail (GTK_IS_MENU_TRACKER_ITEM (self), NULL);
+
+ return self->action_namespace;
+}
Index: gtk+3.0-3.24.17/gtk/gtkmenutrackeritem.h
===================================================================
--- gtk+3.0-3.24.17.orig/gtk/gtkmenutrackeritem.h
+++ gtk+3.0-3.24.17/gtk/gtkmenutrackeritem.h
@@ -94,4 +94,8 @@ void gtk_menu_tracker
gboolean gtk_menu_tracker_item_get_submenu_shown (GtkMenuTrackerItem *self);
+GMenuItem * gtk_menu_tracker_item_get_menu_item (GtkMenuTrackerItem *self);
+
+const gchar * gtk_menu_tracker_item_get_action_namespace (GtkMenuTrackerItem *self);
+
#endif
Index: gtk+3.0-3.24.17/gtk/ubuntu-private.h
===================================================================
--- /dev/null
+++ gtk+3.0-3.24.17/gtk/ubuntu-private.h
@@ -0,0 +1,32 @@
+/*
+* Copyright 2013 Canonical Ltd.
+*
+* This program is free software: you can redistribute it and/or modify it
+* under the terms of the GNU General Public License version 3, as published
+* by the Free Software Foundation.
+*
+* This program is distributed in the hope that it will be useful, but
+* WITHOUT ANY WARRANTY; without even the implied warranties of
+* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
+* PURPOSE. See the GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License along
+* with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+* Authors:
+* Lars Uebernickel <lars.uebernickel@canonical.com>
+*/
+
+/*
+ * Warning: this file is not part of gtk+, but an Ubuntu-specific extension.
+ * The API provided here is meant to be used only from Unity.
+ *
+ * Applications should not use this.
+ */
+
+#ifndef __UBUNTU_PRIVATE_H__
+#define __UBUNTU_PRIVATE_H__
+
+#include "ubuntumenuitemfactory.h"
+
+#endif
Index: gtk+3.0-3.24.17/gtk/ubuntumenuitemfactory.c
===================================================================
--- /dev/null
+++ gtk+3.0-3.24.17/gtk/ubuntumenuitemfactory.c
@@ -0,0 +1,70 @@
+/*
+* Copyright 2013 Canonical Ltd.
+*
+* This program is free software: you can redistribute it and/or modify it
+* under the terms of the GNU General Public License version 3, as published
+* by the Free Software Foundation.
+*
+* This program is distributed in the hope that it will be useful, but
+* WITHOUT ANY WARRANTY; without even the implied warranties of
+* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
+* PURPOSE. See the GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License along
+* with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+* Authors:
+* Lars Uebernickel <lars.uebernickel@canonical.com>
+*/
+
+#include "config.h"
+#include "ubuntumenuitemfactory.h"
+
+G_DEFINE_INTERFACE_WITH_CODE (UbuntuMenuItemFactory, ubuntu_menu_item_factory, G_TYPE_OBJECT,
+ GIOExtensionPoint *ep = g_io_extension_point_register (UBUNTU_MENU_ITEM_FACTORY_EXTENSION_POINT_NAME);
+ g_io_extension_point_set_required_type (ep, g_define_type_id);)
+
+/*
+ * ubuntu_menu_item_factory_get_all:
+ *
+ * Returns a static list of all registered factories.
+ */
+GList *
+ubuntu_menu_item_factory_get_all (void)
+{
+ static GList *factories = NULL;
+
+ if (factories == NULL)
+ {
+ GIOExtensionPoint *ep;
+ GList *it;
+
+ g_type_ensure (UBUNTU_TYPE_MENU_ITEM_FACTORY);
+ ep = g_io_extension_point_lookup (UBUNTU_MENU_ITEM_FACTORY_EXTENSION_POINT_NAME);
+ for (it = g_io_extension_point_get_extensions (ep); it != NULL; it = it->next)
+ {
+ GIOExtension *ext = it->data;
+ UbuntuMenuItemFactory *factory;
+
+ factory = g_object_new (g_io_extension_get_type (ext), NULL);
+ factories = g_list_prepend (factories, factory);
+ }
+ factories = g_list_reverse (factories);
+ }
+
+ return factories;
+}
+
+static void
+ubuntu_menu_item_factory_default_init (UbuntuMenuItemFactoryInterface *iface)
+{
+}
+
+GtkMenuItem *
+ubuntu_menu_item_factory_create_menu_item (UbuntuMenuItemFactory *factory,
+ const gchar *type,
+ GMenuItem *menuitem,
+ GActionGroup *actions)
+{
+ return UBUNTU_MENU_ITEM_FACTORY_GET_IFACE (factory)->create_menu_item (factory, type, menuitem, actions);
+}
Index: gtk+3.0-3.24.17/gtk/ubuntumenuitemfactory.h
===================================================================
--- /dev/null
+++ gtk+3.0-3.24.17/gtk/ubuntumenuitemfactory.h
@@ -0,0 +1,61 @@
+/*
+* Copyright 2013 Canonical Ltd.
+*
+* This program is free software: you can redistribute it and/or modify it
+* under the terms of the GNU General Public License version 3, as published
+* by the Free Software Foundation.
+*
+* This program is distributed in the hope that it will be useful, but
+* WITHOUT ANY WARRANTY; without even the implied warranties of
+* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
+* PURPOSE. See the GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License along
+* with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+* Authors:
+* Lars Uebernickel <lars.uebernickel@canonical.com>
+*/
+
+#ifndef __UBUNTU_MENU_ITEM_FACTORY_H__
+#define __UBUNTU_MENU_ITEM_FACTORY_H__
+
+#include <gtk/gtkmenuitem.h>
+
+G_BEGIN_DECLS
+
+#define UBUNTU_TYPE_MENU_ITEM_FACTORY (ubuntu_menu_item_factory_get_type ())
+#define UBUNTU_MENU_ITEM_FACTORY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UBUNTU_TYPE_MENU_ITEM_FACTORY, UbuntuMenuItemFactory))
+#define UBUNTU_IS_MENU_ITEM_FACTORY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), UBUNTU_TYPE_MENU_ITEM_FACTORY))
+#define UBUNTU_MENU_ITEM_FACTORY_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), UBUNTU_TYPE_MENU_ITEM_FACTORY, UbuntuMenuItemFactoryInterface))
+
+#define UBUNTU_MENU_ITEM_FACTORY_EXTENSION_POINT_NAME "ubuntu-menu-item-factory"
+
+typedef struct _UbuntuMenuItemFactoryInterface UbuntuMenuItemFactoryInterface;
+typedef struct _UbuntuMenuItemFactory UbuntuMenuItemFactory;
+
+struct _UbuntuMenuItemFactoryInterface
+{
+ GTypeInterface iface;
+
+ GtkMenuItem * (*create_menu_item) (UbuntuMenuItemFactory *factory,
+ const gchar *type,
+ GMenuItem *menuitem,
+ GActionGroup *actions);
+};
+
+GDK_AVAILABLE_IN_3_10
+GList * ubuntu_menu_item_factory_get_all (void);
+
+GDK_AVAILABLE_IN_3_10
+GType ubuntu_menu_item_factory_get_type (void);
+
+GDK_AVAILABLE_IN_3_10
+GtkMenuItem * ubuntu_menu_item_factory_create_menu_item (UbuntuMenuItemFactory *factory,
+ const gchar *type,
+ GMenuItem *menuitem,
+ GActionGroup *actions);
+
+G_END_DECLS
+
+#endif

View File

@ -1,63 +0,0 @@
From: Michael Terry <michael.terry@canonical.com>
Date: Wed, 6 Nov 2013 16:50:23 +0100
Subject: [PATCH] GtkUIManager: guard against nested node updates
https://bugzilla.gnome.org/show_bug.cgi?id=686174
---
gtk/deprecated/gtkuimanager.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/gtk/deprecated/gtkuimanager.c b/gtk/deprecated/gtkuimanager.c
index 160a9f7..094757b 100644
--- a/gtk/deprecated/gtkuimanager.c
+++ b/gtk/deprecated/gtkuimanager.c
@@ -329,6 +329,7 @@ struct _GtkUIManagerPrivate
GList *action_groups;
guint last_merge_id;
+ guint last_update_id;
guint update_tag;
@@ -2552,6 +2553,7 @@ update_node (GtkUIManager *manager,
GtkAction *action;
const gchar *action_name;
NodeUIReference *ref;
+ guint update_id;
g_return_if_fail (node != NULL);
g_return_if_fail (NODE_INFO (node) != NULL);
@@ -2561,6 +2563,8 @@ update_node (GtkUIManager *manager,
if (!info->dirty)
return;
+ update_id = manager->private_data->last_update_id;
+
if (info->type == NODE_TYPE_POPUP)
{
in_popup = TRUE;
@@ -3075,6 +3079,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS
current = child;
child = current->next;
update_node (manager, current, in_popup, popup_accels);
+ if (manager->private_data->last_update_id != update_id)
+ return; /* stop now if we have started a new update */
}
if (info->proxy)
@@ -3090,6 +3096,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
/* handle cleanup of dead nodes */
if (node->children == NULL && info->uifiles == NULL)
{
+ g_node_unlink (node);
if (info->proxy)
gtk_widget_destroy (info->proxy);
if (info->extra)
@@ -3116,6 +3123,7 @@ do_updates (GtkUIManager *manager)
* the proxy is reconnected to the new action (or a new proxy widget
* is created and added to the parent container).
*/
+ manager->private_data->last_update_id++;
update_node (manager, manager->private_data->root_node, FALSE, FALSE);
manager->private_data->update_tag = 0;

View File

@ -1,278 +0,0 @@
From: Marco Trevisan <marco.trevisan@canonical.com>
Date: Thu, 13 Dec 2018 18:00:43 -0500
Subject: Export windows corners radius in the _UNITY_GTK_BORDER_RADIUS
X11 property when such feature is supported by WM (so just in unity).
This has to be removed when compiz will natively support _GTK_FRAME_EXTENTS
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1516403
---
gtk/gtkwindow.c | 158 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 152 insertions(+), 6 deletions(-)
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 2ae56a0..4e91812 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -255,6 +255,7 @@ struct _GtkWindowPrivate
guint csd_requested : 1;
guint client_decorated : 1; /* Decorations drawn client-side */
guint use_client_shadow : 1; /* Decorations use client-side shadows */
+ guint use_unity_border_radius : 1; /* Unity border radius is supported */
guint maximized : 1;
guint fullscreen : 1;
guint tiled : 1;
@@ -4084,6 +4085,119 @@ gtk_window_set_geometry_hints (GtkWindow *window,
gtk_widget_queue_resize_no_redraw (GTK_WIDGET (window));
}
+static void
+unity_border_radius_update (GtkWindow *window)
+{
+#ifdef GDK_WINDOWING_X11
+ Atom border_radius;
+ GtkWindowPrivate *priv;
+ GtkStyleContext *context;
+ GdkDisplay *display;
+ GdkWindow *gdk_window;
+
+ enum { TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT };
+ gulong corners[4] = {0};
+
+ priv = window->priv;
+ context = NULL;
+
+ if (!gtk_widget_get_realized (GTK_WIDGET (window)))
+ return;
+
+ if (priv->type == GTK_WINDOW_POPUP)
+ {
+ context = gtk_widget_get_style_context (GTK_WIDGET (window));
+ }
+ else if (priv->title_box)
+ {
+ context = gtk_widget_get_style_context (priv->title_box);
+ }
+
+ if (context)
+ {
+ corners[TOP_LEFT] = round (_gtk_css_corner_value_get_x (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_LEFT_RADIUS), 100) * priv->scale);
+ corners[TOP_RIGHT] = round (_gtk_css_corner_value_get_x (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_RIGHT_RADIUS), 100) * priv->scale);
+
+ /* Bottom corners radius is not controlled by title box, and we can
+ * assume it's always 0 for such windows. */
+
+ if (priv->type == GTK_WINDOW_POPUP)
+ {
+ corners[BOTTOM_LEFT] = round (_gtk_css_corner_value_get_x (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_BOTTOM_LEFT_RADIUS), 100) * priv->scale);
+ corners[BOTTOM_RIGHT] = round (_gtk_css_corner_value_get_x (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_BOTTOM_RIGHT_RADIUS), 100) * priv->scale);
+ }
+ }
+
+ gdk_window = _gtk_widget_get_window (GTK_WIDGET (window));
+ display = gdk_window_get_display (gdk_window);
+ border_radius = gdk_x11_get_xatom_by_name_for_display (display,
+ "_UNITY_GTK_BORDER_RADIUS");
+
+ if (priv->client_decorated)
+ {
+ XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
+ GDK_WINDOW_XID (gdk_window),
+ border_radius,
+ gdk_x11_get_xatom_by_name_for_display (display, "CARDINAL"),
+ 32, PropModeReplace,
+ (guchar *) &corners, G_N_ELEMENTS (corners));
+ }
+ else
+ {
+ XDeleteProperty (GDK_DISPLAY_XDISPLAY (display),
+ GDK_WINDOW_XID (gdk_window),
+ border_radius);
+ }
+#endif
+}
+
+static void
+on_decoration_style_changed (GtkWidget *widget,
+ GtkWindow *window)
+{
+ GtkStyleContext *context = gtk_widget_get_style_context (widget);
+ const GtkBitmask *change = gtk_style_context_get_change (context);
+
+ if (!change || !gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_BORDER))
+ return;
+
+ unity_border_radius_update (window);
+}
+
+static void
+on_window_scale_changed (GtkWidget *widget,
+ GParamSpec *pspec,
+ GtkWindow *window)
+{
+ unity_border_radius_update (window);
+}
+
+static void
+unity_border_radius_update_and_monitor (GtkWindow *window, GtkWidget *widget)
+{
+ if (!window->priv->use_unity_border_radius)
+ return;
+
+ g_signal_connect (widget, "style-updated", G_CALLBACK (on_decoration_style_changed), window);
+ unity_border_radius_update (window);
+}
+
+static gboolean
+unity_border_radius_is_supported (GtkWindow *window)
+{
+#ifdef GDK_WINDOWING_X11
+ GdkScreen *screen = _gtk_window_get_screen (window);
+
+ if (GDK_IS_X11_SCREEN (screen))
+ {
+ GdkAtom unity_atom = gdk_atom_intern_static_string ("_UNITY_GTK_BORDER_RADIUS");
+ return gdk_x11_screen_supports_net_wm_hint (screen, unity_atom);
+ }
+#endif
+
+ return FALSE;
+}
+
static void
unset_titlebar (GtkWindow *window)
{
@@ -4094,6 +4208,9 @@ unset_titlebar (GtkWindow *window)
g_signal_handlers_disconnect_by_func (priv->title_box,
on_titlebar_title_notify,
window);
+ g_signal_handlers_disconnect_by_func (priv->title_box,
+ on_decoration_style_changed,
+ window);
gtk_widget_unparent (priv->title_box);
priv->title_box = NULL;
priv->titlebar = NULL;
@@ -4150,13 +4267,16 @@ gtk_window_enable_csd (GtkWindow *window)
GdkVisual *visual;
/* We need a visual with alpha for client shadows */
- if (priv->use_client_shadow)
+ if (priv->use_client_shadow || priv->use_unity_border_radius)
{
visual = gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget));
if (visual != NULL)
gtk_widget_set_visual (widget, visual);
gtk_style_context_add_class (gtk_widget_get_style_context (widget), GTK_STYLE_CLASS_CSD);
+
+ if (priv->use_unity_border_radius)
+ gtk_style_context_add_class (gtk_widget_get_style_context (widget), "unity-csd");
}
else
{
@@ -4164,6 +4284,9 @@ gtk_window_enable_csd (GtkWindow *window)
}
priv->client_decorated = TRUE;
+
+ if (priv->use_unity_border_radius)
+ unity_border_radius_update (window);
}
static void
@@ -4224,10 +4347,14 @@ gtk_window_set_titlebar (GtkWindow *window,
priv->client_decorated = FALSE;
gtk_style_context_remove_class (gtk_widget_get_style_context (widget), GTK_STYLE_CLASS_CSD);
+ if (priv->use_unity_border_radius)
+ unity_border_radius_update (window);
+
goto out;
}
priv->use_client_shadow = gtk_window_supports_client_shadow (window);
+ priv->use_unity_border_radius = unity_border_radius_is_supported (window);
gtk_window_enable_csd (window);
priv->title_box = titlebar;
@@ -4239,6 +4366,8 @@ gtk_window_set_titlebar (GtkWindow *window,
on_titlebar_title_notify (GTK_HEADER_BAR (titlebar), NULL, window);
}
+ unity_border_radius_update_and_monitor (window, titlebar);
+
gtk_style_context_add_class (gtk_widget_get_style_context (titlebar),
GTK_STYLE_CLASS_TITLEBAR);
@@ -6141,13 +6270,19 @@ create_decoration (GtkWidget *widget)
GtkWindowPrivate *priv = window->priv;
priv->use_client_shadow = gtk_window_supports_client_shadow (window);
- if (!priv->use_client_shadow)
+ priv->use_unity_border_radius = unity_border_radius_is_supported (window);
+
+ if (!priv->use_client_shadow && !priv->use_unity_border_radius)
return;
gtk_window_enable_csd (window);
-
if (priv->type == GTK_WINDOW_POPUP)
- return;
+ {
+ if (priv->csd_requested)
+ unity_border_radius_update_and_monitor (window, widget);
+
+ return;
+ }
if (priv->title_box == NULL)
{
@@ -6155,6 +6290,8 @@ create_decoration (GtkWidget *widget)
gtk_widget_set_parent (priv->titlebar, widget);
gtk_widget_show_all (priv->titlebar);
priv->title_box = priv->titlebar;
+
+ unity_border_radius_update_and_monitor (window, priv->title_box);
}
update_window_buttons (window);
@@ -6809,6 +6946,9 @@ get_shadow_width (GtkWindow *window,
if (!priv->decorated)
return;
+ if (priv->client_decorated && priv->use_unity_border_radius)
+ return;
+
if (!priv->client_decorated &&
!(gtk_window_should_use_csd (window) &&
gtk_window_supports_client_shadow (window)))
@@ -7511,7 +7651,7 @@ gtk_window_realize (GtkWidget *widget)
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
- if (priv->client_decorated && priv->type == GTK_WINDOW_TOPLEVEL)
+ if (priv->client_decorated && priv->type == GTK_WINDOW_TOPLEVEL && !priv->use_unity_border_radius)
{
const gchar *cursor[8] = {
"nw-resize", "n-resize", "ne-resize",
@@ -7603,6 +7743,12 @@ gtk_window_realize (GtkWidget *widget)
}
#endif
+ if (priv->use_unity_border_radius)
+ {
+ g_signal_connect (window, "notify::scale-factor", G_CALLBACK (on_window_scale_changed), window);
+ unity_border_radius_update (window);
+ }
+
child_allocation.x = 0;
child_allocation.y = 0;
child_allocation.width = allocation.width;
@@ -11214,7 +11360,7 @@ gtk_window_set_screen (GtkWindow *window,
}
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_SCREEN]);
- if (was_rgba && priv->use_client_shadow)
+ if (was_rgba && (priv->use_client_shadow || priv->use_unity_border_radius))
{
GdkVisual *visual;

View File

@ -1,132 +0,0 @@
From: Marco Trevisan <marco.trevisan@canonical.com>
Date: Thu, 13 Dec 2018 18:00:43 -0500
Subject: Hide Headerbar window buttons and title when running in Unity
and the window is maximized.
Plus define the "toolbar-mode" style class on these maximized bars.
Bug-Ubuntu: https://launchpad.net/bugs/1515810
---
gtk/gtkheaderbar.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 66 insertions(+), 2 deletions(-)
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c
index 39e81b4..1651eb2 100644
--- a/gtk/gtkheaderbar.c
+++ b/gtk/gtkheaderbar.c
@@ -34,6 +34,10 @@
#include <string.h>
+#ifdef GDK_WINDOWING_X11
+#include "x11/gdkx.h"
+#endif
+
/**
* SECTION:gtkheaderbar
* @Short_description: A box with a centered child
@@ -72,6 +76,7 @@ struct _GtkHeaderBarPrivate
GtkWidget *custom_title;
gint spacing;
gboolean has_subtitle;
+ gboolean unity_environment;
GList *children;
@@ -267,6 +272,35 @@ _gtk_header_bar_update_separator_visibility (GtkHeaderBar *bar)
gtk_widget_set_visible (priv->titlebar_end_separator, have_visible_at_end);
}
+static void
+check_title_visibility (GtkHeaderBar *bar)
+{
+ GtkHeaderBarPrivate *priv = gtk_header_bar_get_instance_private (bar);
+ gboolean visible = TRUE;
+
+ if (!priv->title_label)
+ return;
+
+ if (priv->unity_environment)
+ {
+ GtkWidget *widget = GTK_WIDGET (bar);
+ GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
+
+ if (GTK_IS_WINDOW (toplevel))
+ {
+ GtkWindow *window = GTK_WINDOW (toplevel);
+
+ if (gtk_window_is_maximized (window) &&
+ gtk_window_get_titlebar (window) == widget)
+ {
+ visible = FALSE;
+ }
+ }
+ }
+
+ gtk_widget_set_visible (priv->title_label, visible);
+}
+
void
_gtk_header_bar_update_window_buttons (GtkHeaderBar *bar)
{
@@ -299,6 +333,20 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar)
}
priv->titlebar_icon = NULL;
+ window = GTK_WINDOW (toplevel);
+
+ if (priv->unity_environment)
+ {
+ check_title_visibility (bar);
+
+ if (gtk_window_is_maximized (window))
+ {
+ gtk_style_context_add_class (gtk_widget_get_style_context (widget), "toolbar-mode");
+ return;
+ }
+
+ gtk_style_context_remove_class (gtk_widget_get_style_context (widget), "toolbar-mode");
+ }
if (!priv->shows_wm_decorations)
return;
@@ -316,8 +364,6 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar)
layout_desc = g_strdup (priv->decoration_layout);
}
- window = GTK_WINDOW (toplevel);
-
if (!shown_by_shell && gtk_window_get_application (window))
menu = gtk_application_get_app_menu (gtk_window_get_application (window));
else
@@ -588,6 +634,8 @@ construct_label_box (GtkHeaderBar *bar)
&priv->subtitle_label);
gtk_header_bar_reorder_css_node (bar, GTK_PACK_START, priv->label_box);
gtk_widget_set_parent (priv->label_box, GTK_WIDGET (bar));
+
+ check_title_visibility (bar);
}
static gint
@@ -1908,6 +1956,22 @@ gtk_header_bar_realize (GtkWidget *widget)
GTK_WIDGET_CLASS (gtk_header_bar_parent_class)->realize (widget);
+#ifdef GDK_WINDOWING_X11
+ GtkHeaderBar *bar;
+ GtkHeaderBarPrivate *priv;
+ GdkScreen *screen;
+
+ bar = GTK_HEADER_BAR (widget);
+ priv = gtk_header_bar_get_instance_private (bar);
+ screen = gtk_widget_get_screen (widget);
+
+ if (GDK_IS_X11_SCREEN (screen))
+ {
+ GdkAtom unity_atom = gdk_atom_intern_static_string ("_UNITY_SHELL");
+ priv->unity_environment = gdk_x11_screen_supports_net_wm_hint (screen, unity_atom);
+ }
+#endif
+
settings = gtk_widget_get_settings (widget);
g_signal_connect_swapped (settings, "notify::gtk-shell-shows-app-menu",
G_CALLBACK (_gtk_header_bar_update_window_buttons), widget);

View File

@ -1,50 +0,0 @@
From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
Date: Wed, 15 Aug 2018 03:11:21 +0200
Subject: updateiconcache: Sort list of entries
because filesystem readdir order is indeterministic.
Without this patch, building openSUSE's balsa package
had variations between builds in /usr/share/balsa/icon-theme.cache
Forwarded: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/297
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=953105
Applied-upstream: 3.96.0, commit:b364827a5b99e3b02862f36be4c03826e72aefba
---
gtk/updateiconcache.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/gtk/updateiconcache.c b/gtk/updateiconcache.c
index b48eaca..6703c8b 100644
--- a/gtk/updateiconcache.c
+++ b/gtk/updateiconcache.c
@@ -600,6 +600,7 @@ scan_directory (const gchar *base_path,
{
GHashTable *dir_hash;
GDir *dir;
+ GList *list = NULL, *iterator = NULL;
const gchar *name;
gchar *dir_path;
gboolean dir_added = FALSE;
@@ -617,6 +618,13 @@ scan_directory (const gchar *base_path,
while ((name = g_dir_read_name (dir)))
{
+ list = g_list_prepend (list, g_strdup (name));
+ }
+ list = g_list_sort (list, (GCompareFunc) strcmp);
+ for (iterator = list; iterator; iterator = iterator->next)
+ {
+ name = iterator->data;
+
gchar *path;
gboolean retval;
int flags = 0;
@@ -695,6 +703,7 @@ scan_directory (const gchar *base_path,
g_free (path);
}
+ g_list_free_full (list, g_free);
g_dir_close (dir);
/* Move dir into the big file hash */

View File

@ -1,225 +0,0 @@
From: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Date: Thu, 13 Dec 2018 18:00:42 -0500
Subject: Allow setting menu item accelerator text directly
Add a custom GMenuItem attribute called "x-canonical-accel" that
allows the accelerator text to be set directly without needing a
key code and modifier. We need this because sometimes all we have
is the translated accelerator text, and parsing this is difficult
considering the user's language may not be English.
Author: William Hua <william.hua@canonical.com>
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1208019
---
gtk/gtkaccellabel.c | 20 ++++++++++++++++++++
gtk/gtkmenushell.c | 1 +
gtk/gtkmenutrackeritem.c | 16 ++++++++++++++++
gtk/gtkmenutrackeritem.h | 2 ++
gtk/gtkmodelmenuitem.c | 45 ++++++++++++++++++++++++++++++++++++++++++++-
5 files changed, 83 insertions(+), 1 deletion(-)
diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c
index 0e2c50b..40d4981 100644
--- a/gtk/gtkaccellabel.c
+++ b/gtk/gtkaccellabel.c
@@ -127,6 +127,8 @@ struct _GtkAccelLabelPrivate
guint accel_key; /* manual accel key specification if != 0 */
GdkModifierType accel_mods;
+
+ gchar *accel_text; /* already-translated accel_string */
};
GParamSpec *props[LAST_PROP] = { NULL, };
@@ -294,6 +296,7 @@ gtk_accel_label_init (GtkAccelLabel *accel_label)
priv->accel_closure = NULL;
priv->accel_group = NULL;
priv->accel_string = NULL;
+ priv->accel_text = NULL;
widget_node = gtk_widget_get_css_node (GTK_WIDGET (accel_label));
priv->accel_node = gtk_css_node_new ();
@@ -343,6 +346,7 @@ gtk_accel_label_finalize (GObject *object)
GtkAccelLabel *accel_label = GTK_ACCEL_LABEL (object);
g_free (accel_label->priv->accel_string);
+ g_free (accel_label->priv->accel_text);
G_OBJECT_CLASS (gtk_accel_label_parent_class)->finalize (object);
}
@@ -942,6 +946,12 @@ gtk_accel_label_refetch (GtkAccelLabel *accel_label)
g_clear_pointer (&accel_label->priv->accel_string, g_free);
+ if (accel_label->priv->accel_text)
+ {
+ accel_label->priv->accel_string = g_strdup (accel_label->priv->accel_text);
+ return FALSE;
+ }
+
g_object_get (gtk_widget_get_settings (GTK_WIDGET (accel_label)),
"gtk-enable-accels", &enable_accels,
NULL);
@@ -1048,3 +1058,13 @@ gtk_accel_label_get_accel (GtkAccelLabel *accel_label,
*accelerator_key = accel_label->priv->accel_key;
*accelerator_mods = accel_label->priv->accel_mods;
}
+
+void
+_gtk_accel_label_set_accel_text (GtkAccelLabel *accel_label,
+ const gchar *accel_text)
+{
+ g_free (accel_label->priv->accel_text);
+ accel_label->priv->accel_text = g_strdup (accel_text);
+
+ gtk_accel_label_reset (accel_label);
+}
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index ded731a..2ddc650 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -2200,6 +2200,7 @@ gtk_menu_shell_tracker_insert_func (GtkMenuTrackerItem *item,
g_object_bind_property (item, "role", widget, "action-role", G_BINDING_SYNC_CREATE);
g_object_bind_property (item, "toggled", widget, "toggled", G_BINDING_SYNC_CREATE);
g_object_bind_property (item, "accel", widget, "accel", G_BINDING_SYNC_CREATE);
+ g_object_bind_property (item, "accel-text", widget, "accel-text", G_BINDING_SYNC_CREATE);
g_signal_connect (widget, "activate", G_CALLBACK (gtk_menu_shell_item_activate), item);
gtk_widget_show (widget);
diff --git a/gtk/gtkmenutrackeritem.c b/gtk/gtkmenutrackeritem.c
index 8d50366..8688048 100644
--- a/gtk/gtkmenutrackeritem.c
+++ b/gtk/gtkmenutrackeritem.c
@@ -115,6 +115,7 @@ enum {
PROP_ROLE,
PROP_TOGGLED,
PROP_ACCEL,
+ PROP_ACCEL_TEXT,
PROP_SUBMENU_SHOWN,
PROP_IS_VISIBLE,
N_PROPS
@@ -183,6 +184,9 @@ gtk_menu_tracker_item_get_property (GObject *object,
case PROP_ACCEL:
g_value_set_string (value, gtk_menu_tracker_item_get_accel (self));
break;
+ case PROP_ACCEL_TEXT:
+ g_value_set_string (value, gtk_menu_tracker_item_get_accel_text (self));
+ break;
case PROP_SUBMENU_SHOWN:
g_value_set_boolean (value, gtk_menu_tracker_item_get_submenu_shown (self));
break;
@@ -240,6 +244,8 @@ gtk_menu_tracker_item_class_init (GtkMenuTrackerItemClass *class)
g_param_spec_boolean ("toggled", "", "", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE);
gtk_menu_tracker_item_pspecs[PROP_ACCEL] =
g_param_spec_string ("accel", "", "", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE);
+ gtk_menu_tracker_item_pspecs[PROP_ACCEL_TEXT] =
+ g_param_spec_string ("accel-text", "", "", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE);
gtk_menu_tracker_item_pspecs[PROP_SUBMENU_SHOWN] =
g_param_spec_boolean ("submenu-shown", "", "", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE);
gtk_menu_tracker_item_pspecs[PROP_IS_VISIBLE] =
@@ -736,6 +742,16 @@ gtk_menu_tracker_item_get_text_direction (GtkMenuTrackerItem *self)
return text_direction;
}
+const gchar *
+gtk_menu_tracker_item_get_accel_text (GtkMenuTrackerItem *self)
+{
+ const gchar *accel_text = NULL;
+
+ g_menu_item_get_attribute (self->item, "x-canonical-accel", "&s", &accel_text);
+
+ return accel_text;
+}
+
GMenuModel *
_gtk_menu_tracker_item_get_link (GtkMenuTrackerItem *self,
const gchar *link_name)
diff --git a/gtk/gtkmenutrackeritem.h b/gtk/gtkmenutrackeritem.h
index 7bf83d9..0a96a72 100644
--- a/gtk/gtkmenutrackeritem.h
+++ b/gtk/gtkmenutrackeritem.h
@@ -76,6 +76,8 @@ gboolean gtk_menu_tracker_item_get_toggled (GtkMenu
const gchar * gtk_menu_tracker_item_get_accel (GtkMenuTrackerItem *self);
+const gchar * gtk_menu_tracker_item_get_accel_text (GtkMenuTrackerItem *self);
+
GMenuModel * _gtk_menu_tracker_item_get_link (GtkMenuTrackerItem *self,
const gchar *link_name);
diff --git a/gtk/gtkmodelmenuitem.c b/gtk/gtkmodelmenuitem.c
index 103f053..663b539 100644
--- a/gtk/gtkmodelmenuitem.c
+++ b/gtk/gtkmodelmenuitem.c
@@ -44,7 +44,8 @@ enum
PROP_ICON,
PROP_TEXT,
PROP_TOGGLED,
- PROP_ACCEL
+ PROP_ACCEL,
+ PROP_ACCEL_TEXT
};
static void
@@ -426,6 +427,41 @@ gtk_model_menu_item_get_property (GObject *object,
}
}
+static void
+gtk_model_menu_item_set_accel_text (GtkModelMenuItem *item,
+ const gchar *accel_text)
+{
+ GtkWidget *child;
+ GList *children;
+
+ child = gtk_bin_get_child (GTK_BIN (item));
+ if (child == NULL)
+ {
+ gtk_menu_item_get_label (GTK_MENU_ITEM (item));
+ child = gtk_bin_get_child (GTK_BIN (item));
+ g_assert (GTK_IS_LABEL (child));
+ }
+
+ if (GTK_IS_LABEL (child))
+ {
+ _gtk_accel_label_set_accel_text (GTK_ACCEL_LABEL (child), accel_text);
+ return;
+ }
+
+ if (!GTK_IS_CONTAINER (child))
+ return;
+
+ children = gtk_container_get_children (GTK_CONTAINER (child));
+
+ while (children)
+ {
+ if (GTK_IS_ACCEL_LABEL (children->data))
+ _gtk_accel_label_set_accel_text (children->data, accel_text);
+
+ children = g_list_delete_link (children, children);
+ }
+}
+
static void
gtk_model_menu_item_set_property (GObject *object,
guint prop_id,
@@ -457,6 +493,10 @@ gtk_model_menu_item_set_property (GObject *object,
gtk_model_menu_item_set_accel (item, g_value_get_string (value));
break;
+ case PROP_ACCEL_TEXT:
+ gtk_model_menu_item_set_accel_text (item, g_value_get_string (value));
+ break;
+
default:
g_assert_not_reached ();
}
@@ -499,6 +539,9 @@ gtk_model_menu_item_class_init (GtkModelMenuItemClass *class)
g_object_class_install_property (object_class, PROP_ACCEL,
g_param_spec_string ("accel", "accel", "accel", NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY));
+ g_object_class_install_property (object_class, PROP_ACCEL_TEXT,
+ g_param_spec_string ("accel-text", "accel-text", "accel-text", NULL,
+ G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
gtk_widget_class_set_accessible_role (GTK_WIDGET_CLASS (class), ATK_ROLE_MENU_ITEM);
}

View File

@ -1 +1 @@
3.0 (quilt)
3.0 (native)