Fixing KDE 5 crashes upon monitor connection in Fedora 23

published Mar 23, 2016

KDE 5 has a nasty bug in its libraries that causes applications like KWin and Plasma to crash. Here is the fix.

This bug manifests itself very often with the NVIDIA proprietary driver -- segfaults with KDE applications rendering the desktop unusable when resuming a laptop, connecting a new monitor, or disconnecting a previously-connected monitor.

The only reliable fix is to configure your Xorg with a static screen configuration that will not support on-demand removal or addition of monitors at runtime.  Here is an example hardware.conf Xorg snippet that you can place in your /etc/X11/xorg.conf.d directory to fix the issue:

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "ACER"
    ModelName      "Example Model Name"
    HorizSync       30.0 - 70.0         # This may vary depending on your monitor. 
    VertRefresh     50.0 - 75.0         # This may vary depending on your monitor.
    Option         "DPMS"
    Option         "DPI" "100 x 100"    # Make default fonts larger.
    Option         "UseEdidDpi" "Off"   # Do not take DPI info from monitor.
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 880"    # Varies depending on the board.
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "nvidiaXineramaInfoOrder" "DFP-1"   # Force only DFP-1 connector.
    Option         "MetaModes" "DFP-1: 1920x1080"      # Force graphics mode for DFP-1.
    Option         "ConnectedMonitor" "DFP-1"          # Force the card to believe this.
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection