No he tenido suerte con los métodos anteriores, terminé teniendo que usar la api win32 directamente, usando un hack para la versión C here. Esto funcionó para mí:
from win32gui import SetWindowPos
import win32con
SetWindowPos(window.winId(),
win32con.HWND_TOPMOST, # = always on top. only reliable way to bring it to the front on windows
0, 0, 0, 0,
win32con.SWP_NOMOVE | win32con.SWP_NOSIZE | win32con.SWP_SHOWWINDOW)
SetWindowPos(window.winId(),
win32con.HWND_NOTOPMOST, # disable the always on top, but leave window at its top position
0, 0, 0, 0,
win32con.SWP_NOMOVE | win32con.SWP_NOSIZE | win32con.SWP_SHOWWINDOW)
window.raise_()
window.show()
window.activateWindow()
Muchas gracias. Funciona. – redice
¡Esto no funciona para mí si estoy ejecutando mi ventana desde la terminal! –
¡Funcionó bien en Ubuntu Unity! –