Subject: Re: bug#28605: 26.0.60; Part of leftmost character hidden

From: Robert Pluim <[email-masked]>
Date: Tue, 19 Dec 2017 09:10:33 +0100

Eli Zaretskii <[email-masked]> writes:

> On December 19, 2017 9:02:33 AM GMT+02:00, martin rudalics <[email-masked]> wrote:
>> > I'm perfectly happy to have it applied by someone with commit rights
>>  > (my paperwork is complete). As a bugfix I think it should go on the
>>  > release branch, but that's not my decision to make.
>> 
>> Eli, is it OK to install Robert's patch on the release branch?  To me
>> it
>> seems the best we have so far and any glitches it might add should be
>> tolerable.  And it could suppress complaints that some faulty behavior
>> now already persists through three or four Emacs versions ...
>> 
>> martin
>
> Please show tbe actual patch you are asking about.  This has been a long discussion with quite a few patches, and I'd like to know what I'm asked to approve.

Attached.

Regards

Robert

>From 074d39597b1cff03053e369cf89ee701874afddb Mon Sep 17 00:00:00 2001
From: Robert Pluim <[email-masked]>
Date: Tue, 10 Oct 2017 16:20:50 +0200
Subject: [PATCH] Adjust scrollbar dimensions when scaling

2017-10-10  Robert Pluim  <[email-masked]>

	* src/gtkutil.c (xg_update_scrollbar_pos): Update width of
	scrollbar when scaling is in effect
	(xg_update_horizontal_scrollbar_pos): Update scrollbar size
	when scaling is in effect.
---
 src/gtkutil.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/gtkutil.c b/src/gtkutil.c
index c7d8f92829..88b7fd7e7b 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3890,7 +3890,7 @@ xg_update_scrollbar_pos (struct frame *f,
       top /= scale;
       left /= scale;
       height /= scale;
-      left -= (scale - 1) * ((width / scale) >> 1);
+      width /= scale;
 
       /* Clear out old position.  */
       int oldx = -1, oldy = -1, oldw, oldh;
@@ -3966,6 +3966,12 @@ xg_update_horizontal_scrollbar_pos (struct frame *f,
       GtkWidget *wfixed = f->output_data.x->edit_widget;
       GtkWidget *wparent = gtk_widget_get_parent (wscroll);
       gint msl;
+      int scale = xg_get_scale (f);
+
+      top /= scale;
+      left /= scale;
+      height /= scale;
+      width /= scale;
 
       /* Clear out old position.  */
       int oldx = -1, oldy = -1, oldw, oldh;
-- 
2.15.0.rc1