all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: rswgnu@gmail.com
Cc: Alan Third <alan@idiocy.org>, 28620@debbugs.gnu.org
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	[thread overview]
Message-ID: <59E1CC55.2090400@gmx.at> (raw)
In-Reply-To: <CA+OMD9i5a6VYjYpxHPY5ZV_ev+i=15KJcgVVa=Ey4JYSvRaC-Q@mail.gmail.com>

 > ​I 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 and
 > thus whether the event was actually directed at f2 or not.

‘mouse-drag-region’ 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.

 > ​Just 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 information
 > 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 right
 > 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 without
 > 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

... 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) ‘frame-list-z-order’ 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






  reply	other threads:[~2017-10-14  8:35 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CA+OMD9gfe-sUm_er47UmPzrCmvSEjUP0TdsCapBxeiFQS=E1dg@mail.gmail.com>
     [not found] ` <83wp4e3nvx.fsf@gnu.org>
     [not found]   ` <DCD76686-AED1-4D1B-BF28-CAA693633E07@gmail.com>
     [not found]     ` <8360bx340d.fsf@gnu.org>
     [not found]       ` <CA+OMD9j9u1KTKFrQyGSVR43gcvmD16kqcVo9pw7dYhp+KULjcA@mail.gmail.com>
     [not found]         ` <8360bw19es.fsf@gnu.org>
     [not found]           ` <CA+OMD9h8i6DcxdS4pcrNxHiTbCmxZfU9=CqArJt9GKH8O6LPSw@mail.gmail.com>
2017-10-03 18:21             ` bug#28620: Interact directly on Emacs bug#28620: mouse drag event records wrong release window Robert Weiner
2017-10-03 18:42               ` Eli Zaretskii
2017-10-03 18:53                 ` Robert Weiner
2017-10-03 22:40               ` Alan Third
2017-10-04  0:15                 ` Robert Weiner
2017-10-04 16:30                   ` Alan Third
2017-10-04 17:26                     ` Robert Weiner
2017-10-04 18:59                       ` Alan Third
2017-10-04 19:30                         ` Robert Weiner
2017-10-04 20:11                           ` Robert Weiner
2017-10-04 20:07                         ` Robert Weiner
2017-10-04 22:09                           ` Alan Third
2017-10-05  0:38                             ` Robert Weiner
     [not found]             ` <83vajwytja.fsf@gnu.org>
     [not found]               ` <CA+OMD9gtwbg4gZzFryWCteN-gHuwvvqTYhVf2WUmpznZ9jo+Ng@mail.gmail.com>
     [not found]                 ` <83poa4yqyq.fsf@gnu.org>
     [not found]                   ` <CA+OMD9gM_3qgioX_RhhDHWF9GYA7=6++Hq5im2nwcwtdKLyDnA@mail.gmail.com>
     [not found]                     ` <CA+OMD9g5dX8Dg92F1pRgYKt3j0yyg=8rBOpSc5SePPiodFnOWA@mail.gmail.com>
     [not found]                       ` <83376qouoj.fsf@gnu.org>
     [not found]                         ` <CA+OMD9hi52ZgCWFTSFPBEu2tOpF12kvHqpu8p4oi-f6jPdw2bA@mail.gmail.com>
2017-10-11 18:49                           ` Robert Weiner
2017-10-12  1:35                             ` Robert Weiner
2017-10-12  1:47                               ` Robert Weiner
2017-10-12  8:05                               ` martin rudalics
2017-10-12 13:08                                 ` Robert Weiner
2017-10-14  8:35                                   ` martin rudalics [this message]
2017-10-14 17:16                                     ` Robert Weiner
2017-10-14 18:47                                       ` Robert Weiner
2017-10-15  3:31                                         ` Robert Weiner
2017-10-15  9:40                                       ` martin rudalics
2017-10-16 16:31                                         ` Robert Weiner
2017-10-17  8:57                                           ` martin rudalics
2017-10-19 18:32                                             ` Robert Weiner
2017-10-20  7:55                                               ` martin rudalics
2017-10-20 14:26                                                 ` Robert Weiner
2017-10-21  8:05                                                   ` martin rudalics
2017-10-21 18:05                                                     ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=59E1CC55.2090400@gmx.at \
    --to=rudalics@gmx.at \
    --cc=28620@debbugs.gnu.org \
    --cc=alan@idiocy.org \
    --cc=rswgnu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.