From 28f1a51bde36e2770dd54c9e2ae69a26cafa5a64 Mon Sep 17 00:00:00 2001 From: qsmodo <75080827+qsmodo@users.noreply.github.com> Date: Mon, 7 Feb 2022 15:57:50 +0000 Subject: patch 8.2.4320: Athena and Motif: when maximized scrollbar position is wrong Problem: Athena and Motif: when maximized scrollbar position is wrong. Solution: Implement the scrollbar padding functions. (closes #9712) --- src/gui_motif.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src/gui_motif.c') diff --git a/src/gui_motif.c b/src/gui_motif.c index 8328045bab..ef3747d8d2 100644 --- a/src/gui_motif.c +++ b/src/gui_motif.c @@ -1745,17 +1745,27 @@ gui_mch_set_scrollbar_pos( int gui_mch_get_scrollbar_xpadding(void) { - // TODO: Calculate the padding for adjust scrollbar position when the - // Window is maximized. - return 0; + int xpad; + Dimension tw, ww; + Position tx; + + XtVaGetValues(textArea, XtNwidth, &tw, XtNx, &tx, NULL); + XtVaGetValues(vimShell, XtNwidth, &ww, NULL); + xpad = ww - tw - tx - gui.scrollbar_width; + return (xpad < 0) ? 0 : xpad; } int gui_mch_get_scrollbar_ypadding(void) { - // TODO: Calculate the padding for adjust scrollbar position when the - // Window is maximized. - return 0; + int ypad; + Dimension th, wh; + Position ty; + + XtVaGetValues(textArea, XtNheight, &th, XtNy, &ty, NULL); + XtVaGetValues(vimShell, XtNheight, &wh, NULL); + ypad = wh - th - ty - gui.scrollbar_height; + return (ypad < 0) ? 0 : ypad; } void -- cgit v1.2.3