Bug 7160 - Adding or removing a monitor in fullscreen on macOS results in black screen(s)
Summary: Adding or removing a monitor in fullscreen on macOS results in black screen(s)
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: VNC (show other bugs)
Version: trunk
Hardware: Mac macOS
: P2 Normal
Target Milestone: MediumPrio
Assignee: Pierre Ossman
: 7248 (view as bug list)
Depends on:
Blocks: 7007
  Show dependency treegraph
Reported: 2018-04-23 15:00 CEST by Peter Åstrand
Modified: 2022-01-04 16:38 CET (History)
2 users (show)

See Also:
Acceptance Criteria:


Description Peter Åstrand cendio 2018-04-23 15:00:44 CEST
Adding or removing a monitor in fullscreen mode on our 10.13.3 machine results in completely black screens. It is possible to recover by pressing "F8, down, Enter", so apparently vncviewer still runs. 

The problem has been verified with ThinLinc client build 5702, as well as my manual vncviewer build of upstream TigerVNC (including patches for bug 7007).

I think it makes sense to try fixing bug 6116 and see if that improves things.
Comment 1 Peter Åstrand cendio 2018-04-24 11:57:32 CEST
Apparently "impossible":

Comment 2 Peter Åstrand cendio 2018-04-24 15:15:27 CEST
This problem only happens when using "Send system keys", ie keyboard grabbing. Also, in our lab, it only happens on the 10.13 machine; not on 10.6. 

I've tried various methods to detect if a screen has been connected or disconnected, without success. The number of screens stays the same (CGGetActiveDisplayList). The window "level" is the same. No interesting events delivered, as far as I can tell.
Comment 3 Peter Åstrand cendio 2018-04-24 21:50:03 CEST
Tested on 10.12.4:

The screen does not turn black. However, the client is not notified of the screen change (not even with patches; FL_SCREEN_CONFIGURATION_CHANGED is not generated). This means:

* If a second monitor is removed, the ThinLinc session will continue to think that there are two monitors.

* If a second monitor is added, macOS will not even start using it, until fullscreen mode is exited. (The monitor blinks in power save mode.)

(Apparently, when in fullscreen mode and using captured displays, everything is "locked". I even checked with "system_profiler SPDisplaysDataType": The output shows that the second monitor is online, even after pulling the connector. It is not until fullscreen mode is exited that the data is updated.)
Comment 4 Pierre Ossman cendio 2018-05-09 13:16:32 CEST
We could explore using an alternative method of grabbing the keyboard. See bug 4660 for one such method.
Comment 5 Peter Åstrand cendio 2018-09-12 08:52:28 CEST
*** Bug 7248 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.