[libwnck] tasklist: Really fix mouse wheel scrolling with new GTK+
- From: Vincent Untz <vuntz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libwnck] tasklist: Really fix mouse wheel scrolling with new GTK+
- Date: Mon, 14 May 2012 15:44:02 +0000 (UTC)
commit 38398dcfdff701e7820f5515f57db558624a2c44
Author: Vincent Untz <vuntz gnome org>
Date: Mon May 14 17:42:32 2012 +0200
tasklist: Really fix mouse wheel scrolling with new GTK+
Because the tasklist itself has no window, I don't think we can get
scroll events for it. So we just deal with scroll events on task buttons
instead.
https://bugzilla.gnome.org/show_bug.cgi?id=673833
libwnck/tasklist.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/libwnck/tasklist.c b/libwnck/tasklist.c
index f280701..0e7a43d 100644
--- a/libwnck/tasklist.c
+++ b/libwnck/tasklist.c
@@ -673,7 +673,11 @@ wnck_tasklist_init (WnckTasklist *tasklist)
atk_object_set_name (atk_obj, _("Window List"));
atk_object_set_description (atk_obj, _("Tool to switch between visible windows"));
+#if 0
+ /* This doesn't work because, and I think this is because we have no window;
+ * therefore, we use the scroll events on task buttons instead */
gtk_widget_add_events (widget, GDK_SCROLL_MASK);
+#endif
}
static void
@@ -692,7 +696,10 @@ wnck_tasklist_class_init (WnckTasklistClass *klass)
widget_class->size_allocate = wnck_tasklist_size_allocate;
widget_class->realize = wnck_tasklist_realize;
widget_class->unrealize = wnck_tasklist_unrealize;
+#if 0
+ /* See comment above gtk_widget_add_events() in wnck_tasklist_init() */
widget_class->scroll_event = wnck_tasklist_scroll_event;
+#endif
container_class->forall = wnck_tasklist_forall;
container_class->remove = wnck_tasklist_remove;
@@ -3622,6 +3629,16 @@ wnck_task_button_press_event (GtkWidget *widget,
}
static gboolean
+wnck_task_scroll_event (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer data)
+{
+ WnckTask *task = WNCK_TASK (data);
+
+ return wnck_tasklist_scroll_event (GTK_WIDGET (task->tasklist), (GdkEventScroll *) event);
+}
+
+static gboolean
wnck_task_draw (GtkWidget *widget,
cairo_t *cr,
gpointer data);
@@ -3733,6 +3750,12 @@ wnck_task_create_widgets (WnckTask *task, GtkReliefStyle relief)
G_OBJECT (task),
0);
+ gtk_widget_add_events (task->button, GDK_SCROLL_MASK);
+ g_signal_connect_object (G_OBJECT (task->button), "scroll_event",
+ G_CALLBACK (wnck_task_scroll_event),
+ G_OBJECT (task),
+ 0);
+
g_signal_connect_object (G_OBJECT(task->button), "drag_motion",
G_CALLBACK (wnck_task_drag_motion),
G_OBJECT (task),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]