21

Let's say I have Gthumb open, and then launch Nautilus from the Unity launcher (in 12.04). Why does it sometimes not focus the mouse on Nautilus, which I just launched? Instead, the focus remains on Gthumb while Nautilus opens in front of Gthumb (and not being focused on).

Is this correct behaviour?

0

3 Answers 3

28
+50

You can configure it with CompizConfig-Settings-Manager.

1) Install it: sudo apt-get install compizconfig-settings-manager,

2) Open ccsm (Alt + F2 and type ccsm and hit Enter)

3) Go to "General Options" > "Focus & Raise Behaviour" and set "Focus Prevention Level" to "Off".

4) Enjoy ;-)

enter image description here


If you are feeling lazy, just paste this at terminal and you're done:

gconftool-2  --type=Integer --set /apps/compiz-1/general/screen0/options/focus_prevention_level 0  
3
  • 2
    I've done this and will test it over the next day or or so. So far so good...
    – Gonzoza
    May 3, 2012 at 5:24
  • At 14.04, the path for focus_prevention_level in the command line to gconftool-2 is /org/compiz/profiles/unity/plugins/core Apr 25, 2014 at 14:33
  • This answers the question "how to move focus to a newly opened application" which was not the question asked.
    – Lexible
    Jan 10, 2019 at 21:26
11

No it is not correct behavior. The answer to the question "why is it happening" is because there is a bug. I suggest submitting a bug report. Surprisingly I cannot find an existing bug report for this, though I can confirm that it does happen. Post a link to the bug when you have done it so I can attach myself to it.

Edit: Found it. Bug #781931 Not sure why this answer has been down voted as it is certainly the answer to the question of why this happens. The work around using ccsm is not an answer to the question, it is a workaround for the bug. That in itself is very useful and worth posting but it does not answer the question that was asked.

3
  • Well, the Compiz answer seems to have made the correct difference.
    – Gonzoza
    May 4, 2012 at 11:02
  • 4
    The point is that question you asked was "Why does it sometimes not focus the mouse on Nautilus", not "How to make it correctly focus on Nautilus" so the correct answer to the question you asked is that it is a bug. No doubt the workaround is very useful but it is not the answer to the question you asked, it is the answer to a different question.
    – clanlaw
    May 4, 2012 at 15:16
  • I think it has been downvoted because bugs are off topic and so if this is a bug, the question should be voted to be "closed as off topic".
    – mchid
    Feb 9, 2019 at 23:16
8

The command above didn't work for me and I didn't want to install CCSM, so I did some digging and found that the following command did the trick (I'm using Ubuntu 15.04):

dconf write /org/compiz/profiles/unity/plugins/core/focus-prevention-level 0

Edit: This solution still works for 16.04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .