Merge lp:~mhr3/ido/bug-865122 into lp:ido/0.3

Proposed by Michal Hruby
Status: Superseded
Proposed branch: lp:~mhr3/ido/bug-865122
Merge into: lp:ido/0.3
Diff against target: 48 lines (+24/-0)
1 file modified
src/idorange.c (+24/-0)
To merge this branch: bzr merge lp:~mhr3/ido/bug-865122
Reviewer Review Type Date Requested Status
Sebastien Bacher Needs Fixing
Robert Carr (community) Approve
Review via email: mp+77923@code.launchpad.net

This proposal has been superseded by a proposal from 2011-10-03.

Description of the change

This installs an empty object method handler for the grab-notify signal on IdoRange, without this, GtkRange will call remove_grab which results in an infinite loop of grab_notifies.

The widget will still work properly, because grab-broken-event will get properly fired and internal state of GtkRange will be properly updated.

To post a comment you must log in.
Revision history for this message
Robert Carr (robertcarr) wrote :

+1 for now? I want to investigate this all again later.

review: Approve
Revision history for this message
Sebastien Bacher (seb128) wrote :

That code should probably be used only when building with gtk3, the source is used in Oneiric to build both the gtk2 and gtk3 versions of ido (different configure option)

review: Needs Fixing
lp:~mhr3/ido/bug-865122 updated
96. By Michal Hruby

Use the grab-notify workaround only when using Gtk3

Revision history for this message
Andrea Cimitan (cimi) wrote :

As seb said, we need the check for the gtk3 version plus (I'd recommend) put a FIXME in the code to remember why we are adding this workaround

lp:~mhr3/ido/bug-865122 updated
97. By Michal Hruby

And we need to include config.h

98. By Michal Hruby

Get rid of unnecessary check

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/idorange.c'
2--- src/idorange.c 2011-06-01 19:53:29 +0000
3+++ src/idorange.c 2011-10-03 13:04:23 +0000
4@@ -40,6 +40,10 @@
5 guint prop_id,
6 GValue *value,
7 GParamSpec *pspec);
8+#ifdef USE_GTK3
9+static void ido_range_grab_notify (GtkWidget *widget,
10+ gboolean was_grabbed);
11+#endif
12
13 #define IDO_RANGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), IDO_TYPE_RANGE, IdoRangePrivate))
14
15@@ -60,6 +64,10 @@
16 gobject_class->set_property = ido_range_set_property;
17 gobject_class->get_property = ido_range_get_property;
18
19+#ifdef USE_GTK3
20+ widget_class->grab_notify = ido_range_grab_notify;
21+#endif
22+
23 g_object_class_install_property (gobject_class,
24 PROP_STYLE,
25 g_param_spec_enum ("range-style",
26@@ -130,6 +138,22 @@
27 }
28 }
29
30+#ifdef USE_GTK3
31+static void
32+ido_range_grab_notify (GtkWidget *widget, gboolean was_grabbed)
33+{
34+ /*
35+ * FIXME: workaround for lp bug #865122.
36+ * Without this handler, GtkRange will call remove_grab which results
37+ * in an infinite loop of grab_notifies.
38+ *
39+ * The widget will still work properly, because grab-broken-event will get
40+ * properly fired and internal state of GtkRange will be properly updated.
41+ */
42+ g_return_if_fail (IDO_IS_RANGE (widget));
43+}
44+#endif
45+
46 static void
47 ido_range_constructed (GObject *object)
48 {

Subscribers

People subscribed via source and target branches