[maemo-commits] [maemo-commits] r8409 - in projects/haf/trunk/gtk+: . gtk

From: www-data at stage.maemo.org www-data at stage.maemo.org
Date: Tue Nov 28 16:57:07 EET 2006
Author: tko
Date: 2006-11-28 16:57:06 +0200 (Tue, 28 Nov 2006)
New Revision: 8409

Modified:
   projects/haf/trunk/gtk+/ChangeLog
   projects/haf/trunk/gtk+/gtk/gtkentry.c
   projects/haf/trunk/gtk+/gtk/gtktextview.c
Log:
NB#48546: use gdk_device_get_state() to handle motion notify hints right

2006-11-28  Tommi Komulainen  <tommi.komulainen at nokia.com>

	* gtk/gtktextview.c (gtk_text_view_motion_event,
	selection_motion_event_handler)
	* gtk/gtkentry.c (gtk_entry_motion_notify): When extension events are
	enabled, gdk_window_get_pointer() fails to do the right thing. Use
	gdk_device_get_state() instead. NB#48546


Modified: projects/haf/trunk/gtk+/ChangeLog
===================================================================
--- projects/haf/trunk/gtk+/ChangeLog	2006-11-28 14:40:11 UTC (rev 8408)
+++ projects/haf/trunk/gtk+/ChangeLog	2006-11-28 14:57:06 UTC (rev 8409)
@@ -1,3 +1,11 @@
+2006-11-28  Tommi Komulainen  <tommi.komulainen at nokia.com>
+
+	* gtk/gtktextview.c (gtk_text_view_motion_event,
+	selection_motion_event_handler)
+	* gtk/gtkentry.c (gtk_entry_motion_notify): When extension events are
+	enabled, gdk_window_get_pointer() fails to do the right thing. Use
+	gdk_device_get_state() instead. NB#48546
+
 2006-11-27  Tommi Komulainen  <tommi.komulainen at nokia.com>
 
 	* gtk/gtkwidget.c (gtk_widget_set_extension_events_internal): Accept

Modified: projects/haf/trunk/gtk+/gtk/gtkentry.c
===================================================================
--- projects/haf/trunk/gtk+/gtk/gtkentry.c	2006-11-28 14:40:11 UTC (rev 8408)
+++ projects/haf/trunk/gtk+/gtk/gtkentry.c	2006-11-28 14:57:06 UTC (rev 8409)
@@ -2041,7 +2041,7 @@
     return TRUE;
 
   if (event->is_hint || (entry->text_area != event->window))
-    gdk_window_get_pointer (entry->text_area, NULL, NULL, NULL);
+    gdk_device_get_state (event->device, event->window, NULL, NULL);
 
   if (entry->in_drag)
     {

Modified: projects/haf/trunk/gtk+/gtk/gtktextview.c
===================================================================
--- projects/haf/trunk/gtk+/gtk/gtktextview.c	2006-11-28 14:40:11 UTC (rev 8408)
+++ projects/haf/trunk/gtk+/gtk/gtktextview.c	2006-11-28 14:57:06 UTC (rev 8409)
@@ -4306,18 +4306,16 @@
 
   gtk_text_view_unobscure_mouse_cursor (text_view);
 
+  if (event->is_hint)
+    gdk_device_get_state (event->device, event->window, NULL, NULL);
+
   if (event->window == text_view->text_window->bin_window &&
       text_view->drag_start_x >= 0)
     {
-      gint x, y;
-
-      gdk_window_get_pointer (text_view->text_window->bin_window,
-                              &x, &y, NULL);
-
       if (gtk_drag_check_threshold (widget,
 				    text_view->drag_start_x, 
 				    text_view->drag_start_y,
-				    x, y))
+				    event->x, event->y))
         {
           GtkTextIter iter;
           gint buffer_x, buffer_y;
@@ -5742,14 +5740,15 @@
 {
   SelectionGranularity granularity = GPOINTER_TO_INT (data);
 
+  if (event->is_hint)
+    gdk_device_get_state (event->device, event->window, NULL, NULL);
+
   if (granularity == SELECT_CHARACTERS) 
     {
       move_mark_to_pointer_and_scroll (text_view, "insert");
     }
   else 
     {
-      gint x, y;
-      GdkModifierType state;
       GtkTextIter start, end;
       GtkTextIter old_start, old_end;    
       GtkTextIter ins, bound;    
@@ -5757,9 +5756,6 @@
       
       buffer = get_buffer (text_view);
 
-      gdk_window_get_pointer (text_view->text_window->bin_window,
-			      &x, &y, &state);
-      
       gtk_text_layout_get_iter_at_pixel (text_view->layout,
 					 &start,
 					 event->x + text_view->xoffset,


More information about the maemo-commits mailing list