Class X11Drag
XdndSelection to hand the
data over. It is spoken on the clipboard's connection, by the clipboard's thread.
As a destination. GLFW's window already answers XDND, for files and at the drop
alone, on a connection this class cannot read. Each window is therefore given an
XdndProxy: sources send what was meant for it to the clipboard's own hidden window,
where it is answered here for every kind of data and while the pointer hovers. The answer is
asked of the UI thread and sent when it comes; nothing waits on anything. A source that goes
round the proxy after its first position, to talk to GLFW's window itself, is followed by
reading the pointer (X11DragFollow); while a drag is over a window of ours the thread
turns sixty times a second for it.
As a source. X has no drag of its own to hand a session to: the source follows the pointer itself. While a drag of ours lasts the thread asks the server where the pointer is sixty times a second, finds the window under it that speaks XDND, and tells it; the button let go is the drop, and Escape calls it off. Our own windows are told the same way as any other program's, through the server.
-
Method Summary
Modifier and TypeMethodDescriptionregister(long xwindow, Supplier<WindowInput> input, DoubleUnaryOperator toLogical, Runnable ownPointer) Makes a window a source and a destination of the system's drags.
-
Method Details
-
register
public WindowDrag register(long xwindow, Supplier<WindowInput> input, DoubleUnaryOperator toLogical, Runnable ownPointer) Makes a window a source and a destination of the system's drags. UI thread.- Parameters:
xwindow- the window's X idinput- the window's input, as it is at the time of each call; may answer nulltoLogical- from the server's pixels to the window's logical pointsownPointer- puts the window's own pointer shape back, on the UI thread, after a drag that began in it changed the shape to say what a target answered- Returns:
- the window's drag
-