Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS X: cannot leave fullscreen mode #24

Closed
olivierkes opened this issue Apr 4, 2016 · 21 comments
Closed

OS X: cannot leave fullscreen mode #24

olivierkes opened this issue Apr 4, 2016 · 21 comments
Labels
Milestone

Comments

@olivierkes
Copy link
Owner

When trying to leave fullscreen mode (either with ESC or close button), the editors closed but the screen remains black.

CMD+TAB allows to come back to manuscript, and desktop, though.

@olivierkes olivierkes added the bug label Apr 4, 2016
@gedakc
Copy link
Collaborator

gedakc commented Nov 21, 2018

Would someone with Mac OS X please test this reported inability to leave fullscreen mode to determine if this is still an issue with the latest version of Manuskript (currently 0.7.0)?

@madeonearth
Copy link

0.8.0
Manuskript opens fullscreen mode on a new desktop on Mac OS X. When you hit ESC Manuskript closes its fullscreen mode but leaves the new desktop open. This is why the user is left with a blank, black screen. When you swipe right with 3 fingers you are back on your main desktop. The problem is though for every time you open fullscreen mode a new desktop is opened and left open when you leave fullscreen mode!! After a while you might have a whole bunch of empty desktops open ...

@gedakc
Copy link
Collaborator

gedakc commented Feb 5, 2019

Thanks @madeonearth for your insight into this problem.

The problem seems similar in nature to Issue #456 - select which monitor in full screen mode

gedakc added a commit to gedakc/manuskript that referenced this issue Feb 7, 2019
Ensure showNormal() is called after leaving showFullScreen().

See issue olivierkes#24.

https://doc.qt.io/qt-5/qwidget.html#showFullScreen
  - To return from full-screen mode, call showNormal().

https://pythonprogramminglanguage.com/destructor/
@gedakc
Copy link
Collaborator

gedakc commented Feb 7, 2019

Currently the Travis-CI automatic builds for macOS are broken.

@madeonearth are you able and available to test code changes by running from source code on macOS?

@madeonearth
Copy link

looks like a time consuming task ;-)
let me look into it ...
don't expect me to get on it right away
I'd like to contribute though ...

@madeonearth
Copy link

Unfortunately it seems like my MacBookPro 2008 is too old for the required setup.
I am running macOS 10.11 El Capitan. Later OS Xs do not support my machine.
I am getting errors following the 'running from source code on macOS' guide:

Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
apache-arrow

Warning: You are using macOS 10.11.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience, as you are running this old version.

qt: A full installation of Xcode.app is required to compile this software.
Installing just the Command Line Tools is not sufficient.
Xcode can be installed from the App Store.
Error: An unsatisfied requirement failed this build.

@gedakc
Copy link
Collaborator

gedakc commented Feb 8, 2019

Thank you @madeonearth for trying. Unfortunately the Apple support window is short. As best I can tell Apple provides support for the last three releases, and with a release every year that makes for about 3 years of support. The short support window by Apple makes it hard for others to continue to provide support to releases that are unsupported by Apple.

See also Homebrew Community Discussion - Mac OS 10.11 support.

I will try to get the Travis CI build working, but without having direct access to macOS X it makes for trying times.

@gedakc
Copy link
Collaborator

gedakc commented Feb 8, 2019

Unfortunately I have not been able to get the Travis CI macOS X builds working.

Regardless, I believe that the changes in PR #482 should address the black screen on macOS X after leaving editor fullscreen mode. Further I have tested these changes on Kubuntu 16.04 GNU/Linux and Windows XP with no adverse effects observed.

As such I plan to merge the PR in the next day or so.

@gedakc
Copy link
Collaborator

gedakc commented Feb 9, 2019

The Travis CI macOS X builds are working again. :-)

@madeonearth would you be able to download and test the manuskript-0.8.0-issue24-test-osx.zip package to see if the problem with a blank screen after leaving editor fullscreen is fixed?

The package is available in the Manuskript testing-only folder on SourceForge.

@madeonearth
Copy link

I will have access to an up to date Mac within the next couple days.
Unfortunately can not mess around with homebrew and such on that machine but I can test Manuskript packages then.

On El Capitan I can not even run the compiled program!!

I'll be back ;-)

@gedakc
Copy link
Collaborator

gedakc commented Feb 10, 2019

On El Capitan I can not even run the compiled program!!

That doesn't surprise me because Apple dropped support for macOS X El Capitan (10.11). This has a ripple effect through all the projects that build upon this OS. See Manuskript commit 07c9ca5.

Please let us know if the issue is fixed on newer macOS X.

@madeonearth
Copy link

MacBookPro Mid 2012 OS X Sierra

Ok, half way there!!

Leaving full screen mode with ESC leaves the extra desktop and shows an empty window smaller than screen size hidden by the Manuskript main window on top. You have to manually close this window! No other desktop instance is left behind.
Unfortunately when I try to close full screen via close button on the upper right corner I am still left with the blank screen as before ... and worse playing around with it trying to leave the extra desktop instance Manuskript crashed I got an error hard to reproduce:

