Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When the following happens:

  1. I start a drag-and-drop operation, starting from application ABC.
  2. Application ABC locks up (temporarily)
  3. I release the mouse button

then, until application ABC finishes processing, I have the following problems:

  • Other programs cannot "grab" the mouse pointer
  • The drag-and-drop cursor remains active
  • I cannot click anything
  • I cannot open the gnome-panel or GNOME menu
  • I cannot press certain keys (including space, enter, arrow keys)

Obviously, I then cannot do other work while waiting for the application to finish.

A situation when this occurs is when I have ~500 firefox tabs open, when dragging tabs it sometimes freezes for half an hour or so.

A workaround is to use a terminal by pressing Ctrl-Alt-F1, log in, run killall ABC to kill the offending application, and press Ctrl-Alt-F7 to get back to the graphical environment. But I would rather not have to kill ABC, instead letting it finish processing, while getting my mouse back.

So, is it possible to forcibly abort a drag-and-drop / un-grab the mouse pointer from a busy program, without killing the process?

share|improve this question
1  
My bet is that doing this as you're asking would require some programming alterations to gnome. But indeed, I'd like to know myself. I too am a connoisseur of Firefox abuse. (+1) –  Doc Aug 29 '11 at 16:40
    
@Doc: I installed an extension to count them. Currently I have 1295 tabs open. (Of course the issue isn't specific to Firefox.) –  Mechanical snail Aug 29 '11 at 23:36
3  
Can't you just abort the drag-and-drop by pressing ESC before releasing the mouse button? –  mins Jan 11 '12 at 22:37
1  
+1 this doesn't only happen with firefox, I experienced this with totem quite a few times. –  Jens Mühlenhoff Feb 26 '12 at 10:47
    
In my case this doesn't help. –  Jens Mühlenhoff Feb 26 '12 at 10:48
add comment

2 Answers

In most operating systems or window systems you can abort a mouse drag handler by pressing the Escape button. And sometimes you can cancel the even by finding or using a "drag cancel" target like Mac os's top menu. For example in most Windows you will notice cursor changes to circle with line through it, like a classic No Smoking sign or No Diving type of sign in the real world ;)

In the case of OP, they are using GNOME / Firefox:

In Gnome, in most cases hitting escape key before letting go of mouse button will (should) cancel the drag/drop event. It is even part of their dev guidelines:

http://developer.gnome.org/hig-book/3.2/input-mouse.html.en#drag-drop-override

Allow all mouse operations to be cancelled before their completion. Pressing the Esc key should cancel any mouse operation in progress, such as dragging and dropping a file in a file manager, or drawing a shape in a drawing application.

and..

Allow the user to cancel a drag and drop operation by all of these methods:

  • pressing Esc before releasing the mouse button dropping the object
  • back on its original location performing a query drag and selecting
  • Cancel on the pop-up menu (see Section 10.1.3.1.2 ― Query Drag)
  • dropping the object on an invalid drop target.

I am sure it is the same in KDE from doing a few searches

On Mozilla dev's Drop Event

drop The drop event is fired on the element where the drop was occured at the end of the drag operation. A listener would be responsible for retrieving the data being dragged and inserting it at the drop location. This event will only fire if a drop is desired. It will not fire if the user cancelled the drag operation, for example by pressing the Escape key, or if the mouse button was released while the mouse was not over a valid drop target. For information about this, see Performing a Drop.

I never said this would work all the time in EVERY setup, for example I don't think this works on Ubuntu which is kind of lame. I remember the drag event abort working with the Escape key since in wondows since version 3.1.

In all MS Windows operating systems in almost all (properly coded) applications: - hitting the escape key before releasing the mouse button during a drag/drop mouse event will cancel/abort the handler function.

For example in Google Chrome on Windows7: - drag a tab off the toolbar as if you are going to detach it and before letting go, hit your keyboard Escape key. It should abort the drag and return your tab.

share|improve this answer
    
Really? I've never seen this, what are these operating systems? –  terdon Aug 26 '12 at 18:30
    
What OSes/Window systems do you use? Have you tried it. Let me update my answer for you. –  Anthony Hatzopoulos Aug 27 '12 at 1:56
    
Thanks for the detailed info @AnthonyHatzopoulos. I thought you meant that Esc could abort a drag and drop operation after the mouse has been released and the operation has begun. That is what the OP is asking for. Still, +1 for effort :) –  terdon Aug 27 '12 at 10:40
add comment
up vote 1 down vote accepted

In fact, it is possible to do this (at least with recent versions of X).

You can do this by pressing the XF86Ungrab key, introduced in this commit.

By default, this keysym is not bound to any physical key or key combination (it was disabled in 2012 after it was reported as a security hole, since it allows anyone to bypass lock screens by breaking their grabs). On some other setups it is bound to a shortcut that uses the number pad. Obviously, that won't work on laptops that lack a keypad.

But you can still activate the keysym using xdotool:

xdotool key XF86Ungrab

This works with X.org version 2:1.11.4-0ubuntu10.8 on Ubuntu Precise.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.