# Using PyQt5 5.11.2 (Qt 5.11.1) (latest at time of writing) # To see the bug: # - Enable "Stay on Top" in the third MDI window's window menu # - Drag the first MDI window around on top of the second from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QApplication, QMainWindow, QMdiArea, QMdiSubWindow, QLabel def main(args): global app app = QApplication(args) win = QMainWindow() mdi = QMdiArea() widgets = [QLabel('Drag me'), QLabel('over me'), QLabel('while I stay on top')] for w in widgets: sw = QMdiSubWindow() sw.setWidget(w) sw.resize(200, 200) mdi.addSubWindow(sw) win.setCentralWidget(mdi) win.show() widgets[0].setAttribute(Qt.WA_NativeWindow) return app.exec_() if __name__ == '__main__': import sys main(sys.argv)