+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
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;
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);
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
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,
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);