Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Sometimes Firefox doesn't release the mouse after dragging, so I need to kill the application to force it to release its pointer grab.

Is there any command to force an application to ungrab the pointer without killing it?

share|improve this question
2  
If you have the command line you can try to disable and re-enable the mouse. See this wiki page. I'm not sure it works, especially if the reason for the freeze is related to a Javascript issue. –  Guandalino Jun 10 '12 at 21:09
    
@Guandalino: I have command line (By opening another terminal by pressing Alt+F2); I will test this in the next occurrence of the problem, Thanks –  4r1y4n Jun 10 '12 at 21:13
2  
This is called a grab. As far as I know, there is no command-line utility to manipulate grabs. –  Gilles Jun 11 '12 at 0:44
    
I started having this problem with Firefox 13, and a web search brought me to this question. Are you by any chance using the Tree Style Tabs extension? It seems to be some problem with dragging tabs. –  Juliano Jun 12 '12 at 22:53
    
@Juliano: I didn't used Tree Style tabs ext. ! And Up now I didn't seen problem again so I didn't tried solutions too. –  4r1y4n Jun 19 '12 at 6:35

3 Answers 3

On modern-ish X.org installations, there is an XF86Ungrab keysym, which causes the server to release all active pointer or keyboard grabs. You can make the server break all grabs by generating the keysym either with a command or with the keyboard. With xdotool:

xdotool key XF86Ungrab

On some systems, the XF86Ungrab keysym is bound to the key combination Ctrl+Alt+Keypad /. However this possibility is often turned off because it could allow bypassing a screensaver).

share|improve this answer
1  
I think that shortcut is disabled by default now. But you can use xdotool to perform the same action. –  Mechanical snail Jan 23 '13 at 9:54

I answered this on Super User, and am quoting it here:

[As Gilles noted,] 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

Ctrl + G will release mouse focus in most situations.

share|improve this answer
    
Sorry I'd like to understand better, is this a linux specific thing or firefox? –  Guandalino Jun 10 '12 at 22:23
    
Linux, not completely sure, but i think it is a xorg function. I use it often to release focus from fullscreen videogames. –  arx Jun 10 '12 at 22:36
1  
I doubt that this work; it is a single modifier plus a key, these combinations are used for applications (e.g. firefox activates "Find" box with this) and not for something like X (X uses keys like Alt+Ctrl+Backspace)! after that I tried it in a normal drag and drop and nothing happened! –  4r1y4n Jun 11 '12 at 0:48
2  
That is not the case in any version of Firefox that I've seen, and it is definitely not the case “in most situations”: many applications use Ctrl+G for their own purposes, there is no such X-wide binding. –  Gilles Jun 11 '12 at 0:49

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.