From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#28605: 26.0.60; Part of leftmost character hidden Date: Wed, 04 Oct 2017 13:56:54 +0200 Message-ID: <87tvzfjfcp.fsf@gmail.com> References: <59CB5D69.7040404@gmx.at> <59CE05F2.1010202@gmx.at> <59CE8E74.5010308@gmx.at> <59D35549.6030905@gmx.at> <87wp4c750c.fsf@gmail.com> <59D4A45F.5010606@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1507118294 20799 195.159.176.226 (4 Oct 2017 11:58:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 4 Oct 2017 11:58:14 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) Cc: Lars Magne Ingebrigtsen , 28605@debbugs.gnu.org, Kaushal To: Ola Nilsson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 04 13:58:10 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dziJQ-0004H8-7v for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Oct 2017 13:58:04 +0200 Original-Received: from localhost ([::1]:34596 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dziJX-0001H6-R0 for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Oct 2017 07:58:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dziJS-0001H0-JU for bug-gnu-emacs@gnu.org; Wed, 04 Oct 2017 07:58:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dziJO-0003X8-Jb for bug-gnu-emacs@gnu.org; Wed, 04 Oct 2017 07:58:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38986) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dziJO-0003Wn-FS for bug-gnu-emacs@gnu.org; Wed, 04 Oct 2017 07:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dziJO-0004G5-7B for bug-gnu-emacs@gnu.org; Wed, 04 Oct 2017 07:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Oct 2017 11:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28605 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28605-submit@debbugs.gnu.org id=B28605.150711822516299 (code B ref 28605); Wed, 04 Oct 2017 11:58:02 +0000 Original-Received: (at 28605) by debbugs.gnu.org; 4 Oct 2017 11:57:05 +0000 Original-Received: from localhost ([127.0.0.1]:47667 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dziIT-0004Eo-As for submit@debbugs.gnu.org; Wed, 04 Oct 2017 07:57:05 -0400 Original-Received: from mail-wm0-f44.google.com ([74.125.82.44]:47144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dziIR-0004EB-QG for 28605@debbugs.gnu.org; Wed, 04 Oct 2017 07:57:04 -0400 Original-Received: by mail-wm0-f44.google.com with SMTP id t69so22272636wmt.2 for <28605@debbugs.gnu.org>; Wed, 04 Oct 2017 04:57:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:gmane-reply-to-list:date:in-reply-to :message-id:user-agent:mime-version; bh=Ks3StDVxfGwDHzG7qQqU5r+KiYT3hMZx/JUkl/si04U=; b=brQ+npv2575pMB4GzYQz90KjIjJ4oQlRYWd3EQdrVCj2eNd9djIUNlEz9blgfEVtP/ QoaSRfRMxKFsynQo1ofcdcIy3KLJsgI4jjqQ16oLReretPUWkAiQpdy8xR8CWoDMvslb fiOu93dHMYhAdBKKbbAKA52s6gOVoarkPwA/zFjYHq5HkMtlzBnHelfWn8p+PBj9PkFQ 0m+HV/rd4Ev7TmVgBzc/Z9FlJ6BNMHyjHCNbmjrkCsEltsUjrG/7DerXds2cX+fjm2TG nOqvPcO52ubaHHduHBTuVIulXWfj6VmwSYSDHfOWxiBkIY4aRDt/FBo7zyMR0iBowdXQ YXHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references :gmane-reply-to-list:date:in-reply-to:message-id:user-agent :mime-version; bh=Ks3StDVxfGwDHzG7qQqU5r+KiYT3hMZx/JUkl/si04U=; b=MlCt5VnBpUVCKJWReudXaOifR6JvkdMY1jcT7LETdzQUhdfbhQXnBl7Jzh6VQZssJR Ncxub2PpYExe/iTyE08oyItPUsMMcgdvxw8RAFB2uPNmnjT1ZNuXkjsgQ/c8Mkcu0SQL QN/DyH/eT2GlGDYBLA+3xONoT0ZOhv4/UEG9mAsJKFFcwBXygmxmk/3q8+Vm2zzfYZ1u Sb8gmkxyeJzM31z3gPAdTrDFqt7IISYvLcozJOHpug2OVFQravX7C54hhkf0sO0pBKsF 3FjsU2B1G76O78lfi72c/cAjlYjCkOqRoSBE2BSHkKZd3vUV6hrpX/+T6LiLij2BjbXv w2iQ== X-Gm-Message-State: AHPjjUiSd/E8LZPA/43HWRMoOPK5q1kKz863h2H3VqacfYebrwb5Qlbi VbdrlXkHdYyJxajE93HpCAM= X-Google-Smtp-Source: AOwi7QCc16vzofbMF+G/gH9C+3GsfEeBau4B9NxA+VoLrSffJoxmVT3I15qfSkf1Urq8Mp8kBPqlgw== X-Received: by 10.80.136.81 with SMTP id c17mr28124602edc.13.1507118217899; Wed, 04 Oct 2017 04:56:57 -0700 (PDT) Original-Received: from rpluim-ubuntu ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id h56sm15834845ede.15.2017.10.04.04.56.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Oct 2017 04:56:56 -0700 (PDT) Gmane-Reply-To-List: yes In-Reply-To: (Ola Nilsson's message of "Wed, 4 Oct 2017 11:59:44 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:137899 Archived-At: Ola Nilsson writes: > On Wed, Oct 4, 2017 at 11:05 AM, martin rudalics wrote: >>On Tue, Oct 3, 2017 at 6:58 PM, Ola Nilsson wrote: >>> This works for me: >>> >>> @@ -3883,7 +3883,7 @@ xg_update_scrollbar_pos (struct frame *f, >>> top /= scale; >>> left /= scale; >>> height /= scale; >>> - left -= (scale - 1) * ((width / scale) >> 1); >>> + width /= scale; >> >> Deceptively simple. Whatever was that left rigmarole needed for? >> What changes with >> >> width /= scale; >> left -= (scale - 1) * (width >> 1); > > From the top of my head, the vertical scrollbar is placed to far to the left > overlapping the window to the left and leaving a white band between the > scroll bar and the left-fringe of the window to the right. > It does nothing if scale is 1, obviously. Yes, I think removing the calculation for left is the correct fix (at least it looks correct here). The horizontal scrollbars need fixing as well, see below. xg_update_scrollbar_pos and xg_update_horizontal_scrollbar_pos are now 99% identical apart from the 'hidden' check. I don't think this will be the final version: I sometimes get the echo area being the wrong size... diff --git a/src/gtkutil.c b/src/gtkutil.c index 0da7039..b41e8f1 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -3879,7 +3879,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; @@ -3955,6 +3955,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; @@ -3981,8 +3987,12 @@ xg_update_horizontal_scrollbar_pos (struct frame *f, gtk_widget_set_size_request (wscroll, width, height); } if (oldx != -1 && oldw > 0 && oldh > 0) - /* Clear under old scroll bar position. */ - x_clear_area (f, oldx, oldy, oldw, oldh); + { + /* Clear under old scroll bar position. */ + oldw += (scale - 1) * oldw; + oldx -= (scale - 1) * oldw; + x_clear_area (f, oldx, oldy, oldw, oldh); + } /* GTK does not redraw until the main loop is entered again, but if there are no X events pending we will not enter it. So we sync