I'll close this one as there doesn't seem to be a generic solution to this issue.
Just for the record, when using KDE/Plasma, the focus stealing prevention option can help to mitigate behaviors as you observe.
Originally posted by @bootleg in #18 (comment)
===========================
You only need Hook IDA SetForegroundWindow to solve the problem
