From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Drag and drop patch for X, please review. Date: 20 Jan 2004 13:41:18 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <200401171729.i0HHT1wq016912@stubby.bodenonline.com> <20040118004009.GA24635@fencepost> <2C5AAB61-49F7-11D8-A763-00039363E640@swipnet.se> <74293710-4B62-11D8-89AF-00039363E640@swipnet.se> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1074629392 11675 80.91.224.253 (20 Jan 2004 20:09:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 20 Jan 2004 20:09:52 +0000 (UTC) Cc: Miles Bader , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Jan 20 21:09:44 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Aj2C0-0007KP-00 for ; Tue, 20 Jan 2004 21:09:44 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Aj2C0-0002Cs-00 for ; Tue, 20 Jan 2004 21:09:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Aj1c5-0002Pl-W5 for emacs-devel@quimby.gnus.org; Tue, 20 Jan 2004 14:32:37 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Aj11h-0003CF-Qr for emacs-devel@gnu.org; Tue, 20 Jan 2004 13:55:01 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Aj0qi-0000mq-Le for emacs-devel@gnu.org; Tue, 20 Jan 2004 13:44:11 -0500 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1Aj0q9-0000ar-MO; Tue, 20 Jan 2004 13:43:06 -0500 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by mx20.gnu.org with esmtp (Exim 4.24) id 1Aj0oV-00027u-3d; Tue, 20 Jan 2004 13:41:23 -0500 Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 3CFBA2100D; Tue, 20 Jan 2004 13:41:19 -0500 (EST) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 0338D8C6F3; Tue, 20 Jan 2004 13:41:18 -0500 (EST) Original-To: "Jan D." In-Reply-To: <74293710-4B62-11D8-89AF-00039363E640@swipnet.se> Original-Lines: 42 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=0, requis 5) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:19364 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:19364 > The problem is more figuring out where the mouse is, i.e. menu bar, scroll > bar or tool bar. Wait.... you're doing it in elisp, right? That's the problem. You first need to export the C code that does it. > matter. It may not be a complex thing, but all these events must > interract so that if a drop starts with [menu-bar dnd], then enters > a window, i.e. [dnd], and then exits via a [scroll-bar dnd], the global > data needed for the drop must be synchronized so that it is > correctly updated. I must admit that I don't understand what you mean by a drop "starting" somewhere and "exiting" somewhere else. My understand of a drop is "release the mouse button" which is instantaneous. Or are you talking about the drag part and saying that Emacs should somehow highlight the object to which the drop is going to apply ? > I don't feel comfortable with accepting a drop and then signal an error. > I think this goes a bit against the "spirit" of drag and drop in a small > way. The reason why the source of the drop gives a list of types and > a suggested action (copy, move etc.) at the start of the drop is just > so that the target can decide if to accept the drop or not. Obviously, if there's no binding for the drop event at the drop location, you should not accept the drop action. So view-mode could explicily unbind the drop event, for example. Or the keymap bindings could be to commands that have to first call a `dnd-accept' function to get the actual text to insert. This accept function could take arguments to indicate which kind of drop is being accepted, ... > Also, many programs (all GTK for example) have a visual indicator to > show if the drop can be made or not where the mouse is. With the generality of elisp you indeed can't do it 100%, but you can approximate it using things like "is there a binding for dnd-drop here?". Stefan