Behind the scenes

Detecting a drag

To detect a drag is performed Dragme is listening to all mousedown and mouseup events. If the mouse stays down longer than 100ms Dragme starts to poll the mouse position. By polling the mouse position it’s possible to detect if the mouse pointer is draged to the border of the screen.

Should Dragme become active?

Sometimes the mouse is draged for another reason than a drag and drop action and it isn’t desired that Dragme becomes active. The most applications make use of the public drag and drop pasteboard to copy the dragged data from one application to another. Dragme checks for changes on the drag and drop pasteboard to determine that a drag is performed that should be detected by Dragme. If no change happend on this pasteboard during the drag, Dragme won’t get active.

Some applications use their own private pasteboard for drag and drop operations. In this case a drag won’t be detected by Dragme because it can only check the public pasteboard. If you notice that a drag from one application isn’t detected by Dragme, you can deactivate the pasteboard check for this application. You do this by choosing “deactivate PB-count check for this applcation” in the menu.

If the “PB-count check” is deactivated Dragme will use another method to figure out if Dragme should become active. This is called the “Accessibility check”. It uses the accessibility functions to check the object below the mouse pointer when the drag starts. If it isn’t a item that normal can be dragged, Dragme won’t become active. You can deactivate this check too by choosing “deactivate Accessibility-Check for this application”. If both checks are deactivated Dragme will become active for every drag to the border of the screen.