Restore correct window visibility after decoration config change

This commit is contained in:
rien333 2018-03-23 15:19:37 +01:00
parent e2250d65e9
commit 880b33fff5

View File

@ -500,11 +500,13 @@ class MainWindow(QWidget):
def _set_decoration(self, hidden): def _set_decoration(self, hidden):
""" Set the visibility of the window decoration via Qt.""" """ Set the visibility of the window decoration via Qt."""
window_flags = Qt.Window window_flags = Qt.Window
refresh_window = self.isVisible()
if hidden: if hidden:
window_flags |= Qt.CustomizeWindowHint | Qt.NoDropShadowWindowHint window_flags |= Qt.CustomizeWindowHint | Qt.NoDropShadowWindowHint
self.setWindowFlags(window_flags) self.setWindowFlags(window_flags)
self.hide() if refresh_window:
self.show() self.hide()
self.show()
@pyqtSlot(bool) @pyqtSlot(bool)
def _on_fullscreen_requested(self, on): def _on_fullscreen_requested(self, on):