how to make X11 ignore monitors disconnecting

I have a KVM switch (as in keyboard/mouse/video switch, not kernel-based virtual machine :p) and it often goes wacky when switching away from my openSUSE 13.1 box. Sometimes KWin goes broken glass, other times it’s all black except for the cursor.

Is it possible to make X11 ignore monitor disconnects entirely? I want it to just pretend the monitors are always connected.

I use the proprietary NVidia drivers. I have a xorg.conf just to define how the dual-monitors work (only one of the monitors is connected via the KVM switch).

Try to disable the “KScreen2” service in “Configure Desktop”->“Launch and Quit”->“Service Management”.

That didn’t work, it went broken glass when switching away.

Hm, I hope you logged out/rebooted after disabling that?

Maybe this xorg.conf option will help then?

Option “ConnectedMonitor” “string”

Allows you to override what the NVIDIA kernel module detects is connected to your graphics card. This may be useful, for example, if you use a KVM (keyboard, video, mouse) switch and you are switched away when X is started. In such a situation, the NVIDIA kernel module cannot detect which display devices are connected, and the NVIDIA X driver assumes you have a single CRT.

Valid values for this option are “CRT” (cathode ray tube), “DFP” (digital flat panel), or “TV” (television); if using TwinView, this option may be a comma-separated list of display devices; e.g.: “CRT, CRT” or “CRT, DFP”.

It is generally recommended to not use this option, but instead use the “UseDisplayDevice” option.

NOTE: anything attached to a 15 pin VGA connector is regarded by the driver as a CRT. “DFP” should only be used to refer to digital flat panels connected via a DVI port.
When this option is set for an X screen, it will be applied to all X screens running on the same GPU.
Default: string is NULL (the NVIDIA driver will detect the connected display devices).

taken from the nvidia driver’s README file:
ftp://download.nvidia.com/XFree86/Linux-x86/331.67/README/xconfigoptions.html

I’m not having any problem here. One of the two computers has nVidia graphics, and the other has Intel graphics.

The KVM switch is from IOgear. At one time, I tried a Belkin KVM switch, and it caused a mess.

This is a DisplayPort switch, I think with VGA stuff KVM’s worked a lot better.

That totally worked! Thanks!