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:
Curtis Gedak 2019-02-07 13:25:48 -07:00
parent f75bc69dd7
commit 1ae0a77464

View file

@ -120,6 +120,10 @@ class fullScreenEditor(QWidget):
# self.showMaximized()
# self.show()
def __del__(self):
# print("Leaving fullScreenEditor via Destructor event", flush=True)
self.showNormal()
def setLocked(self, val):
self._locked = val
self.btnClose.setVisible(not val)
@ -221,6 +225,8 @@ class fullScreenEditor(QWidget):
def keyPressEvent(self, event):
if event.key() in [Qt.Key_Escape, Qt.Key_F11] and \
not self._locked:
# print("Leaving fullScreenEditor via keyPressEvent", flush=True)
self.showNormal()
self.close()
else:
QWidget.keyPressEvent(self, event)