treeview: Stop disabling the context menu

This commit is contained in:
Matthias Clasen 2019-04-11 14:48:06 -04:00
parent 0509f8cff3
commit 10ce2076f9

View File

@ -841,9 +841,6 @@ static void gtk_tree_view_search_window_hide (GtkWidget *searc
static void gtk_tree_view_search_position_func (GtkTreeView *tree_view,
GtkWidget *search_window,
gpointer user_data);
static void gtk_tree_view_search_disable_popdown (GtkEntry *entry,
GtkMenu *menu,
gpointer data);
static void gtk_tree_view_search_preedit_changed (GtkText *text,
const char *preedit,
GtkTreeView *tree_view);
@ -851,9 +848,6 @@ static void gtk_tree_view_search_changed (GtkEditable *edita
GtkTreeView *tree_view);
static void gtk_tree_view_search_activate (GtkEntry *entry,
GtkTreeView *tree_view);
static gboolean gtk_tree_view_real_search_enable_popdown(gpointer data);
static void gtk_tree_view_search_enable_popdown (GtkWidget *widget,
gpointer data);
static void gtk_tree_view_search_pressed_cb (GtkGesture *gesture,
int n_press,
double x,
@ -10235,8 +10229,6 @@ gtk_tree_view_ensure_interactive_directory (GtkTreeView *tree_view)
/* add entry */
tree_view->priv->search_entry = gtk_text_new ();
g_signal_connect (tree_view->priv->search_entry, "populate-popup",
G_CALLBACK (gtk_tree_view_search_disable_popdown), tree_view);
g_signal_connect (tree_view->priv->search_entry, "activate",
G_CALLBACK (gtk_tree_view_search_activate), tree_view);
g_signal_connect (tree_view->priv->search_entry, "preedit-changed",
@ -13791,18 +13783,6 @@ gtk_tree_view_search_position_func (GtkTreeView *tree_view,
{
}
static void
gtk_tree_view_search_disable_popdown (GtkEntry *entry,
GtkMenu *menu,
gpointer data)
{
GtkTreeView *tree_view = (GtkTreeView *)data;
tree_view->priv->disable_popdown = 1;
g_signal_connect (menu, "hide",
G_CALLBACK (gtk_tree_view_search_enable_popdown), data);
}
/* Because we're visible but offscreen, we just set a flag in the preedit
* callback.
*/
@ -13855,27 +13835,6 @@ gtk_tree_view_search_activate (GtkEntry *entry,
}
}
static gboolean
gtk_tree_view_real_search_enable_popdown (gpointer data)
{
GtkTreeView *tree_view = (GtkTreeView *)data;
tree_view->priv->disable_popdown = 0;
return FALSE;
}
static void
gtk_tree_view_search_enable_popdown (GtkWidget *widget,
gpointer data)
{
guint id = g_timeout_add_full (G_PRIORITY_HIGH, 200,
gtk_tree_view_real_search_enable_popdown,
g_object_ref (data),
g_object_unref);
g_source_set_name_by_id (id, "[gtk] gtk_tree_view_real_search_enable_popdown");
}
static void
gtk_tree_view_search_pressed_cb (GtkGesture *gesture,
int n_press,