From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#28620: Interact directly on Emacs bug#28620: mouse drag event records wrong release window Date: Sat, 14 Oct 2017 10:35:33 +0200 Message-ID: <59E1CC55.2090400@gmx.at> References: <83wp4e3nvx.fsf@gnu.org> <8360bx340d.fsf@gnu.org> <8360bw19es.fsf@gnu.org> <83vajwytja.fsf@gnu.org> <83poa4yqyq.fsf@gnu.org> <83376qouoj.fsf@gnu.org> <59DF2260.5030204@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1507970179 30981 195.159.176.226 (14 Oct 2017 08:36:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 14 Oct 2017 08:36:19 +0000 (UTC) Cc: Alan Third , 28620@debbugs.gnu.org To: rswgnu@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 14 10:36:15 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 1e3HvP-0006FD-Hj for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Oct 2017 10:36:03 +0200 Original-Received: from localhost ([::1]:53204 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3HvW-00072P-Se for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Oct 2017 04:36:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3HvP-000715-JG for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 04:36:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3HvO-0000Rs-Gz for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 04:36:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58315) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e3HvO-0000Rn-DB for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 04:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e3HvO-0002ol-7p for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 04:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Oct 2017 08:36: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.150797015710813 (code B ref 28620); Sat, 14 Oct 2017 08:36:02 +0000 Original-Received: (at 28620) by debbugs.gnu.org; 14 Oct 2017 08:35:57 +0000 Original-Received: from localhost ([127.0.0.1]:38762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3HvJ-0002oG-9F for submit@debbugs.gnu.org; Sat, 14 Oct 2017 04:35:57 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:61254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3HvH-0002nu-GG for 28620@debbugs.gnu.org; Sat, 14 Oct 2017 04:35:56 -0400 Original-Received: from [192.168.1.100] ([46.125.249.56]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MNYxW-1eARql10H4-007ECU; Sat, 14 Oct 2017 10:35:37 +0200 In-Reply-To: X-Provags-ID: V03:K0:IUE2y/Q7pThXyl6N6OX+L1muBSGkK+jLGGHuk26FhqetWDYQb8G An+YdPufIXGO5rRWabqRC432V9A88MAnrZw65zYp5H9UzNZVfHsg1LUpqG585mToD5Amzlf sLDHPUK2HzAx4TYfQDLMEPBPXI1hlGEK0kFkEVbLlvkC3xh9TcQXVIJ4ny8twCcbztAJd40 B2id7guybHvrg7oVPooTw== X-UI-Out-Filterresults: notjunk:1;V01:K0:yOHegrsvI44=:ksk3BdDBFEvNFP7cMExKK/ xeVXEumdO8BXbxTqNUNwca/8625iHv5YbTL4+cDIweID13uDp8Chdmug0qsJkkdB5RzX9f0Np JJl8MkaZQtJgRXGD57LQbwBDxgdoc1EAUyd0HXs1GREywtio4SaVkuBgW+BwEGGWhLRL87bBq 9euG3gowS6eikPFw6NxG/vYrrwLTBwCObM+vGrz+KQwFP+bAQR5sr22JMzoVZLoizC3TdbYWx XFLEkruTmw1ryHjqBAQn1qtvgrBQXNjTNLOcdzwPKF7Hm/lyEqOqnTFiGofaYMeiED6D+9d4L 4Y8N/mDN1zbPkT3Osli3Z4efaIGbzdRIGAtUfj398va3pvU7GUB4rhl+wFEnu1aIp6IHnRrqL XRK+cvE/67fVdCo3D2dB/VMRtxNaVUuATj+1BDcI06mIhhZ6jq1AZqqXZ7XCfAIWCXOvkNis7 tKifpK80MMbIZ2yJctfTyLh23yaw+KA+2kNmq2Wpx2EL0yVWETXSwhUeVa7xwO3RjunzelVxA dpSygFe53RS0AZFWHAq/47zRbBI1jwHoUt7szGahPJlSxg6PBHJ8f9cDvm84WO1X1zhT70TaT NbgTux3KoR12lxYOX0pTIxcqlESAxGckGCRcpQTMeSilqQUd2t11bhMTFkMtD4U/1UCiPYuAj oXykBLoZVeOPzyjb1NUdhT6E4ZonrtyWk8QCbm/l2TZU9ImRXFRf5YlnBezuaN9+fo0nWI+un 3EMQw7kVU4mB2qSTILfp4uNZs2RpasKCcYBMmfLQoqiO6/QfPb8LMFrTm47RV7Lxrtoqx92p 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:138385 Archived-At: > =E2=80=8BI think it is a feature that Emacs receives an event for this= but a defect > that it can't distinguish when f2 is atop an external window or not an= d > thus whether the event was actually directed at f2 or not. =E2=80=98mouse-drag-region=E2=80=99 is an Emacs internal function, so it'= s no defect. If it were not internal, Emacs would have to be either able to poll the other window's application as to whether it supports dropping an Emacs internal string or convert that string to some appropriate coding that other applications understand. Neither of these has been done yet and it will be non-trivial to do that for our various platforms. > =E2=80=8BJust FYI, I am using the macOS window manager, not X, though = as you note, > it is an issue there too. > The application-level window managers must have a z-ordering for all > windows in order to be able to select and raise windows when they are > behind others. So you are saying that they don't publish this informa= tion > in any useful way that Emacs can obtain, right? All I can say is that when you nowadays try to obtain information on whether a window is really visible under X, chances are that you don't get it. Querying the z-order will only tell you something like "window Y cannot obscure window X because it's lower in the z-order". > Part of the issue is that the macOS window manager uses click-to-focus= , so > the release event of the drag does not switch focus to the application= > whose window the release falls upon. As Stefan already mentioned earlier: With a drag operation usually no focus shifting occurs anyway. > However, in drag-n-drop operations, > the window manager automatically switches focus to any compatible > application that the mouse moves over (after a delay) so that the righ= t > application receives the drop (based on Z-order). It's completely up to the window manager which polls the application(s) whether they are ready to receive the object to drop. Emacs is not involved in that process. It would be involved only to tell whether it would accept such a string when it's the target of a drop. > Mouse wheel events are also delivered to the topmost Z-order window wi= thout > either raising the window or switching focus. Mouse wheel events are completely different and highly window system dependent. Sometimes they get caught before Emacs sees them at all and get transformed to scroll bar thumb drag events to the owner of the scroll bar nearest to the mouse cursor at the time the wheel gets scrolled. > So the window manager always knows where it should deliver =2E.. it never "knows". Some make better guesses and some make worse ...= > What would the pseudo-code > look like to check whether or not an Emacs frame was uppermost at the = point > of mouse release? (1) =E2=80=98frame-list-z-order=E2=80=99 would have to be able to return = all windows on your system and (2) a function would be needed to get the attributes of those windows. martin