summaryrefslogtreecommitdiffstats
path: root/src/gui_athena.c
diff options
context:
space:
mode:
authorqsmodo <75080827+qsmodo@users.noreply.github.com>2022-02-07 15:57:50 +0000
committerBram Moolenaar <Bram@vim.org>2022-02-07 15:57:50 +0000
commit28f1a51bde36e2770dd54c9e2ae69a26cafa5a64 (patch)
tree13ffaea9fbf64f42af13e039f2adcc5f4922d110 /src/gui_athena.c
parent4e713bafc0ae191b1830e3cd3c323ebd695bc3a1 (diff)
patch 8.2.4320: Athena and Motif: when maximized scrollbar position is wrongv8.2.4320
Problem: Athena and Motif: when maximized scrollbar position is wrong. Solution: Implement the scrollbar padding functions. (closes #9712)
Diffstat (limited to 'src/gui_athena.c')
-rw-r--r--src/gui_athena.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/gui_athena.c b/src/gui_athena.c
index db13bd34f7..6cbabf81d2 100644
--- a/src/gui_athena.c
+++ b/src/gui_athena.c
@@ -1894,17 +1894,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