]> Pileus Git - ~andy/gtk/commitdiff
Remove. (gtk_notebook_motion_notify): Instead, update the arrow state
authorMatthias Clasen <mclasen@redhat.com>
Tue, 15 Aug 2006 06:59:55 +0000 (06:59 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 15 Aug 2006 06:59:55 +0000 (06:59 +0000)
2006-08-15  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtknotebook.c (gtk_notebook_enter_notify): Remove.
        (gtk_notebook_motion_notify): Instead, update the arrow
        state here.  (#349570, Benjamin Otte)

ChangeLog
ChangeLog.pre-2-10
gtk/gtknotebook.c

index 8de472d0f4dc3b3b6d7b749a0c69ba870b950f21..ba6c9a57fa30b3c5b6b457592004154b97d9d0c5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2006-08-15  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtknotebook.c (gtk_notebook_enter_notify): Remove.
+       (gtk_notebook_motion_notify): Instead, update the arrow
+       state here.  (#349570, Benjamin Otte)
+
        * gdk/x11/gdkwindow-x11.c (gdk_window_get_geometry_hints):
        Use XAllocSizeHints to allocate the XSizeHints struct.
        (#249285, David Baron)
index 8de472d0f4dc3b3b6d7b749a0c69ba870b950f21..ba6c9a57fa30b3c5b6b457592004154b97d9d0c5 100644 (file)
@@ -1,5 +1,9 @@
 2006-08-15  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtknotebook.c (gtk_notebook_enter_notify): Remove.
+       (gtk_notebook_motion_notify): Instead, update the arrow
+       state here.  (#349570, Benjamin Otte)
+
        * gdk/x11/gdkwindow-x11.c (gdk_window_get_geometry_hints):
        Use XAllocSizeHints to allocate the XSizeHints struct.
        (#249285, David Baron)
index 5608498507cf4e490ae7ed3bd96079c1882a458d..ba63f13a03f49f7fc0da8413dd2af96a63807a3d 100644 (file)
@@ -243,8 +243,6 @@ static gint gtk_notebook_button_press        (GtkWidget        *widget,
 static gint gtk_notebook_button_release      (GtkWidget        *widget,
                                              GdkEventButton   *event);
 static gboolean gtk_notebook_popup_menu      (GtkWidget        *widget);
-static gint gtk_notebook_enter_notify        (GtkWidget        *widget,
-                                             GdkEventCrossing *event);
 static gint gtk_notebook_leave_notify        (GtkWidget        *widget,
                                              GdkEventCrossing *event);
 static gint gtk_notebook_motion_notify       (GtkWidget        *widget,
@@ -487,7 +485,6 @@ gtk_notebook_class_init (GtkNotebookClass *class)
   widget_class->button_press_event = gtk_notebook_button_press;
   widget_class->button_release_event = gtk_notebook_button_release;
   widget_class->popup_menu = gtk_notebook_popup_menu;
-  widget_class->enter_notify_event = gtk_notebook_enter_notify;
   widget_class->leave_notify_event = gtk_notebook_leave_notify;
   widget_class->motion_notify_event = gtk_notebook_motion_notify;
   widget_class->grab_notify = gtk_notebook_grab_notify;
@@ -1442,7 +1439,6 @@ gtk_notebook_get_property (GObject         *object,
  * gtk_notebook_button_press
  * gtk_notebook_button_release
  * gtk_notebook_popup_menu
- * gtk_notebook_enter_notify
  * gtk_notebook_leave_notify
  * gtk_notebook_motion_notify
  * gtk_notebook_focus_in
@@ -1597,7 +1593,7 @@ gtk_notebook_realize (GtkWidget *widget)
   attributes.event_mask = gtk_widget_get_events (widget);
   attributes.event_mask |= (GDK_BUTTON_PRESS_MASK |
                            GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK |
-                           GDK_POINTER_MOTION_MASK |
+                           GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK |
                            GDK_SCROLL_MASK);
   attributes_mask = GDK_WA_X | GDK_WA_Y;
 
@@ -2659,35 +2655,6 @@ gtk_notebook_button_release (GtkWidget      *widget,
     return FALSE;
 }
 
-static gint
-gtk_notebook_enter_notify (GtkWidget        *widget,
-                          GdkEventCrossing *event)
-{
-  GtkNotebook *notebook;
-  GtkNotebookArrow arrow;
-  gint x, y;
-
-  g_return_val_if_fail (GTK_IS_NOTEBOOK (widget), FALSE);
-  g_return_val_if_fail (event != NULL, FALSE);
-
-  notebook = GTK_NOTEBOOK (widget);
-
-  if (!get_widget_coordinates (widget, (GdkEvent *)event, &x, &y))
-    return FALSE;
-
-  arrow = gtk_notebook_get_arrow (notebook, x, y);
-
-  if (arrow != notebook->in_child)
-    {
-      notebook->in_child = arrow;
-      gtk_notebook_redraw_arrows (notebook);
-
-      return TRUE;
-    }
-
-  return TRUE;
-}
-
 static gint
 gtk_notebook_leave_notify (GtkWidget        *widget,
                           GdkEventCrossing *event)
@@ -2821,6 +2788,7 @@ gtk_notebook_motion_notify (GtkWidget      *widget,
   GtkNotebook *notebook = GTK_NOTEBOOK (widget);
   GtkNotebookPrivate *priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
   GtkNotebookPage *page;
+  GtkNotebookArrow arrow;
   GtkNotebookPointerPosition pointer_position;
   GtkSettings *settings;
   guint timeout;
@@ -2837,9 +2805,6 @@ gtk_notebook_motion_notify (GtkWidget      *widget,
       stop_scrolling (notebook);
     }
 
-  if (priv->pressed_button == -1)
-    return FALSE;
-
   if (event->time < priv->timestamp + MSECS_BETWEEN_UPDATES)
     return FALSE;
 
@@ -2849,6 +2814,16 @@ gtk_notebook_motion_notify (GtkWidget      *widget,
                          &priv->mouse_y,
                          NULL);
 
+  arrow = gtk_notebook_get_arrow (notebook, priv->mouse_x, priv->mouse_y);
+  if (arrow != notebook->in_child)
+    {
+      notebook->in_child = arrow;
+      gtk_notebook_redraw_arrows (notebook);
+    }
+
+  if (priv->pressed_button == -1)
+    return FALSE;
+
   if (page->detachable &&
       check_threshold (notebook, priv->mouse_x, priv->mouse_y))
     {
@@ -4657,7 +4632,7 @@ gtk_notebook_draw_arrow (GtkNotebook      *notebook,
           arrow = (ARROW_IS_LEFT (nbarrow) ? GTK_ARROW_LEFT : GTK_ARROW_RIGHT);
           arrow_size = scroll_arrow_hlength;
         }
-      
+     
       gtk_paint_arrow (widget->style, widget->window, state_type, 
                       shadow_type, NULL, widget, "notebook",
                       arrow, TRUE, arrow_rect.x, arrow_rect.y,