unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Huan Thieu Nguyen <hnguyen@hyperstone.com>
Cc: 65008@debbugs.gnu.org
Subject: bug#65008: 29.1; Feature: dired-mouse-drag-files for Wayland
Date: Wed, 02 Aug 2023 21:21:56 +0800	[thread overview]
Message-ID: <871qgld1fv.fsf@yahoo.com> (raw)
In-Reply-To: <2dc7e650062341cb9a1c560e2199566c@hyperstone.com> (Huan Thieu Nguyen's message of "Wed, 2 Aug 2023 07:55:29 +0000")

Huan Thieu Nguyen <hnguyen@hyperstone.com> writes:

> Hi, why does this feature exclude Wayland? It's possible to do with
> GTK3. I might be able to help, but I've only done it with GTK4 which
> changed it a bit <https://docs.gtk.org/gtk4/migrating-3to4.html#switch-to-the-new-drag-and-drop-api>

Patches welcome.  I set out to implement this last year, but found
several severe problems with GDK's crude Wayland drag-and-drop
implementation preventing it from matching Emacs's expectations.

The GDK Wayland backend's drag and drop interface returns a placeholder
window from `gdk_drag_find_window_for_screen', presuming that the
program implementing DND will immediately call `gdk_drag_motion' with
updated drag-and-drop information.  Emacs needs to know exactly which
window is under the pointer (and also the position of the pointer
device) in order to display and position the optional DND tooltip and
possibly cancel DND if the pointer moves back into a frame.

These problems eventually boil down to the inability of Wayland clients
to terminate drags they initiate, and Wayland's refusal to provide the
client with the surface under the pointer during a drag.

As a consequence, Emacs can't return to Lisp when the mouse pointer
returns to the confines of a frame, nor can it quit out of drag and drop
operations.

If you do want to pick up where I left off, keep in mind that Emacs
can't make use of the higher level GTK drag-and-drop interface: it must
employ the GDK drag-and-drop primitives, since only those enable
selection data to be transferred.  You will want to implement the
function `x-begin-drag'; refer to its documentation and the
implementations in xfns.c, ns-win.el and haiku-win.el for more details.





      reply	other threads:[~2023-08-02 13:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-02  7:55 bug#65008: 29.1; Feature: dired-mouse-drag-files for Wayland Huan Thieu Nguyen
2023-08-02 13:21 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=871qgld1fv.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=65008@debbugs.gnu.org \
    --cc=hnguyen@hyperstone.com \
    --cc=luangruo@yahoo.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).