Drag-and-Drop Protocol for the X Window System
Optimizations
When the source and target windows are part of the same application, sending X Client Messages is a waste of time and bandwidth, especially if the program and server are on different machines. Implementations should therefore detect the special cases of "source = target" and "source and target in same application" and handle them via function calls.
To avoid calling XConvertSelection() in the above cases:
-
There is no need to examine the data when "source = target" because the source must know what it is dragging.
-
If the actual call to XConvertSelection() is hidden behind an interface, then when the source and target are in the same application, the interface can simulate the call without going to the server.
Targets do not have to retrieve XdndTypeList from the source window if they find what they are looking for in the three types listed in the XdndEnter message.
To avoid unnecessary messages from the source to the server, one should only change the cursor when the target or status (acceptance and action) changes.
Unfortunately, one cannot avoid calling XTranslateCoordinates()> continuously, because of overlapping windows.