rishi pushed to gtk3 (f21). "Backport patch to make GtkMenuButton submit to its GAction"
notifications at fedoraproject.org
notifications at fedoraproject.org
Wed May 20 14:47:12 UTC 2015
From eb90dcc5329427fbc94f66bfecc1eea9c7a5e259 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir at gnome.org>
Date: Wed, 20 May 2015 16:46:14 +0200
Subject: Backport patch to make GtkMenuButton submit to its GAction
diff --git a/0001-GtkMenuButton-Submit-to-action.patch b/0001-GtkMenuButton-Submit-to-action.patch
new file mode 100644
index 0000000..4ea38d4
--- /dev/null
+++ b/0001-GtkMenuButton-Submit-to-action.patch
@@ -0,0 +1,78 @@
+From 7d5fe40f2e11d21153fe86ce69deec7fa7c348ae Mon Sep 17 00:00:00 2001
+From: Matthias Clasen <mclasen at redhat.com>
+Date: Thu, 9 Oct 2014 15:30:52 -0400
+Subject: [PATCH] GtkMenuButton: Submit to action
+
+As an actionable (inherited from GtkButton), a GtkMenuButton
+should not set its own sensitivity when it has an action-name
+set, but just follow the enabled state of the associated
+action.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=738083
+---
+ gtk/gtkmenubutton.c | 21 ++++++++++++++++-----
+ 1 file changed, 16 insertions(+), 5 deletions(-)
+
+diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c
+index 4ff2c18..dd4cdf2 100644
+--- a/gtk/gtkmenubutton.c
++++ b/gtk/gtkmenubutton.c
+@@ -108,6 +108,7 @@
+
+ #include "gtkmenubutton.h"
+ #include "gtkmenubuttonprivate.h"
++#include "gtkbuttonprivate.h"
+ #include "gtktypebuiltins.h"
+ #include "gtkwindow.h"
+ #include "gtkmain.h"
+@@ -695,6 +696,18 @@ menu_detacher (GtkWidget *widget,
+ priv->menu = NULL;
+ }
+
++static void
++update_sensitivity (GtkMenuButton *menu_button)
++{
++ GtkMenuButtonPrivate *priv = menu_button->priv;
++
++ if (GTK_BUTTON (menu_button)->priv->action_helper)
++ return;
++
++ gtk_widget_set_sensitive (GTK_WIDGET (menu_button),
++ priv->menu != NULL || priv->popover != NULL);
++}
++
+ /* This function is used in GtkMenuToolButton, the call back will
+ * be called when GtkMenuToolButton would have emitted the “show-menu”
+ * signal.
+@@ -742,7 +755,7 @@ _gtk_menu_button_set_popup_with_func (GtkMenuButton *menu_button
+ gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (menu_button)), "menu-button");
+ }
+
+- gtk_widget_set_sensitive (GTK_WIDGET (menu_button), priv->menu != NULL);
++ update_sensitivity (menu_button);
+
+ g_object_notify (G_OBJECT (menu_button), "popup");
+ g_object_notify (G_OBJECT (menu_button), "menu-model");
+@@ -777,8 +790,7 @@ gtk_menu_button_set_popup (GtkMenuButton *menu_button,
+ if (menu && priv->popover)
+ gtk_menu_button_set_popover (menu_button, NULL);
+
+- gtk_widget_set_sensitive (GTK_WIDGET (menu_button),
+- priv->menu != NULL || priv->popover != NULL);
++ update_sensitivity (menu_button);
+
+ g_object_thaw_notify (G_OBJECT (menu_button));
+ }
+@@ -1173,8 +1185,7 @@ gtk_menu_button_set_popover (GtkMenuButton *menu_button,
+ if (popover && priv->menu)
+ gtk_menu_button_set_popup (menu_button, NULL);
+
+- gtk_widget_set_sensitive (GTK_WIDGET (menu_button),
+- priv->menu != NULL || priv->popover != NULL);
++ update_sensitivity (menu_button);
+
+ g_object_notify (G_OBJECT (menu_button), "popover");
+ g_object_notify (G_OBJECT (menu_button), "menu-model");
+--
+2.1.0
+
diff --git a/gtk3.spec b/gtk3.spec
index 3f93875..6860513 100644
--- a/gtk3.spec
+++ b/gtk3.spec
@@ -18,7 +18,7 @@
Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X
Name: gtk3
Version: 3.14.13
-Release: 1%{?dist}
+Release: 2%{?dist}
License: LGPLv2+
Group: System Environment/Libraries
URL: http://www.gtk.org
@@ -26,6 +26,9 @@ URL: http://www.gtk.org
Source: http://download.gnome.org/sources/gtk+/3.14/gtk+-%{version}.tar.xz
+# https://bugzilla.gnome.org/show_bug.cgi?id=738083
+Patch0: 0001-GtkMenuButton-Submit-to-action.patch
+
BuildRequires: gnome-common autoconf automake intltool gettext
BuildRequires: atk-devel >= %{atk_version}
BuildRequires: at-spi2-atk-devel
@@ -143,6 +146,7 @@ the functionality of the installed %{name} package.
%prep
%setup -q -n gtk+-%{version}
+%patch0 -p1
%build
@@ -314,6 +318,9 @@ gtk-query-immodules-3.0-%{__isa_bits} --update-cache
%{_datadir}/installed-tests
%changelog
+* Wed May 20 2015 Debarshi Ray <rishi at fedoraproject.org> - 3.14.13-2
+- Backport patch to make GtkMenuButton submit to its GAction
+
* Mon Apr 27 2015 Matthias Clasen <mclasen at redhat.com> - 3.14.13-1
- Update to 3.14.13
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/gtk3.git/commit/?h=f21&id=eb90dcc5329427fbc94f66bfecc1eea9c7a5e259
More information about the scm-commits
mailing list