propagate ::selection-done emissions up to the topmost menu shell.

Mon May 10 04:20:41 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
        ::selection-done emissions up to the topmost menu shell.
This commit is contained in:
Tim Janik
1999-05-11 02:19:37 +00:00
committed by Tim Janik
parent 5e52b31fd7
commit 519fed9991
8 changed files with 57 additions and 6 deletions

View File

@@ -1,3 +1,8 @@
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset

View File

@@ -1,3 +1,8 @@
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset

View File

@@ -1,3 +1,8 @@
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset

View File

@@ -1,3 +1,8 @@
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset

View File

@@ -1,3 +1,8 @@
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset

View File

@@ -1,3 +1,8 @@
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset

View File

@@ -1,3 +1,8 @@
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset

View File

@@ -802,6 +802,7 @@ gtk_menu_shell_activate_item (GtkMenuShell *menu_shell,
GtkWidget *menu_item,
gboolean force_deactivate)
{
GSList *slist, *shells = NULL;
gboolean deactivate = force_deactivate;
g_return_if_fail (menu_shell != NULL);
@@ -810,12 +811,23 @@ gtk_menu_shell_activate_item (GtkMenuShell *menu_shell,
g_return_if_fail (GTK_IS_MENU_ITEM (menu_item));
if (!deactivate)
{
deactivate = GTK_MENU_ITEM_CLASS (GTK_OBJECT (menu_item)->klass)->hide_on_activate;
}
deactivate = GTK_MENU_ITEM_CLASS (GTK_OBJECT (menu_item)->klass)->hide_on_activate;
gtk_widget_ref (GTK_WIDGET (menu_shell));
if (deactivate)
{
GtkMenuShell *parent_menu_shell = menu_shell;
do
{
gtk_widget_ref (GTK_WIDGET (parent_menu_shell));
shells = g_slist_prepend (shells, parent_menu_shell);
parent_menu_shell = (GtkMenuShell*) parent_menu_shell->parent_menu_shell;
}
while (parent_menu_shell);
shells = g_slist_reverse (shells);
gtk_menu_shell_deactivate (menu_shell);
/* flush the x-queue, so any grabs are removed and
@@ -824,11 +836,15 @@ gtk_menu_shell_activate_item (GtkMenuShell *menu_shell,
gdk_flush ();
}
gtk_widget_ref (GTK_WIDGET (menu_shell));
gtk_widget_activate (menu_item);
if (deactivate)
gtk_signal_emit (GTK_OBJECT (menu_shell), menu_shell_signals[SELECTION_DONE]);
for (slist = shells; slist; slist = slist->next)
{
gtk_signal_emit (slist->data, menu_shell_signals[SELECTION_DONE]);
gtk_widget_unref (slist->data);
}
g_slist_free (shells);
gtk_widget_unref (GTK_WIDGET (menu_shell));
}