After reconnecting screen windows stay on laptop

The problem is quite easy to reproduce with a laptop:

  1. Boot up with connected external screen, set up as primary.
  2. Disconnect external screen.
  3. Connect the screen again.
  4. All off the windows stay on the built in screen

Is there a way to solve it? This happened after I updated to ubuntu 22.04.

Hi - there’s a bug related to the situation you’re describing - 455066 – Windows don't remember what screen they were on if that screen is disconnected and reconnected - that’s been fixed in KDE Plasma releases for quite a while now.

However, Kubuntu 22.04 ships with an quite old version of KDE Plasma by default (5.24), one that was released before the version in which that bug was fixed (5.26).

It might be possible to use the Kubuntu team’s Backports PPA to upgrade to Plasma 5.27 while staying on version 22.04 of the Ubuntu base, but adding PPAs should be done with caution since they can introduce other potential issues.

Hope that helps,