Subject: Re: bug#51658: [PATCH] Haiku port (again)

From: Po Lu <[email-masked]>
Date: Sun, 14 Nov 2021 18:39:04 +0800

Eli Zaretskii <[email-masked]> writes:

> How is POSITION used?  Can't you fake POSITION, so we get the same
> event as on other platforms?

AFAIU, POSITION is used to determine the window where the file should
appear.  It should be possible to fake.

We could get the mouse position on-screen, but it may lead to odd
results if the user asks Emacs to open a file through the Tracker or the
Recents menu, and the mouse is not on top of an Emacs frame, or if the
system starts Emacs to open a file.

What position do you think would be reasonable to report here?

BTW, it seems that the NS port has the same problem here: it defines the
custom events `ns-open-file' and `ns-drag-and-drop' and `ns-power-off'.

> Every modern system has something similar, so it would make sense to
> have a unified mechanism for handling those system messages in Emacs.
> If xsmfns.c is too X-specific, we should build a layer above it, and
> then implement th lower layer for Haiku.  It makes no sense to me to
> introduce new events for specific platforms when similar features
> already exist and just need to be extended or abstracted.

Yes, makes sense.  It would be worthwhile just to solve this problem
with the NS port.  I will look into it.

Thanks in advance.