[gtk+/wip/matthiasc/kill-event-signals: 86/126] entry completion: Drop initial selection avoidance



commit f60421d26be58e8849effec48b69e9ec09171b11
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jan 1 23:08:46 2018 -0500

    entry completion: Drop initial selection avoidance
    
    This is a minor thing, and it is hard to recreate
    with event controllers, so drop it for now.

 gtk/gtkentrycompletion.c |   45 ---------------------------------------------
 gtk/gtkentryprivate.h    |    2 +-
 2 files changed, 1 insertions(+), 46 deletions(-)
---
diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c
index f14e0a1..671a276 100644
--- a/gtk/gtkentrycompletion.c
+++ b/gtk/gtkentrycompletion.c
@@ -153,12 +153,6 @@ static gboolean gtk_entry_completion_action_button_press (GtkWidget          *wi
                                                           gpointer            user_data);
 static void     gtk_entry_completion_selection_changed   (GtkTreeSelection   *selection,
                                                           gpointer            data);
-static gboolean gtk_entry_completion_list_enter_notify   (GtkWidget          *widget,
-                                                          GdkEventCrossing   *event,
-                                                          gpointer            data);
-static gboolean gtk_entry_completion_list_motion_notify  (GtkWidget          *widget,
-                                                          GdkEventMotion     *event,
-                                                          gpointer            data);
 static void     gtk_entry_completion_insert_action       (GtkEntryCompletion *completion,
                                                           gint                index,
                                                           const gchar        *string,
@@ -542,12 +536,6 @@ gtk_entry_completion_constructed (GObject *object)
   g_signal_connect (priv->tree_view, "button-press-event",
                     G_CALLBACK (gtk_entry_completion_list_button_press),
                     completion);
-  g_signal_connect (priv->tree_view, "enter-notify-event",
-                    G_CALLBACK (gtk_entry_completion_list_enter_notify),
-                    completion);
-  g_signal_connect (priv->tree_view, "motion-notify-event",
-                    G_CALLBACK (gtk_entry_completion_list_motion_notify),
-                    completion);
 
   gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (priv->tree_view), FALSE);
   gtk_tree_view_set_hover_selection (GTK_TREE_VIEW (priv->tree_view), TRUE);
@@ -583,12 +571,6 @@ gtk_entry_completion_constructed (GObject *object)
   g_signal_connect (priv->action_view, "button-press-event",
                     G_CALLBACK (gtk_entry_completion_action_button_press),
                     completion);
-  g_signal_connect (priv->action_view, "enter-notify-event",
-                    G_CALLBACK (gtk_entry_completion_list_enter_notify),
-                    completion);
-  g_signal_connect (priv->action_view, "motion-notify-event",
-                    G_CALLBACK (gtk_entry_completion_list_motion_notify),
-                    completion);
   gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (priv->action_view), FALSE);
   gtk_tree_view_set_hover_selection (GTK_TREE_VIEW (priv->action_view), TRUE);
 
@@ -1467,29 +1449,6 @@ gtk_entry_completion_get_text_column (GtkEntryCompletion *completion)
 
 /* private */
 
-static gboolean
-gtk_entry_completion_list_enter_notify (GtkWidget        *widget,
-                                        GdkEventCrossing *event,
-                                        gpointer          data)
-{
-  GtkEntryCompletion *completion = GTK_ENTRY_COMPLETION (data);
-
-  return completion->priv->ignore_enter;
-}
-
-static gboolean
-gtk_entry_completion_list_motion_notify (GtkWidget      *widget,
-                                         GdkEventMotion *event,
-                                         gpointer        data)
-{
-  GtkEntryCompletion *completion = GTK_ENTRY_COMPLETION (data);
-
-  completion->priv->ignore_enter = FALSE;
-
-  return FALSE;
-}
-
-
 /* some nasty size requisition */
 void
 _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
@@ -1637,8 +1596,6 @@ gtk_entry_completion_popup (GtkEntryCompletion *completion)
   if (completion->priv->has_grab)
     return;
 
-  completion->priv->ignore_enter = TRUE;
-
   gtk_widget_show (completion->priv->vbox);
 
   /* default on no match */
@@ -1677,8 +1634,6 @@ _gtk_entry_completion_popdown (GtkEntryCompletion *completion)
   if (!gtk_widget_get_mapped (completion->priv->popup_window))
     return;
 
-  completion->priv->ignore_enter = FALSE;
-
   if (completion->priv->has_grab)
     {
       gdk_seat_ungrab (gdk_device_get_seat (completion->priv->device));
diff --git a/gtk/gtkentryprivate.h b/gtk/gtkentryprivate.h
index 08fab2d..f4be18d 100644
--- a/gtk/gtkentryprivate.h
+++ b/gtk/gtkentryprivate.h
@@ -24,6 +24,7 @@
 #include <gtk/gtkentrycompletion.h>
 #include <gtk/gtkentry.h>
 #include <gtk/gtkspinbutton.h>
+#include <gtk/gtkeventcontrollermotion.h>
 
 G_BEGIN_DECLS
 
@@ -59,7 +60,6 @@ struct _GtkEntryCompletionPrivate
   gint current_selected;
 
   guint first_sel_changed : 1;
-  guint ignore_enter      : 1;
   guint has_completion    : 1;
   guint inline_completion : 1;
   guint popup_completion  : 1;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]