Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

While browsing the web, I always close tabs using the middle-click and I'm wondering, would it be possible to close applications and windows by middle-click (Example: By clicking on the title bar) ?

Also, would it works in gnome 3 ? (Note that in the gnome Advanced Settings there is no close option for the middle-click)

share|improve this question

The Middle click has a special meaning in Unix like systems that use a certain library. If you mark text somewhere and then click on a field that accepts text, it will paste the marked text into that field (try it in your browser). So no matter what you do, you will not be able to make the middle-click work as expected for all applications.

However, you can try mapping the middle click to a keyboard key and then assigning a keyboard shortcut to close windows.

Keyboard Shortcut for closing windows

Another possibility is using the Many Button Mouse or IronAHK.

share|improve this answer

Ubuntu and Unity still depend on metacity(!) for this kind of action. So you would find all possible 'titlebar action' possibilities in gconf-editor >apps>metacity>general. Unfortunatelly (as in gnome3) there is no 'window close' option.

As there is no 'out of the box' solution for your idea, my approach would be different.

Most of your application will have a 'close' or 'quit' keyboard shortcut. That might be >ctrl< q for QUIT, or >ctrl< w for WINDOW CLOSE, or >ctrl<>shift< q to QUIT a gnome-terminal.

I would now install the software easystroke and add a mouse gesture for the given command. The same mouse gesture can have a different command, following the active window. Let's say a 'right click' and drawing a 'circle' would mean >ctrl< w for the filemanager, but >ctrl<>shift< q for the gnome-terminal.

This solution would give you a similar ease of use, as 'middle-clicking' the titlebar. Needless to say that I am using this kind of solution... ;)

Here is some video I found on the youtube... easystroke in action

share|improve this answer
Awesome ! It works great ! And doesn't use much CPU power. Thx – Noob Ubuntu User Aug 14 '12 at 13:10
If you like my answer, mark my question as 'answered'. Like that, both of us get some points, and others will stumble upon the answer much faster. – minimec Aug 15 '12 at 8:20

If you are using GNOME 3 then this extension will solve your problem. This applies to closing applications with middle click in the GNOME 3 Overview.

This extension is only rated to install with 3.8 or older BUT I have tested it in 3.10 and 3.12 and it works just fine in both...the version is simply not updated yet to 3.12 but the change is simple...just change the shell version in metadata.json or use the version by p91paul, which is basically what Paul did.

share|improve this answer

Your Answer


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.