Overview¶
In general:
def main()
o = waitForObject({"type": "org.eclipse.swt.widgets.Shell", "visible": "true"})
o.forceActive()
Also see:
Additional settings for Linux¶
On Linux systems you may have to configure one of the following.
Ubuntu¶
Set the entry...
CompizConfig Settings Manager
> General
> General Options
> Focus & Raise Behaviour
> Focus Prevention Level
...to Off
. (May require installing the CompizConfig Settings Manager
.)
Other Linux distributions¶
Set the entry...
System Settings
> "Window Behavior
> Window Behavior
> Focus
> Focus stealing prevention level
...to None
.
(German: "Fensterverhalten
", "Fensterverhalten
", "Aktivierung
", "Vorbeugung gegen unerwünschte Aktivierung
".)
Additional settings for Windows¶
On Windows you may have to configure the registry entry ForegroundLockTimeout ( google ForegroundLockTimeout ).
Reading the existing value in cmd.exe (Command Prompt
):¶
reg query "HKEY_CURRENT_USER\Control Panel\Desktop" /v ForegroundLockTimeout
Setting (overwriting) the existing value in cmd.exe (Command Prompt
):¶
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ForegroundLockTimeout /t REG_DWORD /d 0 /f
Notes¶
It is possible that the value does not exist. In that case it must be added.
To disable this mechanism, which interferes with application/window activation, the value of the ForegroundLockTimeout entry must be set to 0.
Changing this entry requires to log out (alternatively a reboot) to take effect.
Updates to Windows may reset this registry entry.
To handle this, consider setting up an automated task that keeps settings this entry to 0. For example a .bat file in the user'sStartup
folder (see Configure Startup Applications in Windows ), which executes:reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ForegroundLockTimeout /t REG_DWORD /d 0 /f