(oops ... with safari I can not edit git comments with the format functions !!?)

-> quote
Last login: Sat Feb 9 08:54:18 on console
/Users/MeinMac/Downloads/manuskript-2/manuskript ; exit;
MacBook-1:~ MeinMac$ /Users/MeinMac/Downloads/manuskript-2/manuskript ; exit;
Debug: Web rendering engine used: QWebEngineView
Running manuskript version 0.8.0.
Found translation in settings: manuskript_de.qm
Loaded translation from settings: manuskript_de.qm.
Loading: /Users/MeinMac/Downloads/manuskript/sample-projects/book-of-acts.msk
Detected file format version: 1. Zip: False.
Projekt /Users/MeinMac/Downloads/manuskript/sample-projects/book-of-acts.msk geladen.
2019-02-12 08:16:56.404 manuskript[3642:376336] *** Assertion failure in -[NSWindowStackController _enterWindow:intoFullScreenWithWindow:], /Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1504.83.101/WindowTabs/NSWindowStackController.m:892
Traceback (most recent call last):
File "manuskript/ui/editors/fullScreenEditor.py", line 314, in
AttributeError: 'QWidget' object has no attribute 'hideWidget'
Fatal Python error: Aborted

Current thread 0x00007fffd21383c0 (most recent call first):
File "manuskript/ui/editors/mainEditor.py", line 355 in showFullScreen
File "manuskript/main.py", line 101 in launch
File "manuskript/main.py", line 114 in run
File "manuskript", line 13 in
Abort trap: 6
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
Deleting expired sessions...none found.

[Prozess beendet]

<- quote

@gedakc
Copy link
Collaborator

gedakc commented Feb 12, 2019

Thanks @madeonearth for reporting back with your test results.

The changes I implemented were based on suggestions from Internet research. Unfortunately I have no way to directly test these changes on macOS X, and this makes it very difficult and time consuming to make any headway on this issue.

Because I do not have access to macOS X we will have to rely on someone with access to macOS X to develop and test a fix.

@madeonearth
Copy link

The way fullscreen mode handles hitting the ESC button now at least does not leave the user with a blank screen. If you would add the same routine to clicking the close button on the upper right corner the issue would not look as bad.
The user would know how to manually close the extra window!!

@gedakc
Copy link
Collaborator

gedakc commented Feb 12, 2019

Visually the only difference I see between the code areas is that ESC key press exits with:

self.showNormal()
self.close()

Whereas the Close button exits via the fullScreenEditor destructor with:

self.showNormal()

I can try adding the extra self.close() call.

gedakc added a commit to gedakc/manuskript that referenced this issue Feb 12, 2019
See issue olivierkes#24.

The first attempt to fix this problem was with commit:

    Try to fix macOS X blank screen when leaving editor fullscreen mode
    1ae0a77
gedakc added a commit that referenced this issue Feb 12, 2019
See issue #24.

The first attempt to fix this problem was with commit:

    Try to fix macOS X blank screen when leaving editor fullscreen mode
    1ae0a77
@gedakc
Copy link
Collaborator

gedakc commented Feb 12, 2019

@madeonearth would you be able to download and test the manuskript-0.8.0-issue24-test2-osx.zip package (note the test2) to see if the problem with a blank screen after leaving editor fullscreen via Close button is fixed?

The package is available in the Manuskript testing-only folder on SourceForge.

@madeonearth
Copy link

I am sorry but nothing changed really ...
When I am closing the empty window Manuskript crashes.
Using the Close button we still experience the desktop issue :-(
Closing that Manuskript crashes with the above Error output.

@gedakc
Copy link
Collaborator

gedakc commented Feb 12, 2019

Thanks @madeonearth for testing. We will have to rely on someone with access to macOS X to develop and test a fix.

@dschanoeh
Copy link
Contributor

dschanoeh commented May 1, 2019

I've been playing around with this for a bit (on MacOS Mojave) and I think the following commit resolves this mostly:
f00479e

The close button has the same effect as pressing escape when connected to this new method instead:

   def leaveFullscreen(self):
        self.showNormal()
        self.close()

I think this is different to the previous fix attempt since the button currently calls close() first. This order is what doesn't seem to work on macOS.

The issue of a small window remaining after exiting fullscreen is resolved by setting this attribute:

self.setAttribute(Qt.WA_DeleteOnClose, True)

Will these changes have negative impact on other platforms or should this be okay?
Also, one issue remains: The user might try to exit fullscreen the "macOS way" by pressing the green zoom button in the title bar. In that case, the window just gets resized to a very small size and has to be closed manually.

@gedakc
Copy link
Collaborator

gedakc commented May 1, 2019

Will these changes have negative impact on other platforms or should this be okay?

Please submit a Pull Request for proposed code changes. This will invoke our Travis CI tests and perform a minimum level of testing on GNU/Linux and macOS X.

@gedakc
Copy link
Collaborator

gedakc commented May 3, 2019

Thanks @dschanoeh for the PR code patch. It has been merged with the develop branch for inclusion in the next release of Manuskript.

@gedakc gedakc closed this as completed May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants