29

In XFce4, when I launch applications, I don't want them to appear above the windows I am currently using, or to show alert windows above my current work. Rather, I'd like the windows to load in the background and to not steal focus. The exception would be an alert window or dialog belonging to the application I'm using, e.g. if I am currently using LibreOffice Calc, and it gives me a pop-up to tell me an error, that window can be brought to focus.

Is there any way to prevent windows from stealing focus in Xfce4?

Braiam
  • 35,380
  • 25
  • 108
  • 167
Village
  • 4,655
  • 14
  • 46
  • 80

6 Answers6

19

Settings/Window Manager/Focus

  • Focus follows mouse (on) [shouldn't matter, but the focus stealing prevention setting seems to work better with this on]

  • Automatically give Focus to newly created windows (off)

Also

Settings/Window Manager Tweaks/Focus

  • Activate Focus Stealing Prevention (on)
  • Honor standard ICCCM focus hint (off)
  • When a window raises itself, (do nothing)
  • 6
    Xfce 4.12, does not work for all applications (e.g. NetBeans IDE 8.1), will steal focus (even when clicking in this window after splashscreen, it will just gain focus again later). – Yeti Sep 15 '16 at 06:52
  • 5
    Does not work for Intellij Idea either. – Klesun Mar 12 '18 at 13:11
6

Settings manager >> window manager >> focus tab. Uncheck automatically give focus

3

For me, Xfce's focus stealing prevention only works when you also have Focus Follows Mouse turned on.

Running Xfce 4.10.1

TheAmigo
  • 373
  • 1
  • 2
  • 13
2

If nothing from previous answers helped you, you must additionally go to Settings-> Window Manager Tweaks -> Accessiblity tab and unselect "Raise windows when any mouse button is pressed"

likeanowl
  • 21
  • 2
1

Disabling these prevented focus changes in a Xubuntu session on

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 19.10
Release:    19.10
Codename:   eoan

Xfconf Settings Editor

Settings, Window Manager should set the same:

Window Manager Settings

Cees Timmerman
  • 487
  • 5
  • 17
  • do you mean 'all the things with the ticks should be turned off', or 'it should like like this'? – John Lawrence Aspden Dec 31 '19 at 17:14
  • 1
    I meant "disabling these" as in toggling the enabled Boolean settings shown to the disabled state. Also i'm not sure how hinting relates to focus. – Cees Timmerman Jan 01 '20 at 19:15
  • `focus_hint` [appears to focus input windows and those that request focus.](https://github.com/xfce-mirror/xfwm4/search?q=focus_hint&unscoped_q=focus_hint) – Cees Timmerman Jan 03 '20 at 15:16
0

In case you're using Compiz settings manager I was able to get focus to all new windows launched by setting (from the ccsm menu) General Options> Focus & Raise Behaviour>Focus Prevention Windows to Off