Next: 2. Protocol Messages
Up: 2. Protocol Basics
Previous: 2. Protocol Basics
  Contents
  Index
Both the drag and the drop protocol are build around X client messages
which are send forth and back between the initiator and receiver of
the drag and drop operation. Such messages are emitted during the
start, cancelation or end of a drag and drop operation, or as the user
moves the mouse pointer around the screen and the pointer enters and
leaves valid drop sites. This way, the initiator client and the
potential receiver client(s) can provide to the user some visual
feedback about the current state of the drag operation. Such a visual
feedback could be highlighting a drop site so the user notices the
existence of a valid drop site. There are two sets of visual
feedbacks: the ``drag-over visuals'' of the initiator and the
``drag-under'' visuals of the receiver(s).
The drag operation as well as the handling of the drag-under visuals
are different depending on the operation mode of the drag:
- When both the initiator and receiver have agreed to use the
dynamic mode they exchange protocol messages dealing (for
example) with entering and leaving drop sites during the drag
operation. The advantages of this mode are that the X server is not
grabbed and can still respond to other event sources, and the
receiver can decide what data to accept on-the-fly. On the other
side, the dynamic operation mode requires more overhead on behalf of
the application and the network.
- The preregister mode is the other possible mode of
operation (the appropriate protocol is still undocumented). In this
mode, the M*TIF toolkit handles on behalf of the initiator client
the complete processing of the drag-under visuals which would
ordinarily occour in the receiver client. The receiver is not
involved in the process until the drop stage begins. But it has to
supply information about drop sites so the initiator can handle the
drag-under visuals accordingly. This mode minimises network trafic,
but the drop site can't determine whether it wants to accept the
drop data until the drop actually occurs. In addition, the server is
grabbed during the drag operation.
Next: 2. Protocol Messages
Up: 2. Protocol Basics
Previous: 2. Protocol Basics
  Contents
  Index
Danny Backx
2000-12-13