4 ms·
Part of this is that UI toolkits do more and more disgusting things in order to preserve this behavior. Windows allows the foreground window to activate other w
by Jasper_ 9y ago
Part of this is that UI toolkits do more and more disgusting things in order to preserve this behavior. Windows allows the foreground window to activate other windows "owned by the same app" so that existing applications don't break. The implementation, for this, of course, is a pile of heuristics [0].
Qt, steadfast in its duty to be as annoying as possible, pretends it is part of the foreground app when you call activate() by calling AttachThreadInput [1].
[0] Documented heuristics, even. https://msdn.microsoft.com/en-us/library/windows/desktop/ms633539(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/ms6...
[1] https://github.com/qt/qtbase/blob/5.11/src/plugins/platforms/windows/qwindowswindow.cpp#L2194-L2209 https://github.com/qt/qtbase/blob/5.11/src/plugins/platforms...