Blob Blame History Raw
diff --git a/backends/xrandr/xrandrconfig.cpp b/backends/xrandr/xrandrconfig.cpp
index 04b37bd..c28250c 100644
--- a/backends/xrandr/xrandrconfig.cpp
+++ b/backends/xrandr/xrandrconfig.cpp
@@ -507,6 +507,12 @@ bool XRandRConfig::disableOutput(Output* output) const
                  0, 0, None, RR_Rotate_0, NULL, 0);
 
     kDebug(dXndr()) << "XRRSetCrtcConfig() returned" << s;
+
+    // Update the cached output now, otherwise we get RRNotify_CrtcChange notification
+    // for an outdated output, which can lead to a crash.
+    if (s == RRSetConfigSuccess) {
+        m_outputs.value(output->id())->update();
+    }
     return (s == RRSetConfigSuccess);
 }