Details
-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
No Version
-
None
Description
A common scenario with singleton applications is that second and later instances force the first instance into foreground. This would usually be the expected behaviour as this would make singleton applications behave more or less like applications that allow multiple instances.
However, both under Windows and modern X11 window managers, applications are only allowed to move to foreground if the second instance passes foreground token to the first instance. Windows uses AllowSetForegroundWindow() call and under X11 the second instance should pass its QX11Info::appUserTime (or perhaps QX11Info::appTime if user time is not initialized on program init) to the first instance which should update _NET_WM_USER_TIME of the window the application decides to move to foreground. So, it would be nice to have a method that behaves like sendMessage() but that also does this token passing (sendMessageAndForegroundToken() for example).