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

Proposed by Michal Hruby on 2011-10-03
Status: Merged
Merged at revision: 95
Proposed branch: lp:~mhr3/ido/bug-865122
Merge into: lp:ido/0.3
Diff against target: 55 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 2011-10-03 Approve on 2011-10-03
Robert Carr (community) 2011-10-03 Approve on 2011-10-03
Review via email: mp+77930@code.launchpad.net

This proposal supersedes 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.
Robert Carr (robertcarr) wrote : Posted in a previous version of this proposal

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

review: Approve
Sebastien Bacher (seb128) wrote : Posted in a previous version of this proposal

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
Andrea Cimitan (cimi) wrote : Posted in a previous version of this proposal

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

Robert Carr (robertcarr) wrote :

+1 but probably don't need the g_return_if_fail.

review: Approve
Andrea Cimitan (cimi) wrote :

 I'd remove g_return_if_fail (IDO_IS_RANGE (widget)); from the internal function, because being internal it will never fail. (g_return checks are ok and required to public functions, while redundant on internal vfuncs)

lp:~mhr3/ido/bug-865122 updated on 2011-10-03
97. By Michal Hruby on 2011-10-03

And we need to include config.h

98. By Michal Hruby on 2011-10-03

Get rid of unnecessary check

Sebastien Bacher (seb128) wrote :

seems fine to me

review: Approve

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 14:55:34 +0000
4@@ -25,6 +25,7 @@
5
6 #include "idorange.h"
7 #include "idotypebuiltins.h"
8+#include "config.h"
9
10 struct _IdoRangePrivate
11 {
12@@ -40,6 +41,10 @@
13 guint prop_id,
14 GValue *value,
15 GParamSpec *pspec);
16+#ifdef USE_GTK3
17+static void ido_range_grab_notify (GtkWidget *widget,
18+ gboolean was_grabbed);
19+#endif
20
21 #define IDO_RANGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), IDO_TYPE_RANGE, IdoRangePrivate))
22
23@@ -60,6 +65,10 @@
24 gobject_class->set_property = ido_range_set_property;
25 gobject_class->get_property = ido_range_get_property;
26
27+#ifdef USE_GTK3
28+ widget_class->grab_notify = ido_range_grab_notify;
29+#endif
30+
31 g_object_class_install_property (gobject_class,
32 PROP_STYLE,
33 g_param_spec_enum ("range-style",
34@@ -130,6 +139,21 @@
35 }
36 }
37
38+#ifdef USE_GTK3
39+static void
40+ido_range_grab_notify (GtkWidget *widget, gboolean was_grabbed)
41+{
42+ /*
43+ * FIXME: workaround for lp bug #865122.
44+ * Without this handler, GtkRange will call remove_grab which results
45+ * in an infinite loop of grab_notifies.
46+ *
47+ * The widget will still work properly, because grab-broken-event will get
48+ * properly fired and internal state of GtkRange will be properly updated.
49+ */
50+}
51+#endif
52+
53 static void
54 ido_range_constructed (GObject *object)
55 {

Subscribers

People subscribed via source and target branches