[gtk+: 1/2] Remove mouse scrolling from GtkNotebook tabs. Bug #630226.
- From: Cody Russell <bratsche src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+: 1/2] Remove mouse scrolling from GtkNotebook tabs. Bug #630226.
- Date: Tue, 21 Sep 2010 21:19:27 +0000 (UTC)
commit ad48f4d52bbac6139dd829fcc421ad16441f34d2
Author: Cody Russell <bratsche gnome org>
Date: Tue Sep 21 16:18:22 2010 -0500
Remove mouse scrolling from GtkNotebook tabs. Bug #630226.
gtk/gtknotebook.c | 49 +------------------------------------------------
1 files changed, 1 insertions(+), 48 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 09f8dde..b35f30d 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -285,8 +285,6 @@ static void gtk_notebook_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static gint gtk_notebook_expose (GtkWidget *widget,
GdkEventExpose *event);
-static gboolean gtk_notebook_scroll (GtkWidget *widget,
- GdkEventScroll *event);
static gint gtk_notebook_button_press (GtkWidget *widget,
GdkEventButton *event);
static gint gtk_notebook_button_release (GtkWidget *widget,
@@ -561,7 +559,6 @@ gtk_notebook_class_init (GtkNotebookClass *class)
widget_class->size_request = gtk_notebook_size_request;
widget_class->size_allocate = gtk_notebook_size_allocate;
widget_class->expose_event = gtk_notebook_expose;
- widget_class->scroll_event = gtk_notebook_scroll;
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;
@@ -1784,8 +1781,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_LEAVE_NOTIFY_MASK |
- GDK_SCROLL_MASK);
+ GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK);
attributes_mask = GDK_WA_X | GDK_WA_Y;
priv->event_window = gdk_window_new (gtk_widget_get_parent_window (widget),
@@ -2548,49 +2544,6 @@ get_widget_coordinates (GtkWidget *widget,
return FALSE;
}
-static gboolean
-gtk_notebook_scroll (GtkWidget *widget,
- GdkEventScroll *event)
-{
- GtkNotebook *notebook = GTK_NOTEBOOK (widget);
- GtkNotebookPrivate *priv = notebook->priv;
- GtkWidget *child, *event_widget;
- gint i;
-
- if (!priv->cur_page)
- return FALSE;
-
- child = priv->cur_page->child;
- event_widget = gtk_get_event_widget ((GdkEvent *)event);
-
- /* ignore scroll events from the content of the page */
- if (!event_widget || gtk_widget_is_ancestor (event_widget, child) || event_widget == child)
- return FALSE;
-
- /* nor from the action area */
- for (i = 0; i < 2; i++)
- {
- if (event_widget == priv->action_widget[i] ||
- (priv->action_widget[i] &&
- gtk_widget_is_ancestor (event_widget, priv->action_widget[i])))
- return FALSE;
- }
-
- switch (event->direction)
- {
- case GDK_SCROLL_RIGHT:
- case GDK_SCROLL_DOWN:
- gtk_notebook_next_page (notebook);
- break;
- case GDK_SCROLL_LEFT:
- case GDK_SCROLL_UP:
- gtk_notebook_prev_page (notebook);
- break;
- }
-
- return TRUE;
-}
-
static GList*
get_tab_at_pos (GtkNotebook *notebook, gint x, gint y)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]