[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#19885: 24.4; "XdndDrop" event does not reach `x-dnd-handle-drag-n-dr
From: |
Jan D. |
Subject: |
bug#19885: 24.4; "XdndDrop" event does not reach `x-dnd-handle-drag-n-drop-event' when dragging from Chromium |
Date: |
Sat, 21 Feb 2015 15:11:51 +0100 |
Hi.
> 17 feb 2015 kl. 12:27 skrev Oleh Krehel <ohwoeowho@gmail.com>:
>
> Here are my system parameters:
>
> In GNU Emacs 24.4.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.8.6)
> of 2015-02-03 on firefly
> Windowing system distributor `The X.Org Foundation', version 11.0.11501000
> System Description: Ubuntu 14.04.1 LTS
>
> When dragging an image link from e.g. Firefox, everything works fine,
> "XdndDrop" event is received.
>
> However, when dragging the same link from Chromium, this event is never
> received. Other events, like "XdndEnter", "XdndPosition" and "XdndLeave"
> are received from both browsers.
>
> I'm not sure if Emacs is the cause, it could be Chromium's fault for not
> sending the event. Maybe someone with more knowledge could look at this.
Chromium is buggy, it ignores action XdndActionPrivate, which Emacs returns by
default.
The XDND specification (http://www.newplanetsoftware.com/xdnd/) says:
"The special action XdndActionPrivate tells the source that the target will do
something that the source doesn't understand and that won't require anything
from the source other than a copy of the data."
But Chromium does not offer a copy of the data. If we change the action to
XdndActionCopy, Chromium works as Firefox.
You can make a function like this
(defun my-x-dnd-test-function (_window _action types)
"X-DND test function that returns copy instead of private as action
Otherwise the same as the default function"
(let ((type (x-dnd-choose-type types)))
(when type (cons 'copy type))))
and customize x-dnd-test-function to my-x-dnd-test-function if you wan't
Chromium to behave.
>
> Slightly related, I'd also like to know why sometimes the DND
> transaction gets stuck while I'm debugging something in Emacs. Then, I'm
> unable to start a new DND from Firefox unless I restart Firefox. Could
> something be done on Emacs side to prevent this?
When dragging, the mouse is grabbed and possibly the server. XDND requires
answers to be returned in a timely fashon. If you debug, I guess Firefox gets
out of trach when it does not get answers. Thats why dnd is hard to debug, you
must rely on print-outs in the code.
Closing as there is no Emacs bug here.
Jan D.