server: Track foreground process id, instead of looking for active window.

When foreground input is changed and given to a different process (for instance the desktop process), that process active window is not set until it handles its internal messages.

This might cause a race condition between the new activated process and the original process trying to steal foreground back. We might allow it to get foreground back if we don't find any active window at the time of the set_foreground_window call.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58167

Merge request reports

Loading