summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2006-08-15 06:59:55 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2006-08-15 06:59:55 +0000
commit68b5beea4184f455d0a4a7c31c00700ac9b2eefe (patch)
tree6137a516cb996bf9c9d6da9fa874ad8ccb2ccc68
parentda54d67905dca756e811cf33f870864570f6c752 (diff)
downloadgtk+-68b5beea4184f455d0a4a7c31c00700ac9b2eefe.tar.gz
Remove. (gtk_notebook_motion_notify): Instead, update the arrow state
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)
-rw-r--r--ChangeLog4
-rw-r--r--ChangeLog.pre-2-104
-rw-r--r--gtk/gtknotebook.c51
3 files changed, 21 insertions, 38 deletions
diff --git a/ChangeLog b/ChangeLog
index 8de472d0f4..ba6c9a57fa 100644
--- 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)
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 8de472d0f4..ba6c9a57fa 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -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)
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 5608498507..ba63f13a03 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -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;
@@ -2660,35 +2656,6 @@ gtk_notebook_button_release (GtkWidget *widget,
}
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,