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 11:52:36 -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 1527447069 12422 195.159.176.226 (27 May 2018 18:51:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 27 May 2018 18:51:09 +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 20:51:04 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 1fN0kx-00034M-5g for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 May 2018 20:51:03 +0200 Original-Received: from localhost ([::1]:52941 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fN0n2-0006AT-Lf for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 May 2018 14:53:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fN0mw-0006AB-Lq for bug-gnu-emacs@gnu.org; Sun, 27 May 2018 14:53:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fN0ms-00017o-NR for bug-gnu-emacs@gnu.org; Sun, 27 May 2018 14:53:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43360) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fN0ms-00017i-JY for bug-gnu-emacs@gnu.org; Sun, 27 May 2018 14:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fN0ms-0000eO-3S for bug-gnu-emacs@gnu.org; Sun, 27 May 2018 14: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 18: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.15274471752489 (code B ref 31546); Sun, 27 May 2018 18:53:02 +0000 Original-Received: (at 31546) by debbugs.gnu.org; 27 May 2018 18:52:55 +0000 Original-Received: from localhost ([127.0.0.1]:51257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fN0ml-0000e4-BW for submit@debbugs.gnu.org; Sun, 27 May 2018 14:52:55 -0400 Original-Received: from mail-qk0-f194.google.com ([209.85.220.194]:44520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fN0mj-0000ds-Il for 31546@debbugs.gnu.org; Sun, 27 May 2018 14:52:53 -0400 Original-Received: by mail-qk0-f194.google.com with SMTP id 185-v6so7732168qkk.11 for <31546@debbugs.gnu.org>; Sun, 27 May 2018 11:52:53 -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=+urJgPAYtNstRsmIF8HKuz50hbVxADbLYUY5VhIG10Q=; b=NA+rL99iGU4linfXPbcvYalG1a8aVHgh0h5sJmfsEF1+3V88/NFy8Cex/ABCrt8Ymm vlm2oauGrwWS4fYBxdaRUJzlUEEwlNum2TsfF+sCsArmbyaWbcZhoRwfqCIIa4A4lBGd Yq3oISth3F3ExFIqHweAJIKa6a0stvnupBSBYWTP8KN0ebb+EudMOwoiyFGWJsfYflgx PhEfqd+eG++bCunrJTBKGvAVwgQWhgd87bQ0q+PeDeB8ZptKsputeDWO5aOj2xEoeLIg r0EJswm91RdisKp8FWYdCXYrpXetBeh+PjB+A6AFCdkqebD4VpeI9HlGfSdm9jbT9ubo SqIg== 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=+urJgPAYtNstRsmIF8HKuz50hbVxADbLYUY5VhIG10Q=; b=ruGQB73mD3ROQkEUn7GSvPfrM1uexR2bLALQ82ivsE31RAXdCZlR0W2R5Y6uF3gXbe P2feldEy9cpeGlN1N8P7O5wgKIWTu3CzevicMYz5G2ZDxSoPiKzKPokxvRccWuCeCBTq JAvQVY0KTuP+N2n2/6RMjGABGt2etV3XpXS0++H1aCjZuzLSE+snReThvWYVLCfx/i+J +A7eMMz9D6oS2+oj1PXiuEdDuuYT7bXGUGBuaVrtEW6GAa1fLUXScgfKvJ2LBHqvgi3W KkwwUXynQOGyEIHBHk99DEsATqAoiE+2BWAARxkbfrMgr/BdbvlEGPkc3Fr8az5JjW+k IRYw== X-Gm-Message-State: ALKqPwe9Pdxwe1vCdbamFQ0bqkHh3w4yLkHLhGGkv/Sok5PYBk15lYZa c+k8YH64c7ulDvKhW/7tza6qNmlAwuHN1zhWgfI= X-Google-Smtp-Source: ADUXVKLHwLDpBVGNKHG6FDorftb0gQWj3RDkdiN92M9Hp6hbCLpomHw8WuAHzinWPP/syS3UQGq3cYR8PisquhcK16Y= X-Received: by 2002:ae9:e8c2:: with SMTP id a185-v6mr9382702qkg.223.1527447168120; Sun, 27 May 2018 11:52:48 -0700 (PDT) In-Reply-To: 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:146611 Archived-At: On Sun, May 27, 2018 at 10:52 AM Aaron Jensen wrote: > 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. One more clue: On a frame that doesn't accept focus on a mac, a single click results in a mouse-movement getting fired immediately after the down-mouse-1. A single click on a normal frame does not do this. This is why this issue doesn't repro on a frame that accepts focus. Something about how the non-focusable frames are causes them to get mouse moves immediately after a click. This means that the transient map created in mouse-drag-track immediately gets invoked with a mouse-movement, which is what triggers the scroll. As mentioned earlier in the thread, this is only true if the mouse has moved since the last click. That means if you click twice in row, only the first click will get a mouse-movement fired after it. If you then move the mouse and click again, it'll fire the down-mouse-1 then the mouse-movement again. Perhaps someone who understands the way that mouse tracking works on mac would know why a frame that doesn't accept focus behaves differently? It's as if the non-focusable window only gets notified of a mouse's new position whenever a click happens, so every click is as if the click happened and then the mouse moved to that position.