Skip to content

Commit

Permalink
Try to fix macOS X blank screen when leaving editor fullscreen mode
Browse files Browse the repository at this point in the history
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/
  • Loading branch information
gedakc committed Feb 9, 2019
1 parent f75bc69 commit 1ae0a77
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions manuskript/ui/editors/fullScreenEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ def __init__(self, index, parent=None):
# 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)
Expand Down Expand Up @@ -221,6 +225,8 @@ def resizeEvent(self, event):
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)
Expand Down

0 comments on commit 1ae0a77

Please sign in to comment.