3

How can I prevent other applications from stealing focus from the active window? I have found solutions for other window managers, but nothing for "Metacity (Marco)" (the window manager of the MATE desktop manager).

I don't want to have to specify every time which window must be "always on top", unless it can be done automatically every time I switch to a new window.

I have determined the window manager by running wmctrl -m.

EDIT:

I have tried switching the focus-new-windows flag from smart to strict for both Gnome and Mate(Marco):

$ gsettings set org.gnome.desktop.wm.preferences focus-new-windows strict
$ gsettings set org.mate.Marco.general focus-new-windows strict

But it didn't work.

Eleno
  • 1,849
  • 4
  • 27
  • 39
  • 1
    AFAIK, MATE is a desktop environment. It isn't a window manager. Depending on which version of MATE you're using, you may have a choice of window managers to choose from. – DK Bose Feb 09 '16 at 15:14
  • @DKBose: Thanks for the observation. The window manager is Metacity. I have updated my question. – Eleno Feb 09 '16 at 16:20
  • Please see if this (old) blog post is of help: http://bertrandbenoit.blogspot.in/2011/09/change-window-behavior-to-prevent-focus.html – DK Bose Feb 09 '16 at 16:26
  • Thanks, but `gconftool-2 ` says that the value `/apps/metacity/general/no_focus_windows` does not exists (and indeed the whole `/apps/metacity` tree is missing. – Eleno Feb 09 '16 at 17:31
  • well... `focus-new-window` wont work since the description says: *This option provides additional control over how newly created windows get focus. It has two possible values; "smart" applies the user's normal focus mode, and "strict" results in windows **started from a terminal** not being given focus.* – DJCrashdummy Mar 06 '16 at 09:41
  • if you found solutions for other window manager, with the adapted command `gsettings set com.linuxmint.desktop mate-window-manager marco` you can maybe use one of them! **...and post your solution if you succeed! ;-)** – DJCrashdummy Mar 06 '16 at 09:44
  • interesting... after playing around a little bit, i noticed it also depends on the **application and launcher** (?) which you are using: firefox for example is not stealing focus if you start it via shortcut from the panel or desktop, but it does if you start it via the normal mint menu. and on the other side libreoffice is stealing focus whatever starter you use! – DJCrashdummy Mar 06 '16 at 11:43
  • In the end, I switched to Xfce, so I am not using Metacity anymore. – Eleno Mar 06 '16 at 13:26

1 Answers1

0

In general, you need to install an extension to eliminate the behavior in gnome-shell, where gnome displays a "Window is ready" notification rather than giving the new window focus. The extension "Noannoyance" appears to be the best maintained, but alternatively "Steal My Focus" or "Focus my window" probably still work fine.

link: https://extensions.gnome.org/extension/2182/noannoyance/

Yao Li
  • 21
  • 5