Re: Scrolling to a GtkListBoxRow after adding it to a GtkListBox
- From: Michael Gratton <mike vee net>
- To: "Matthew A. Postiff" <postiffm comcast net>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Scrolling to a GtkListBoxRow after adding it to a GtkListBox
- Date: Tue, 17 Apr 2018 13:31:08 +1000
On Sun, Apr 15, 2018 at 1:05 PM, "Matthew A. Postiff"
<postiffm comcast net> wrote:
Is the issue that the widget is not yet drawn, so it size/location
coords are not settled yet?
I originally thought so, but when it occurred it looked like it was
actually be correctly getting scrolled to but then scrolled away again
straight away.
Turns out the problem was actually GtkScrolledWindow's kinetic
scrolling. I finally noticed that it only happened if a scroll gesture
still had some momentum — the newly inserted row would be correctly
scrolled to, but jump away immediately as the gesture kicked back in.
To work around the issue, I had to disable kinetic scrolling on the
scrolled window, set the adjustment's value, then re-enable kinetic
scrolling again.
GTK+ bug filed for this: https://gitlab.gnome.org/GNOME/gtk/issues/187
Total guesses: What about using g_signal_connect_after on
size-allocate? Or connecting to map-event signal on that widget? Or
spinning on gtk_events_pending() until all are done, then scroll down?
Good suggestions, but size-allocate does indeed seem to be the right
signal.
Thanks for your help!
//Mike
--
⊨ Michael Gratton, Percept Wrangler.
⚙ <http://mjog.vee.net/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]