Menu

#35 Q: Can VcXsrv be made to yield focus to windows apps?

open
nobody
None
5
2018-11-03
2018-09-13
Wizek
No

Is it possible to tell VcXsrv to yield focus to Windows applications when they want to come into the foreground?

A way to reproduce the issue:

  • be on Windows 10
  • run vcxsrv (I run it in multi-window mode)
  • open C:\Windows\System32\wsl.exe
  • DISPLAY=:0 sudo apt install terminator && terminator
  • in terminator run: /mnt/c/Windows/system32/calc.exe
  • observe how calc.exe launches in the background while vcxsrv and terminator remains focused. It even blinks on the taskbar indicating that it wanted to get focus.
  • observe how launching calc.exe by other means (e.g. from cmd.exe, from powershell.exe, from wsl.exe) without vcxsrv being focused it is able to jump into the foreground as expected.

Of course the above are simplified repro steps, my real usecase has to do with launching and/or focusing a code editor, e.g. $EDITOR /path/to/file

Discussion

  • marha

    marha - 2018-10-01

    I do not think this is a problem of vcxsrv.
    If you change the following registry key to 0 and reboot, this does not happen anymore.
    HKEY_CURRENT_USER\Control Panel\Desktop\ForegroundLockTimeout

     
  • Wizek

    Wizek - 2018-11-03

    Huh, that's interesting. Thanks for the info, I shall give it a try.

    Any idea why cmd.exe and the others behave differently to vcxsrv though?

     

Log in to post a comment.