I have my Ubuntu 19.10 HTPC plugged-in to a HDMI switch, which then routes to my monitor. Most of the time that HDMI switch is set to my Nvidia ShieldTV streaming device, and the TV is off.
When I VNC into my HTPC, I am often unable to do anything on the screen. Mouse and keyboard inputs through VNC are completely ignored. Looking through syslog, I found a "monitor is undefined" error.
Oct 21 15:37:30 myhost gnome-shell[1119]: JS ERROR: Extension dash-to-panel@jderose9.github.com: TypeError: monitor is undefined#012checkIfFocusedMonitor@/home/myuser/.local/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/panelManager.js:266:9#012_adjustForOverview@/home/myuser/.local/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/panel.js:429:32#012enable@/home/myuser/.local/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/panel.js:112:9#012enable@/home/myuser/.local/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/panelManager.js:72:9#012_enable@/home/myuser/.local/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/extension.js:91:5#012enable@/home/myuser/.local/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/extension.js:63:5#012_callExtensionEnable@resource:///org/gnome/shell/ui/extensionSystem.js:132:13#012loadExtension@resource:///org/gnome/shell/ui/extensionSystem.js:264:21#012_loadExtensions/<@resource:///org/gnome/shell/ui/extensionSystem.js:482:13#012collectFromDatadirs@resource:///org/gnome/shell/misc/fileUtils.js:27:17#012_loadExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:457:9#012_enableAllExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:491:13#012_sessionUpdated@resource:///org/gnome/shell/ui/extensionSystem.js:522:13#012init@resource:///org/gnome/shell/ui/extensionSystem.js:32:9#012_initializeUI@resource:///org/gnome/shell/ui/main.js:245:5#012start@resource:///org/gnome/shell/ui/main.js:141:5#012@<main>:1:31
Sure enough, when I turned the TV on everything immediately starts to work after a systemctl restart gdm (which did not work previously).
From my research, I found this question below which addresses running Ubuntu headless.
How to use Ubuntu 18.04 on VNC without display attached?
However I am not running headless, I have a monitor attached, it's just turned off. Any way to make this work at the X/Gnome level?
Additionally I tried disabling all Gnome extensions entirely in the tweak tool and the problem still happened. So this is not an extension problem.