[vim/vim] Right scrollbar disappears after vsplit (#8324)

54 views
Skip to first unread message

Matt Wozniski

unread,
Jun 4, 2021, 6:02:08 PM6/4/21
to vim/vim, Subscribed

Describe the bug
After 8.2.2709, the right side scrollbar of my GTK2 gvim disappears when the window is split vertically.

To Reproduce

  1. Run gvim --clean
  2. Run :vsplit

Expected behavior
There is a scrollbar on the left for the left window, and a scrollbar on the right for the right window.

Screenshots
image
image

Environment (please complete the following information):

  • Vim version: 8.2.2709 onwards
  • OS: Linux (though with a Windows X server)
  • Terminal: GUI

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.

Matt Wozniski

unread,
Jun 4, 2021, 6:26:23 PM6/4/21
to vim/vim, Subscribed

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.

Bram Moolenaar

unread,
Jun 5, 2021, 9:57:43 AM6/5/21
to vim/vim, Subscribed

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

Bram Moolenaar

unread,
Jun 5, 2021, 10:08:18 AM6/5/21
to vim/vim, Subscribed

Closed #8324 via 84e9ade.

Mark Waggoner

unread,
Oct 13, 2021, 8:18:16 PM10/13/21
to vim_dev
Even after this fix, I get these errors when scrolling if scrollbars are present on both sides of the window:
(gvim:31619): Gdk-CRITICAL **: IA__gdk_drawable_get_size: assertion 'GDK_IS_DRAWABLE (drawable)' failed

Bram Moolenaar

unread,
Oct 17, 2021, 4:48:03 PM10/17/21
to vim...@googlegroups.com, Mark Waggoner

Mark Waggoner wrote:

> Even after this fix, I get these errors when scrolling if scrollbars
> are present on both sides of the window:
> (gvim:31619): Gdk-CRITICAL **: IA__gdk_drawable_get_size: assertion
> 'GDK_IS_DRAWABLE (drawable)' failed

I do not see these errors. Perhaps it depends on the version of the
GTK-3 library?

--
hundred-and-one symptoms of being an internet addict:
180. You maintain more than six e-mail addresses.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Mark Waggoner

unread,
Oct 29, 2021, 8:13:58 PM10/29/21
to vim_dev
Yes, it does depend on the version of GTK.  I get the errors if I compile with gtk+ 2 and I do not get the errors if I compile with gtk+ 3.   If I can find more information, I will.

chenlongaa

unread,
Mar 20, 2022, 10:36:13 AM3/20/22
to vim/vim, Subscribed

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.Message ID: <vim/vim/issues/8324/1073264262@github.com>

Reply all
Reply to author
Forward
0 new messages