Merge lp:~cimi/overlay-scrollbar/fix-728664 into lp:overlay-scrollbar

Proposed by Andrea Cimitan
Status: Merged
Merged at revision: 163
Proposed branch: lp:~cimi/overlay-scrollbar/fix-728664
Merge into: lp:overlay-scrollbar
Diff against target: 63 lines (+22/-0)
1 file modified
os/os-thumb.c (+22/-0)
To merge this branch: bzr merge lp:~cimi/overlay-scrollbar/fix-728664
Reviewer Review Type Date Requested Status
Javier Jardón Approve
Review via email: mp+53736@code.launchpad.net

Description of the change

It's not meant to be approved immediately, but I've proposed the merge to start discussing it. I discovered that enter_notify and leave_notify are likely not called in the os-thumb.c class (maybe moving the code in the callbacks inside os-scrollbar.c?). By losing motion-notify and so, we are losing gtk_widget_queue_draw too for those states. Let's start improving it

To post a comment you must log in.
Revision history for this message
Andrea Cimitan (cimi) wrote :

We are losing motion-notify because of the callback in os-scrollbar.c, which is returning TRUE instead FALSE.
That's a separate issue.
Anyway, enter (and I guess leave, didn't try) notify callbacks as well in os-scrollbar.c are not getting any event.
So if you have ideas to improve that, otherwise as long as it works...

Revision history for this message
Javier Jardón (jjardon) wrote :

It works in all the user cases here too. Let's merge this until we have a better solution

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'os/os-thumb.c'
2--- os/os-thumb.c 2011-03-17 02:42:00 +0000
3+++ os/os-thumb.c 2011-03-17 04:06:24 +0000
4@@ -54,7 +54,9 @@
5 static gboolean os_thumb_expose (GtkWidget *widget, GdkEventExpose *event);
6 static gboolean os_thumb_leave_notify_event (GtkWidget *widget, GdkEventCrossing *event);
7 static gboolean os_thumb_motion_notify_event (GtkWidget *widget, GdkEventMotion *event);
8+static void os_thumb_map (GtkWidget *widget);
9 static void os_thumb_screen_changed (GtkWidget *widget, GdkScreen *old_screen);
10+static void os_thumb_unmap (GtkWidget *widget);
11 static GObject* os_thumb_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties);
12 static void os_thumb_dispose (GObject *object);
13 static void os_thumb_finalize (GObject *object);
14@@ -107,8 +109,10 @@
15 widget_class->enter_notify_event = os_thumb_enter_notify_event;
16 widget_class->expose_event = os_thumb_expose;
17 widget_class->leave_notify_event = os_thumb_leave_notify_event;
18+ widget_class->map = os_thumb_map;
19 widget_class->motion_notify_event = os_thumb_motion_notify_event;
20 widget_class->screen_changed = os_thumb_screen_changed;
21+ widget_class->unmap = os_thumb_unmap;
22
23 gobject_class->constructor = os_thumb_constructor;
24 gobject_class->get_property = os_thumb_get_property;
25@@ -182,6 +186,8 @@
26 thumb = OS_THUMB (widget);
27 priv = thumb->priv;
28
29+ gtk_grab_add (widget);
30+
31 priv->pointer_x = event->x;
32 priv->pointer_y = event->y;
33
34@@ -480,6 +486,14 @@
35 return TRUE;
36 }
37
38+static void
39+os_thumb_map (GtkWidget *widget)
40+{
41+ gtk_grab_add (widget);
42+
43+ GTK_WIDGET_CLASS (os_thumb_parent_class)->map (widget);
44+}
45+
46 static gboolean
47 os_thumb_motion_notify_event (GtkWidget *widget,
48 GdkEventMotion *event)
49@@ -515,6 +529,14 @@
50 gtk_widget_set_colormap (widget, colormap);
51 }
52
53+static void
54+os_thumb_unmap (GtkWidget *widget)
55+{
56+ gtk_grab_remove (widget);
57+
58+ GTK_WIDGET_CLASS (os_thumb_parent_class)->unmap (widget);
59+}
60+
61 static GObject*
62 os_thumb_constructor (GType type,
63 guint n_construct_properties,

Subscribers

People subscribed via source and target branches