Commit 03498ba2 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Export private _gtk_menu_shell_activate() to encapsulate cut-and-paste

Sat Apr  6 06:57:00 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenushell.[ch] gtk/gtkmenuitem.c: Export
        private _gtk_menu_shell_activate() to encapsulate
        cut-and-paste code.

        * gtk/gtkmenubar.c: Select the first item on the menu bar
        for F10 rather than acting as if the user pressed <Alt>F
        to select the file manager.
parent 631b8da9
Sat Apr 6 06:57:00 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenushell.[ch] gtk/gtkmenuitem.c: Export
private _gtk_menu_shell_activate() to encapsulate
cut-and-paste code.
* gtk/gtkmenubar.c: Select the first item on the menu bar
for F10 rather than acting as if the user pressed <Alt>F
to select the file manager.
Tue Apr 9 19:01:28 2002 Owen Taylor <otaylor@redhat.com>
Fix problems with HandleBox and focusing - #78232
......
Sat Apr 6 06:57:00 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenushell.[ch] gtk/gtkmenuitem.c: Export
private _gtk_menu_shell_activate() to encapsulate
cut-and-paste code.
* gtk/gtkmenubar.c: Select the first item on the menu bar
for F10 rather than acting as if the user pressed <Alt>F
to select the file manager.
Tue Apr 9 19:01:28 2002 Owen Taylor <otaylor@redhat.com>
Fix problems with HandleBox and focusing - #78232
......
Sat Apr 6 06:57:00 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenushell.[ch] gtk/gtkmenuitem.c: Export
private _gtk_menu_shell_activate() to encapsulate
cut-and-paste code.
* gtk/gtkmenubar.c: Select the first item on the menu bar
for F10 rather than acting as if the user pressed <Alt>F
to select the file manager.
Tue Apr 9 19:01:28 2002 Owen Taylor <otaylor@redhat.com>
Fix problems with HandleBox and focusing - #78232
......
Sat Apr 6 06:57:00 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenushell.[ch] gtk/gtkmenuitem.c: Export
private _gtk_menu_shell_activate() to encapsulate
cut-and-paste code.
* gtk/gtkmenubar.c: Select the first item on the menu bar
for F10 rather than acting as if the user pressed <Alt>F
to select the file manager.
Tue Apr 9 19:01:28 2002 Owen Taylor <otaylor@redhat.com>
Fix problems with HandleBox and focusing - #78232
......
Sat Apr 6 06:57:00 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenushell.[ch] gtk/gtkmenuitem.c: Export
private _gtk_menu_shell_activate() to encapsulate
cut-and-paste code.
* gtk/gtkmenubar.c: Select the first item on the menu bar
for F10 rather than acting as if the user pressed <Alt>F
to select the file manager.
Tue Apr 9 19:01:28 2002 Owen Taylor <otaylor@redhat.com>
Fix problems with HandleBox and focusing - #78232
......
Sat Apr 6 06:57:00 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenushell.[ch] gtk/gtkmenuitem.c: Export
private _gtk_menu_shell_activate() to encapsulate
cut-and-paste code.
* gtk/gtkmenubar.c: Select the first item on the menu bar
for F10 rather than acting as if the user pressed <Alt>F
to select the file manager.
Tue Apr 9 19:01:28 2002 Owen Taylor <otaylor@redhat.com>
Fix problems with HandleBox and focusing - #78232
......
......@@ -416,16 +416,14 @@ window_key_press_handler (GtkWidget *widget,
GTK_DIR_TAB_FORWARD, NULL);
if (menubars)
{
GtkMenuShell *menushell = GTK_MENU_SHELL (menubars->data);
GtkMenuShell *menu_shell = GTK_MENU_SHELL (menubars->data);
if (menushell->children)
{
gtk_signal_emit_by_name (GTK_OBJECT (menushell->children->data),
"activate_item");
retval = TRUE;
}
_gtk_menu_shell_activate (menu_shell);
_gtk_menu_shell_select_first (menu_shell);
g_list_free (menubars);
retval = TRUE;
}
}
......
......@@ -779,12 +779,7 @@ gtk_real_menu_item_activate_item (GtkMenuItem *menu_item)
{
GtkMenuShell *menu_shell = GTK_MENU_SHELL (widget->parent);
if (!menu_shell->active)
{
gtk_grab_add (GTK_WIDGET (menu_shell));
menu_shell->have_grab = TRUE;
menu_shell->active = TRUE;
}
_gtk_menu_shell_activate (menu_shell);
gtk_menu_shell_select_item (GTK_MENU_SHELL (widget->parent), widget);
gtk_menu_item_popup_submenu (widget);
......
......@@ -440,6 +440,17 @@ gtk_menu_shell_realize (GtkWidget *widget)
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
}
void
_gtk_menu_shell_activate (GtkMenuShell *menu_shell)
{
if (!menu_shell->active)
{
gtk_grab_add (GTK_WIDGET (menu_shell));
menu_shell->have_grab = TRUE;
menu_shell->active = TRUE;
}
}
static gint
gtk_menu_shell_button_press (GtkWidget *widget,
GdkEventButton *event)
......@@ -461,12 +472,8 @@ gtk_menu_shell_button_press (GtkWidget *widget,
}
else if (!menu_shell->active || !menu_shell->button)
{
if (!menu_shell->active)
{
gtk_grab_add (GTK_WIDGET (widget));
menu_shell->have_grab = TRUE;
menu_shell->active = TRUE;
}
_gtk_menu_shell_activate (menu_shell);
menu_shell->button = event->button;
menu_item = gtk_menu_shell_get_item (menu_shell, (GdkEvent *)event);
......
......@@ -112,6 +112,7 @@ void gtk_menu_shell_activate_item (GtkMenuShell *menu_shell,
gboolean force_deactivate);
void _gtk_menu_shell_select_first (GtkMenuShell *menu_shell);
void _gtk_menu_shell_activate (GtkMenuShell *menu_shell);
#ifdef __cplusplus
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment