GNOME Bugzilla – Bug 125969
Scale button_pressed_event needs connect_notify()
Last modified: 2016-02-02 14:55:14 UTC
i see this bug when i want know Gtk::VScale pressed and released in my application.Pressed signal is emitted when i double click on it but released signal never emitted.Also i try it with glade-2 by creating simple widget.GTK+ is emiting these signals but gtkmm doesn't.Same thing also happened with scroolbars.They also show same behaviour.I am using gtkmm 2.2.8 version.
I need a small-as-possible-but-compileable test program in order to investigate. Or you might modify a gtkmm example to show this problem.
Created attachment 21152 [details] Gtk::Scale do not emit signal button pressed/released
Created attachment 21153 [details] Gtk::Scale do not emit signal button pressed/released
I found that it works if you use connect_notify (so that you connect before the existing signal handler). It should also work if you derived a new HScale class and overrode on_button_press_event().
Signal handlers for many X event signals are not called, if they are connected after the default handler, which is the default behaviour for SignalProxy:: connect(). Connect your signal handler before the default handler, either by using connect() with the optional 'after' parameter set to false, or by using connect_notify(). This is discussed in the gtkmm tutorial, https://developer.gnome.org/gtkmm-tutorial/stable/sec-xeventsignals.html.en#signal-handler-sequence