From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#28620: Interact directly on Emacs bug#28620: mouse drag event records wrong release window Date: Wed, 4 Oct 2017 17:30:48 +0100 Message-ID: <20171004163048.GA52414@breton.holly.idiocy.org> References: <83wp4e3nvx.fsf@gnu.org> <8360bx340d.fsf@gnu.org> <8360bw19es.fsf@gnu.org> <20171003224017.GA51637@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1507134677 12487 195.159.176.226 (4 Oct 2017 16:31:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 4 Oct 2017 16:31:17 +0000 (UTC) User-Agent: Mutt/1.9.0 (2017-09-02) Cc: 28620@debbugs.gnu.org To: rswgnu@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 04 18:31:12 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 1dzmZf-0002Ft-MQ for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Oct 2017 18:31:08 +0200 Original-Received: from localhost ([::1]:36076 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzmZn-0004ml-1Z for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Oct 2017 12:31:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzmZd-0004kx-BC for bug-gnu-emacs@gnu.org; Wed, 04 Oct 2017 12:31:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzmZa-0000tH-OY for bug-gnu-emacs@gnu.org; Wed, 04 Oct 2017 12:31:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40442) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dzmZa-0000sn-IF for bug-gnu-emacs@gnu.org; Wed, 04 Oct 2017 12:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dzmZa-0006Yw-8n for bug-gnu-emacs@gnu.org; Wed, 04 Oct 2017 12:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Oct 2017 16:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28620 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28620-submit@debbugs.gnu.org id=B28620.150713466025218 (code B ref 28620); Wed, 04 Oct 2017 16:31:02 +0000 Original-Received: (at 28620) by debbugs.gnu.org; 4 Oct 2017 16:31:00 +0000 Original-Received: from localhost ([127.0.0.1]:49123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzmZY-0006Yg-1f for submit@debbugs.gnu.org; Wed, 04 Oct 2017 12:31:00 -0400 Original-Received: from mail-wm0-f45.google.com ([74.125.82.45]:46704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzmZW-0006YS-ME for 28620@debbugs.gnu.org; Wed, 04 Oct 2017 12:30:59 -0400 Original-Received: by mail-wm0-f45.google.com with SMTP id m72so24054778wmc.1 for <28620@debbugs.gnu.org>; Wed, 04 Oct 2017 09:30:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=qOH+FYwMKGIfhWJKiiw2IBBwgM/+BWxzVUilNCwgCCs=; b=JFvetoP24BNvxwL0jV5uDmGHQ2FE3ksUTYO16AuzGWmUbI26Ba5fTh5kGlPaiZW3Rz YaQy+ATa+QjHl9Eu4bferHnHY3L3rWkfw4S9ySPD+6RtPah9VT+YR2qls/fjJ0KYnGs6 4vKd6qNVuq+GK0tplXayy1cin2Se4bjTmQkN5dGjbCojqaMmwnMtROHij/SbsDLxlXhs 1C5DyJTMYBdvuB328HF4lGq5iapBGGUNFtyuWT6c1566CBDZ2sd29fkHJeKpDMBfZelV YtnTUZVl2X7wEQK98vCVt0U+Jx3Ylp3d6vphH85J1pN3hnRa+HrHbPjM7oEOSuM3Bp6Q XZVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=qOH+FYwMKGIfhWJKiiw2IBBwgM/+BWxzVUilNCwgCCs=; b=g7rVpHNS1z79zqxYIqf4z86aQU37OEvuZJeJD1ArJE3mynhFer7pCARx19DrVoY4be Xod/liJdNIBmK5nLVY89hDFbS6DF4DLEiHbSXn6lN0iQU+DSY451AQ5o6+/AglOhbLcY 5AHU6pkstpIt3BaAy3mJKcy1XQsBbkgj3oEdQH9IbTO+posTy2HS1vN93g3QuEuzWXEN lYzQ6a/oCaNVl0JE+d/AAqEWmfcVjE+Yy0C3rTcfAi/+QNJrWxCS6WKuMHwyYDfA2FwR 5MUfwmhKlJhnjMGDVVJFetsK4lvVVaSQ/NOTLyJ7aNlNjjDCi+JI21jnlhwlFwBpO0rg cl1A== X-Gm-Message-State: AHPjjUh8g/2TIAKs1t9OHx8R5m+4ChgZ7TkebryP2/nSB67Je906KcPh N/kgEwmM8ld7sIrmG4MQO5c= X-Google-Smtp-Source: AOwi7QDbaT5Yz9DlnIoi1iUX9hZNYj2s0LEVwiRAkTMj7dlRhfznFMUTKcomhQNAxYT2uX0INVMYtg== X-Received: by 10.28.148.67 with SMTP id w64mr14921673wmd.132.1507134652797; Wed, 04 Oct 2017 09:30:52 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-ad89-e054-05c6-3eca.holly.idiocy.org. [2001:8b0:3f8:8129:ad89:e054:5c6:3eca]) by smtp.gmail.com with ESMTPSA id f188sm9067795wme.21.2017.10.04.09.30.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Oct 2017 09:30:51 -0700 (PDT) Content-Disposition: inline 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:137909 Archived-At: On Tue, Oct 03, 2017 at 08:15:53PM -0400, Robert Weiner wrote: > On Tue, Oct 3, 2017 at 6:40 PM, Alan Third wrote: > > As far as I can tell ns_mouse_position returns the frame stored in > > dpyinfo->last_mouse_frame, which is set by EmacsView::mouseDown, however: > > > > If the user clicks a view that isn’t in the key window, by default > > the window is brought forward and made key, but the mouse event is > > not dispatched. > > > > ​What does "the mouse event is not dispatched mean"? Does it mean Emacs > never sees the event? Maybe Emacs sees only that the window has been > selected by the window manager and based on that switches to the selected > window of the frame? Precisely that. > ​The mouse wheel code manages to scroll the proper window that the mouse is > over, even across overlapping frames where the window the mouse is over is > in a frame that is partially behind another frame. And this happens > without without any click events. This could be utilized in the click > event code to get this right somehow. The mouse wheel code is also handled in mouseDown, the difference is that macOS always sends the mouse wheel event to the emacs frame under the mouse pointer, whereas the mouse click event is not sent when the frame is not already key (i.e. selected). AFAICT Emacs does the right thing here, exactly the same thing as every other macOS app. > It looks like the EV_TRAILER macro call at the end of the nsterm.c > mouseDown function (which is also called by mouseUp) sets the frame used > for mouse button down, up and scroll wheel events from the variable > emacsframe. Somehow the value of emacsframe must be set differently for > mouse up events than it is for mouse wheel events since they end up with > different frames for the same mouse positions. There’s nothing fancy here, emacsframe is an instance variable associated with the EmacsView that macOS sends the mouse event to. -- Alan Third