Commit 67ad0298 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Remove the "select first item if popped up from keypress" hack -- was

Sat Feb  2 11:37:21 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenu.c (gtk_menu_popup): Remove the
        "select first item if popped up from keypress" hack --
        was causing more problems than it was worth
        (#53191, #68483)

        * gtk/gtktextview.c (popup_targets_received):
         gtk/gtkentry.c (popup_targets_received): If activated
        from keyboard, select first item of popup menu.
parent 7bb3d17a
Sat Feb 2 11:37:21 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_popup): Remove the
"select first item if popped up from keypress" hack --
was causing more problems than it was worth
(#53191, #68483)
* gtk/gtktextview.c (popup_targets_received):
gtk/gtkentry.c (popup_targets_received): If activated
from keyboard, select first item of popup menu.
Sat Feb 2 18:07:51 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): set upper member
......
Sat Feb 2 11:37:21 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_popup): Remove the
"select first item if popped up from keypress" hack --
was causing more problems than it was worth
(#53191, #68483)
* gtk/gtktextview.c (popup_targets_received):
gtk/gtkentry.c (popup_targets_received): If activated
from keyboard, select first item of popup menu.
Sat Feb 2 18:07:51 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): set upper member
......
Sat Feb 2 11:37:21 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_popup): Remove the
"select first item if popped up from keypress" hack --
was causing more problems than it was worth
(#53191, #68483)
* gtk/gtktextview.c (popup_targets_received):
gtk/gtkentry.c (popup_targets_received): If activated
from keyboard, select first item of popup menu.
Sat Feb 2 18:07:51 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): set upper member
......
Sat Feb 2 11:37:21 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_popup): Remove the
"select first item if popped up from keypress" hack --
was causing more problems than it was worth
(#53191, #68483)
* gtk/gtktextview.c (popup_targets_received):
gtk/gtkentry.c (popup_targets_received): If activated
from keyboard, select first item of popup menu.
Sat Feb 2 18:07:51 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): set upper member
......
Sat Feb 2 11:37:21 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_popup): Remove the
"select first item if popped up from keypress" hack --
was causing more problems than it was worth
(#53191, #68483)
* gtk/gtktextview.c (popup_targets_received):
gtk/gtkentry.c (popup_targets_received): If activated
from keyboard, select first item of popup menu.
Sat Feb 2 18:07:51 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): set upper member
......
Sat Feb 2 11:37:21 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_popup): Remove the
"select first item if popped up from keypress" hack --
was causing more problems than it was worth
(#53191, #68483)
* gtk/gtktextview.c (popup_targets_received):
gtk/gtkentry.c (popup_targets_received): If activated
from keyboard, select first item of popup menu.
Sat Feb 2 18:07:51 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): set upper member
......
Sat Feb 2 11:37:21 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_popup): Remove the
"select first item if popped up from keypress" hack --
was causing more problems than it was worth
(#53191, #68483)
* gtk/gtktextview.c (popup_targets_received):
gtk/gtkentry.c (popup_targets_received): If activated
from keyboard, select first item of popup menu.
Sat Feb 2 18:07:51 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): set upper member
......
......@@ -3812,6 +3812,28 @@ unichar_chosen_func (const char *text,
gtk_entry_enter_text (entry, text);
}
static void
menu_select_first_child (GtkMenu *menu)
{
GList *children = gtk_container_get_children (GTK_CONTAINER (menu));
GList *tmp_list = children;
while (tmp_list)
{
GtkWidget *child = tmp_list->data;
if (GTK_WIDGET_VISIBLE (child))
{
gtk_menu_shell_select_item (GTK_MENU_SHELL (menu), child);
break;
}
tmp_list = tmp_list->next;
}
g_list_free (children);
}
typedef struct
{
GtkEntry *entry;
......@@ -3892,9 +3914,12 @@ popup_targets_received (GtkClipboard *clipboard,
NULL, NULL,
info->button, info->time);
else
gtk_menu_popup (GTK_MENU (entry->popup_menu), NULL, NULL,
popup_position_func, entry,
info->button, info->time);
{
gtk_menu_popup (GTK_MENU (entry->popup_menu), NULL, NULL,
popup_position_func, entry,
info->button, info->time);
menu_select_first_child (GTK_MENU (entry->popup_menu));
}
}
g_object_unref (entry);
......
......@@ -652,22 +652,6 @@ gtk_menu_popup (GtkMenu *menu,
gtk_widget_show (GTK_WIDGET (menu));
gtk_widget_show (menu->toplevel);
if (current_event)
{
/* Also, if we're popping up from a key event, select the first
* item in the menu. Bad hack, but no better way to do it
* in current menu framework.
*/
if (current_event->type == GDK_KEY_PRESS &&
GTK_MENU_SHELL (menu)->children)
{
gtk_menu_shell_select_item (GTK_MENU_SHELL (menu),
GTK_MENU_SHELL (menu)->children->data);
}
gdk_event_free (current_event);
}
gtk_menu_scroll_to (menu, menu->scroll_offset);
/* Find the last viewable ancestor, and make an X grab on it
......
......@@ -6273,6 +6273,28 @@ unichar_chosen_func (const char *text,
gtk_text_view_commit_text (text_view, text);
}
static void
menu_select_first_child (GtkMenu *menu)
{
GList *children = gtk_container_get_children (GTK_CONTAINER (menu));
GList *tmp_list = children;
while (tmp_list)
{
GtkWidget *child = tmp_list->data;
if (GTK_WIDGET_VISIBLE (child))
{
gtk_menu_shell_select_item (GTK_MENU_SHELL (menu), child);
break;
}
tmp_list = tmp_list->next;
}
g_list_free (children);
}
static void
popup_targets_received (GtkClipboard *clipboard,
GtkSelectionData *data,
......@@ -6355,9 +6377,12 @@ popup_targets_received (GtkClipboard *clipboard,
NULL, NULL,
info->button, info->time);
else
gtk_menu_popup (GTK_MENU (text_view->popup_menu), NULL, NULL,
popup_position_func, text_view,
0, gtk_get_current_event_time ());
{
gtk_menu_popup (GTK_MENU (text_view->popup_menu), NULL, NULL,
popup_position_func, text_view,
0, gtk_get_current_event_time ());
menu_select_first_child (GTK_MENU (text_view->popup_menu));
}
}
g_object_unref (text_view);
......
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