[gtk+/wip/action-helper] gtkwidget: don't create unneeded action muxers
- From: Lars Uebernickel <larsu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/action-helper] gtkwidget: don't create unneeded action muxers
- Date: Thu, 16 Aug 2012 19:11:53 +0000 (UTC)
commit 962b4b4456bd1ca3342651453df37d45d6e8d8bf
Author: Lars Uebernickel <lars uebernickel canonical com>
Date: Thu Aug 16 21:01:33 2012 +0200
gtkwidget: don't create unneeded action muxers
This makes sure action muxers are only created for widgets that are in
the path between an actionable widget and its toplevel window.
It works because _gtk_widget_get_action_muxer initializes muxers with
the parent widget: requesting a muxer from a widget creates all parent
muxers.
Action muxers always have to be created for menus, because those chain
up to the attach widget (which gtkwidget.c doesn't know anything about)
instead of the parent. This is okay, as menus will almost certainly
contain actions.
gtk/gtkwidget.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index ff023aa..a78b240 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -6702,6 +6702,9 @@ gtk_widget_update_parent_muxer (GtkWidget *widget)
GtkWidget *parent;
GActionMuxer *parent_muxer;
+ if (widget->priv->muxer == NULL)
+ return;
+
muxer = _gtk_widget_get_action_muxer (widget);
parent = gtk_widget_get_parent (widget);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]