mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-06-14 08:54:34 +12:00
Try to fix macOS X blank screen when leaving editor fullscreen mode
Ensure showNormal() is called after leaving showFullScreen(). See issue #24. References: https://stackoverflow.com/questions/31666744/pyqt5-can-not-close-a-topmost-fullscreen-qdialog-on-mac-osx https://doc.qt.io/qt-5/qwidget.html#showFullScreen - To return from full-screen mode, call showNormal(). https://pythonprogramminglanguage.com/destructor/
This commit is contained in:
parent
f75bc69dd7
commit
1ae0a77464
|
@ -120,6 +120,10 @@ class fullScreenEditor(QWidget):
|
||||||
# self.showMaximized()
|
# self.showMaximized()
|
||||||
# self.show()
|
# self.show()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
# print("Leaving fullScreenEditor via Destructor event", flush=True)
|
||||||
|
self.showNormal()
|
||||||
|
|
||||||
def setLocked(self, val):
|
def setLocked(self, val):
|
||||||
self._locked = val
|
self._locked = val
|
||||||
self.btnClose.setVisible(not val)
|
self.btnClose.setVisible(not val)
|
||||||
|
@ -221,6 +225,8 @@ class fullScreenEditor(QWidget):
|
||||||
def keyPressEvent(self, event):
|
def keyPressEvent(self, event):
|
||||||
if event.key() in [Qt.Key_Escape, Qt.Key_F11] and \
|
if event.key() in [Qt.Key_Escape, Qt.Key_F11] and \
|
||||||
not self._locked:
|
not self._locked:
|
||||||
|
# print("Leaving fullScreenEditor via keyPressEvent", flush=True)
|
||||||
|
self.showNormal()
|
||||||
self.close()
|
self.close()
|
||||||
else:
|
else:
|
||||||
QWidget.keyPressEvent(self, event)
|
QWidget.keyPressEvent(self, event)
|
||||||
|
|
Loading…
Reference in a new issue