Describe the bug
After 8.2.2709, the right side scrollbar of my GTK2 gvim disappears when the window is split vertically.
To Reproduce
gvim --clean:vsplitExpected behavior
There is a scrollbar on the left for the left window, and a scrollbar on the right for the right window.
Environment (please complete the following information):
Additional context
git bisect tells me the change was introduced by 26af8e5 in #8027 when fixing #8008.
If I add some debugging prints into the gui_mch_get_scrollbar_xpadding function, I see that before splitting,
gui.formwin->allocation.width == 516
gui.drawarea->allocation.width == 500
gui.scrollbar_width == 16
xpad == 0
And after splitting
gui.formwin->allocation.width == 532
gui.drawarea->allocation.width == 500
gui.scrollbar_width == 16
xpad == 16
It seems like it's taking into account the total width of the window and the width of the scrollbar, but not accounting for the number of scrollbars. I think in the split case, it should be subtracting 2 * gui.scrollbar_width
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
I don't know if this is the best patch for the issue, but it does the trick:
diff --git a/src/gui_gtk.c b/src/gui_gtk.c index c172fa49d..57acb5410 100644 --- a/src/gui_gtk.c +++ b/src/gui_gtk.c @@ -1019,6 +1019,10 @@ gui_mch_get_scrollbar_xpadding(void) xpad = gui.formwin->allocation.width - gui.drawarea->allocation.width - gui.scrollbar_width; #endif + if (gui.which_scrollbars[SBAR_LEFT] && gui.which_scrollbars[SBAR_RIGHT]) + { + xpad -= gui.scrollbar_width; + } return (xpad < 0) ? 0 : xpad; }
Seems to work properly even as I toggle the left or right scrollbar off through guioptions.
Thanks for coming up with a fix.
I also see these errors when scrolling the right hand window:
(gvim:47285): Gdk-CRITICAL **: 15:56:29.074: IA__gdk_drawable_get_size: assertion 'GDK_IS_DRAWABLE (drawable)' failed
These errors appeared in v8.2.4586, but disappeared in v8.2.4598.
(gvim:62138): Gdk-CRITICAL **: 10:25:42.268: IA__gdk_drawable_get_size: assertion 'GDK_IS_DRAWABLE (drawable)' failed
—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()