Scenario It's a pyside2 program running in Liunx system. There is a menu that every item in it is a exec. Every time I clicked the item, the exec starts if it's not started. The exec will pops up to the front if the exec is started. all the execs are External programs that I can't let them show just by change the code.
approaches I use the xprop command to get the QT window handle, then use the QWindow apis to let the window show. just like this:
window = QWindow.fromWindId(handle)
window.setFlags(window.flags() | Qt.WindowStaysOnTopHint)
window.show()
It works but has the problem that it always stays on top. I change the code like this:
window = QWindow.fromWindId(handle)
window.setFlags(window.flags() | Qt.WindowStaysOnTopHint)
window.show()
window.setFlags(window.flags() & ~Qt.WindowStaysOnTopHint)
window.show()
It does'not work, How can I just let the window to pop up to the front, not always on the top? By the way, the requestActivate() and raise() not works either.