GtkTextView auto-scrolling to insert mark upon focus changes due to input-methods
Steps to reproduce
- Only tested on Wayland, but with flatpak and jhbuild.
- Open gedit or Builder with a large'ish file
- Scroll the insertion mark out of view
- Unfocus the editor such as Super+Click to drag the window around
Current behavior
This is a regression of behavior and the insertion mark auto scrolls into view due to input methods.
Expected outcome
No scrolling in the view.
Version information
On Fedora 28 with gtk+ 3.22.29, I did not see the issue with gedit. But when running gedit with gtk+ from jhbuild, I did see the issue. (jhbuild run gedit
).
When running Builder from flatpak or jhbuild I see the issue.
Stack trace
I can trigger this in a number of ways on focus in/out, raising/lowering the window, etc. A common bit of stack looks like:
#1 0x00007ffff6404ee1 in gtk_text_view_scroll_mark_onscreen (text_view=0x555556f17490, mark=0x555555f487a0) at /home/christian/Projects/gtk+-3/gtk/gtktextview.c:2819
#2 0x00007ffff6413245 in gtk_text_view_preedit_changed_handler (context=0x5555562d95b0, text_view=0x555556f17490) at /home/christian/Projects/gtk+-3/gtk/gtktextview.c:9154
#3 0x00007ffff6a35e58 in g_cclosure_marshal_VOID__VOIDv (closure=0x555556f14e50, return_value=0x0, instance=0x5555562d95b0, args=0x7fffffffae38, marshal_data=0x0,
n_params=0, param_types=0x0) at /home/christian/Projects/glib/gobject/gmarshal.c:905
#4 0x00007ffff6a32d5f in _g_closure_invoke_va (closure=0x555556f14e50, return_value=0x0, instance=0x5555562d95b0, args=0x7fffffffae38, n_params=0, param_types=0x0)
at /home/christian/Projects/glib/gobject/gclosure.c:867
#5 0x00007ffff6a4eb4d in g_signal_emit_valist (instance=0x5555562d95b0, signal_id=364, detail=0, var_args=0x7fffffffae38)
at /home/christian/Projects/glib/gobject/gsignal.c:3300
#6 0x00007ffff6a4fef8 in g_signal_emit_by_name (instance=0x5555562d95b0, detailed_signal=0x7ffff6546e2c "preedit-changed")
at /home/christian/Projects/glib/gobject/gsignal.c:3487
#7 0x00007ffff629e18d in gtk_im_multicontext_preedit_changed_cb (slave=0x5555563d3680, multicontext=0x5555562d95b0)
at /home/christian/Projects/gtk+-3/gtk/gtkimmulticontext.c:515
#8 0x00007ffff6a35e58 in g_cclosure_marshal_VOID__VOIDv (closure=0x555556fd59d0, return_value=0x0, instance=0x5555563d3680, args=0x7fffffffb2e8, marshal_data=0x0,
n_params=0, param_types=0x0) at /home/christian/Projects/glib/gobject/gmarshal.c:905
#9 0x00007ffff6a32d5f in _g_closure_invoke_va (closure=0x555556fd59d0, return_value=0x0, instance=0x5555563d3680, args=0x7fffffffb2e8, n_params=0, param_types=0x0)
at /home/christian/Projects/glib/gobject/gclosure.c:867
#10 0x00007ffff6a4eb4d in g_signal_emit_valist (instance=0x5555563d3680, signal_id=364, detail=0, var_args=0x7fffffffb2e8)
at /home/christian/Projects/glib/gobject/gsignal.c:3300
#11 0x00007ffff6a4fef8 in g_signal_emit_by_name (instance=0x5555563d3680, detailed_signal=0x7fffa737ff4f "preedit-changed")
at /home/christian/Projects/glib/gobject/gsignal.c:3487
#12 0x00007fffa737eea7 in reset_preedit (context=0x5555563d3680) at /home/christian/Projects/gtk+-3/modules/input/imwayland.c:105
#13 0x00007fffa737fae3 in gtk_im_context_wayland_reset (context=0x5555563d3680) at /home/christian/Projects/gtk+-3/modules/input/imwayland.c:544
#14 0x00007ffff62990d0 in gtk_im_context_reset (context=0x5555563d3680) at /home/christian/Projects/gtk+-3/gtk/gtkimcontext.c:578
#15 0x00007ffff629df5c in gtk_im_multicontext_reset (context=0x5555562d95b0) at /home/christian/Projects/gtk+-3/gtk/gtkimmulticontext.c:429
#16 0x00007ffff62990d0 in gtk_im_context_reset (context=0x5555562d95b0) at /home/christian/Projects/gtk+-3/gtk/gtkimcontext.c:578
#17 0x00007ffff64113a8 in gtk_text_view_reset_im_context (text_view=0x555556f17490) at /home/christian/Projects/gtk+-3/gtk/gtktextview.c:8189
#18 0x00007ffff640b057 in gtk_text_view_multipress_gesture_pressed (gesture=0x555556232f60, n_press=1, x=265, y=434, text_view=0x555556f17490)