all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Weiner <rsw@gnu.org>
To: martin rudalics <rudalics@gmx.at>
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: Mon, 16 Oct 2017 12:31:06 -0400	[thread overview]
Message-ID: <CA+OMD9gm_LDZhcHu6QYuv-NepiWBvqeTTB5eJADjUVS5G1xSFQ@mail.gmail.com> (raw)
In-Reply-To: <59E32CFA.5080405@gmx.at>

[-- Attachment #1: Type: text/plain, Size: 4490 bytes --]

On Sun, Oct 15, 2017 at 5:40 AM, martin rudalics <rudalics@gmx.at> wrote:

>
> Even if the Emacs frame is covered by another application's frame,
> nothing prevents us from having that covered Emacs frame accept the
> drop.  We could even give frames a "no-accept-drops" parameter and this
> way have a drop on such frames pass the drop through to yet another
> frame below that does accept drops.


​Yes.  My point is that there should be some extension to Emacs'
reporting of window system events that allows a user of such
information to know whether any other application occluded the
Emacs frame at the time and point of release.  Then in cases
where this information can be gleaned from the external window
manager, it can be used in programs.  The user program is still
free to allow a drop to go through in such cases but only if
desired.

​​
>
> ​​
> > I guess you are saying that Emacs drag events must start and end within
> ​​
> > Emacs frames.  I think about it a bit differently.  Since the mouse can
> ​​
> > move in and out of Emacs frames and release events can occur (in logical
> ​​
> > Z-ordered OS window space) outside of Emacs, yet still register with
> Emacs
> ​​
> > (when the release occurs within the geometry of a frame but the frame is
> ​​
> > covered by another app's window), I think Emacs event handling should
> ​​
> > return different information when the release frame is not the topmost
> ​​
> > OS-level window at the point of release.  Then handler code could
> dispatch
> ​​
> > as necessary.
> ​​
>
> ​​
> But to be useful, that "handler code" must be written and such code must
> ​​
> f
> ​​
> o
> ​​
> l
> ​​
> l
> ​​
> o
> ​​
> w
> ​​
> ​​
> a
> ​​
> ​​
> s
> ​​
> t
> ​​
> a
> ​​
> n
> ​​
> d
> ​​
> a
> ​​
> rd interface for the OS used.


​It is not only drag-and-drop that we are interested in.  We
often want to simply call different functions based on whether
the drag release was inside or outside of Emacs.  For example,
Hyperbole now uses a drag release outside of Emacs to clone the
window depressed upon into a new frame.​

​​
>   Consider the trivial task
> ​​
>
> ​​
> that one Emacs instance wants to drop some text to a second Emacs
> ​​
> instance.  How would we trigger the drop event on that second instance?


​Yes, you would need to follow a common drag-and-drop protocol.
I don't understand why that is an issue if that is what you want
to do.

​​
>
> ​
> > ​Each window has a 'visible' attribute.  Are you saying this is not
> ​​
> > accurate these days?​
> ​​
>
> ​​
> Yes.  The GTK manual says that
> ​​
>
> ​​
>   Modern composited windowing systems with pervasive transparency make
> ​​
>   it impossible to track the visibility of a window reliably,


For programmatic purposes when Emacs receives a mouse button
drag release event, we only care about whether the topmost
window-system window at the point of release is an Emacs frame
or not.  If at that point, it is occluded by another window,
we don't care how transparent that window is and whether the
Emacs frame can be "seen" but only whether it is logically
the window clicked upon.  Again, even if it is not, we can
process the event as if it were *if we so choose* but having
the choice is the key issue here.

​​
>
> ​​
>
> ​​
> >> (1) ‘frame-list-z-order’ would have to be able to return all windows on
> ​
> ​
> your system
> ​
> ​​
> >
> ​​
> > ​Is it likely we could build a multi-platform primitive ​that would
> supply
> ​​
> > that information given what you have said?
> ​​
>
> ​​
> At least for top-level windows.  This will work as long a child windows
> ​​
> are fully contained by their parents which IIUC is not necessarily true
> ​​
> for macOS systems.


​Could you give a concrete example of where this might be a problem
so I could test code against it?
​

> ​​
>
> ​
> ​​
> >
> ​​
> > and (2) a function would be needed to get the attributes of
> ​
> ​​
>  those windows.
> ​​
> ​​
> ​​
> ​​
> ​​
> ​​
> ​​
> ​​
>

​I have figured that part out from the macOS APIs.
​
Bob
​

[-- Attachment #2: Type: text/html, Size: 14055 bytes --]

  reply	other threads:[~2017-10-16 16:31 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
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 [this message]
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=CA+OMD9gm_LDZhcHu6QYuv-NepiWBvqeTTB5eJADjUVS5G1xSFQ@mail.gmail.com \
    --to=rsw@gnu.org \
    --cc=28620@debbugs.gnu.org \
    --cc=alan@idiocy.org \
    --cc=rswgnu@gmail.com \
    --cc=rudalics@gmx.at \
    /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.