Commit Graph

2 Commits (f5d7f518fa2162f22e67e242ef95109770233493)

Author SHA1 Message Date
Gonçalo Silva ac7e18b0b3 Improve auto-scrolling after pasting very large documents
There were 2 problems.

When pasting very large documents, the height calculations will be
temporarily incorrect while the content is rendered over several frames.
This is addressed by waiting for the UI to be idle to scroll.

Additionally, the scroll time (typically 200ms) needs an adjustment as
well. Starting at 200ms, it now scales linearly with distance, amounting
to roughly 4 seconds with Pandoc's user guide.
2019-04-13 02:00:13 +01:00
Gonçalo Silva 372d2c8a65 Remove tick callback after scrolling is done
Adding a tick callback starts updating the frame clock:
d1cdb9b5cf/gtk/gtkwidget.c (L3629)

Gdk's documentation implies that this is taxing, as it continuously
requests a new frame (which makes sense, this API is for animations):
https://developer.gnome.org/gdk3/stable/GdkFrameClock.html#gdk-frame-clock-begin-updating

Most likely fixes #75
2019-04-13 02:00:13 +01:00