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,9 +500,11 @@ 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)
if refresh_window:
self.hide() self.hide()
self.show() self.show()