[gtk+] textview: Unobscure the mouse cursor on motion events



commit 05810f80a4d482ccb3078b5f52eadd0f427fd088
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Jun 12 23:18:54 2014 +0200

    textview: Unobscure the mouse cursor on motion events
    
    This used to be done before the gestures port, and was removed
    accidentally, so keep the motion_notify_event handler just for
    this, and fallback to having those events handled by gestures
    too.

 gtk/gtktextview.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 1e9b969..4de4cd7 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -365,6 +365,8 @@ static gint gtk_text_view_focus_in_event       (GtkWidget        *widget,
                                                 GdkEventFocus    *event);
 static gint gtk_text_view_focus_out_event      (GtkWidget        *widget,
                                                 GdkEventFocus    *event);
+static gint gtk_text_view_motion_event         (GtkWidget        *widget,
+                                                GdkEventMotion   *event);
 static gint gtk_text_view_draw                 (GtkWidget        *widget,
                                                 cairo_t          *cr);
 static gboolean gtk_text_view_focus            (GtkWidget        *widget,
@@ -678,6 +680,7 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
   widget_class->key_release_event = gtk_text_view_key_release_event;
   widget_class->focus_in_event = gtk_text_view_focus_in_event;
   widget_class->focus_out_event = gtk_text_view_focus_out_event;
+  widget_class->motion_notify_event = gtk_text_view_motion_event;
   widget_class->draw = gtk_text_view_draw;
   widget_class->focus = gtk_text_view_focus;
   widget_class->drag_begin = gtk_text_view_drag_begin;
@@ -5260,6 +5263,16 @@ gtk_text_view_focus_out_event (GtkWidget *widget, GdkEventFocus *event)
   return FALSE;
 }
 
+static gboolean
+gtk_text_view_motion_event (GtkWidget *widget, GdkEventMotion *event)
+{
+  GtkTextView *text_view = GTK_TEXT_VIEW (widget);
+
+  gtk_text_view_unobscure_mouse_cursor (text_view);
+
+  return GTK_WIDGET_CLASS (gtk_text_view_parent_class)->motion_notify_event (widget, event);
+}
+
 static void
 gtk_text_view_paint (GtkWidget      *widget,
                      cairo_t        *cr)


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