gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

X Dragging interaction


From: Fred Kiefer
Subject: X Dragging interaction
Date: Fri, 21 Dec 2001 01:32:46 +0100

Our internal drag and drop in GNUstep is now working quite well, even
between different GNUstep applications. The remaining problem is to get
it working with other X applications. Here most parts are already there
and working, but one fundamental problem in the interaction with X
remains.

For an OpenStep pasteboard the data must be declared in advance so
possible targets can always ask what is there. Richard did implement a
class XPbOwner that does add the X selection to the GNUstep pasteboard,
it does this by taking over the pasteboard and declaring data of type
text, even when there is no X selection (Or a selection f some other
type). This is a bit of a restriction, but as we will mostly copy
strings it works fine.

The subclass XDragPbOwner tries to do similar things  with the drag
pasteboard, but it has no chance to know what data will be provided nor
which window will make this data available. The xdnd protocol will only
signal which types are available when entering a window.

To get out of this dilemma I would recommend that we drop this extension
of the pasteboard for dragging and implement all of the X drag code in
the XGDragView class. As this class has already a window, this would be
used to export data for dragging that started in the GNUstep application
to non GNUstep applications (GNUstep applications would still get there
data from the Drag pasteboard). And when a drag from the outside will
enter a GNUstep application the XGDragView will be notified and take
over the drag pasteboard (which will be freed again, if the cursor moves
outside the window again) and declare all the types that are available
for DnD. When a drop happens inside of a GNUstep window, the XGDragView
will ask via the xdnd protocol for that data and add it to the
pasteboard.

This implementation lacks some elegance, as the drag pasteboard is no
longer managed by a shared background process and different GNUstep
applications running at the same time, may have to declare the same
types to the drag pasteboard when the drag cursor moves over them. Still
it is the only working solution I see.

Fred




reply via email to

[Prev in Thread] Current Thread [Next in Thread]