I have created a MainWindow which creates a DialogA when a button is clicked. DialogA can then create DialogB. In this example DialogB is modal and closes DialogA when closed. Now, the unwanted behaviour that is occurring is that the MainWindow is also being minimized as well. Would anybody know how to prevent or explain why this is happening? Minimal reproducible code below, from PyQt6.QtCore import pyqtSignal, Qt from PyQt6.QtWidgets import QApplication, QDialog, QLabel, QPushButton, QVBoxLayout class DialogA(QDialog): def __init__(self, parent): super().__init__(parent) self.setWindowTitle("Dialog A") self.setLayout(QVBoxLayout()) self.layout().addWidget(QLabel("This is Dialog A")) open_dialog_b_button = QPushButton("Open Dialog B") open_dialog_b_button.clicked.connect(self.open_dialog_b) self.layout().addWidget(open_dialog_b_button) def open_dialog_b(self): dialog_b = DialogB(self) dialog_b.closed.connect(self.close_dialog_a) dialog_b.exec() def close_dialog_a(self): self.destroy() class DialogB(QDialog): closed = pyqtSignal() def __init__(self, parent): super().__init__(parent) self.setWindowModality(Qt.WindowModality.ApplicationModal) self.setModal(True) self.setWindowTitle("Dialog B") self.setLayout(QVBoxLayout()) self.layout().addWidget(QLabel("This is Dialog B")) close_button = QPushButton("Close") close_button.clicked.connect(self.on_close_button_clicked) self.layout().addWidget(close_button) def on_close_button_clicked(self): self.closed.emit() self.destroy() def closeEvent(self, event): self.closed.emit() super().closeEvent(event) if __name__ == "__main__": app = QApplication([]) main_window = QDialog() main_window.setWindowTitle("Main Window") main_window.setLayout(QVBoxLayout()) open_dialog_a_button = QPushButton("Open Dialog A") open_dialog_a_button.clicked.connect(lambda: DialogA(main_window).show()) main_window.layout().addWidget(open_dialog_a_button) main_window.show() app.exec() In addition, inside of DialogB if I change on_close_button_clicked to def on_close_button_clicked(self): self.destroy() The entire application is in a state of Modal, but nothing is clickable. Continue reading...