From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Aaron Jensen Newsgroups: gmane.emacs.bugs Subject: bug#31546: 27.0.50; macOS child frames with no mode-line mouse click problem Date: Sun, 27 May 2018 10:52:39 -0700 Message-ID: References: <20180523213124.GC36578@breton.holly.idiocy.org> <5B06679A.2020407@gmx.at> <83o9h5ax8n.fsf@gnu.org> <20180526163844.GA16324@breton.holly.idiocy.org> <20180526182215.GA18042@breton.holly.idiocy.org> <5B0A4EC3.6080403@gmx.at> <83h8mt851r.fsf@gnu.org> <8336yd80cy.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1527443470 990 195.159.176.226 (27 May 2018 17:51:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 27 May 2018 17:51:10 +0000 (UTC) Cc: 31546@debbugs.gnu.org, Alan Third To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 27 19:51:06 2018 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 1fMzov-0000Ak-C0 for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 May 2018 19:51:05 +0200 Original-Received: from localhost ([::1]:52822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMzr2-0007JK-KN for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 May 2018 13:53:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMzqt-0007J6-60 for bug-gnu-emacs@gnu.org; Sun, 27 May 2018 13:53:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMzqo-0000fe-Ud for bug-gnu-emacs@gnu.org; Sun, 27 May 2018 13:53:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43325) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMzqo-0000fW-Qx for bug-gnu-emacs@gnu.org; Sun, 27 May 2018 13:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fMzqo-0005lP-FV for bug-gnu-emacs@gnu.org; Sun, 27 May 2018 13:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Aaron Jensen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 May 2018 17:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31546 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31546-submit@debbugs.gnu.org id=B31546.152744357822145 (code B ref 31546); Sun, 27 May 2018 17:53:02 +0000 Original-Received: (at 31546) by debbugs.gnu.org; 27 May 2018 17:52:58 +0000 Original-Received: from localhost ([127.0.0.1]:51222 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fMzqj-0005l7-S5 for submit@debbugs.gnu.org; Sun, 27 May 2018 13:52:58 -0400 Original-Received: from mail-qk0-f178.google.com ([209.85.220.178]:39305) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fMzqi-0005ks-66 for 31546@debbugs.gnu.org; Sun, 27 May 2018 13:52:56 -0400 Original-Received: by mail-qk0-f178.google.com with SMTP id z75-v6so7673414qkb.6 for <31546@debbugs.gnu.org>; Sun, 27 May 2018 10:52:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eHG76BV2bS2s2Fj8OlXDmFgAngGD8KSGA8O3iteMkU0=; b=izh95PactqFJ8EcorgvIl4QXqm+q/6PPevf68Bf+/ERVEVvcYYgC2vWIh9RK81XQP2 ki0f0jM7xo8RnrUVN1FAxDO6zJiDyaIBv0bcq3D+pypF2kmcL6HFgh/gADRwy7jEcr+7 OlvejD2YK7oXQp4tfZ+9y9X4xbBvfc6RnDH5n5qux0iUQd1AdBdtMXfFzQ6oFOPmiylt AyjpC+laZm8du/8qg1j/nEdFMv5IyO4GRti71YclS2zFH68xL4eOIfSRZaTFFZg2mbiG 9r/e76CRaH+VIlo3L+6INJpj9qNVkjx7R8tVBHJujnjn7No87Q8ItuJxWkP8/fS7LS7/ 3UcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eHG76BV2bS2s2Fj8OlXDmFgAngGD8KSGA8O3iteMkU0=; b=jDPo248xD99it3Q8jT5bKYdcARrBeVIGU+rRIWCWe8HRZFpae79sv5Mr8F728vumoD 1fK4XlBNlm6RtufuVrGkMZOMNC27WkygPsNHz4V59zdQVPcXsr9yOhzVbAsWIxe9NxWH Ty4ALSRX9415jrXGnctcKu+I9ARTjOrOgKZ3xzbWhh+dRgo7d0m/VZsOERxxSWqglK/5 q2bzB6Zz9y44Vy7M+Y1SLtc3fOYBaos49HtanCSO4MhxshX+nvdka1aLKDhhp0JJYF1V +A8pXokUJtD4jRu+jjQLE1T70QXwyT/7ELiw44Bc0AU3e5Qk6Qb53Sb6QZvkOqWTES4n F1Zw== X-Gm-Message-State: ALKqPwfqjZJkp29a0VLZM6QsBnEQHTFKh74KIBDYrX2F3E/goF/ee8Pj 4lp4YCvoYFAaFwlTlUVaqT6x8kLVJvox4NrOqwk= X-Google-Smtp-Source: ADUXVKKrl9NmiYNzvMQHbxo9hfmKrgnRT6cvAGcE8Z3p0Q6tawv1I8vRbJ12ghss2SJss1eSyl9980nx4ApoTq60FjI= X-Received: by 2002:a37:b204:: with SMTP id b4-v6mr9379588qkf.149.1527443570721; Sun, 27 May 2018 10:52:50 -0700 (PDT) In-Reply-To: <8336yd80cy.fsf@gnu.org> 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:146609 Archived-At: On Sun, May 27, 2018 at 10:39 AM Eli Zaretskii wrote: > > From: Aaron Jensen > > Date: Sun, 27 May 2018 10:13:55 -0700 > > Cc: martin rudalics , Alan Third , 31546@debbugs.gnu.org > > > > On Sun, May 27, 2018 at 8:58 AM Eli Zaretskii wrote: > > > Based on the description, I think it's redisplay that's scrolling, > > > because the mouse click sets point in a line that is visible only > > > partially. > > > > To be clear, this is only true if my patch is applied. If my patch is not > > applied, clicking on the last line of a frame that has no minibuffer and no > > mode-line also triggers the scroll as well because the fact that it has no > > mode-line is not taken into account. > Not sure I understand the connection between not having a mode line > and the scroll. Can you elaborate? Apologies if this was already > explained up-thread. I'm not sure I can explain the actual mechanism as to why it matters, but I'll explain what I can see. In mouse-drag-track, the bottom of the window is calculated: (bottom (if (window-minibuffer-p start-window) (nth 3 bounds) ;; Don't count the mode line. (1- (nth 3 bounds)))) I'm guessing this is somehow used to determine whether or not to scroll the clicked location into view. The calculation is wrong if there is no mode-line because it subtracts 1 unnecessarily. My patch adds to the condition a check for the mode line format and does not subtract 1 if that is nil. Actually, looking at the code that's exactly what's happening: (cond ((null mouse-row)) ((< mouse-row top) (mouse-scroll-subr start-window (- mouse-row top) nil start-point)) ((>= mouse-row bottom) (mouse-scroll-subr start-window (1+ (- mouse-row bottom)) nil start-point))) If the location clicked is >= to the bottom (which is miscalculated without my patch when there is no mode-line and it is >= in the case of a partial line visibility) then the window is scrolled, explicitly. So, that's the problem afaict.