https://bugs.kde.org/show_bug.cgi?id=453554

            Bug ID: 453554
           Summary: turning one monitor off kills the panel configuration
                    of the second monitor
           Product: plasmashell
           Version: 5.24.5
          Platform: Gentoo Packages
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Multi-screen support
          Assignee: plasma-b...@kde.org
          Reporter: k...@kaishome.de
                CC: aleix...@kde.org, notm...@gmail.com
  Target Milestone: 1.0

SUMMARY

Monitor setup (xrandr dump at the end):

Left main monitor: 4k displayport
* top plasma panel with activity switcher, global menu, date and time, systray
* bottom plasma panel with launch menu, icon window list, desktop switcher

Right small monitor: full HD HDMI connected via DP
* top plasma panel with window list, time, bluetooth applet, volume applet

TV: 4k, HDMI
* clone of left monitor (for couch gaming)

Graphics:
NVIDIA GTX 1660 Ti 6GB with Xorg

Whenever I turn off my main monitor, all its panels move over to the right
monitor. The same happens if the TV turns off or goes to sleep. Sometimes
(probably before 5.24.5), I can see two overlapping panels at the top (my main
top panel plus the simple side monitor panel) but since 5.24.5 the panel moves
consistently, replacing the configuration of the right monitor.

This was fine most of the time before 5.24.5 and consistently fine before
5.24.4: The panels were restored when I turned the main monitor back on, only
messing up if plasma crashed or shut down before turning the monitor back on.

But now it consistently throws away the plasma configuration of the right
monitor: After turning the main monitor back on, I'm left with an empty default
desktop on the right monitor, no custom background image, no panels, but all
open windows moved to this monitor.

Looking at the output of `qdbus org.kde.plasmashell /PlasmaShell
org.kde.PlasmaShell.dumpCurrentLayoutJS` I can see that each incident adds
another panel configuration in `layout.panels` but I have no way of getting it
back.

`plasmashellrc` has these lines:
```
[ScreenConnectors]
0=DP-4
1=HDMI-0
2=DP-1
```

It also had `2=:0.0` followed by `3=DP-1` but I removed that out of
desperation. It wasn't present in older backups of my system. It didn't change
anything about the behavior, tho.

STEPS TO REPRODUCE
1. Use a setup like I described above
2. Turn the displayport monitor off which seems to disconnect it from the
system (my DP monitor and HDMI TV do that when turning them off, my HDMI
monitor doesn't do it and seemingly stays connected/detected)
3. Observe the panels move over to the second screen
4. Turn first monitor back on

OBSERVED RESULT
After step 4, the panels move back to the monitor just turned back on but step
2/3 seem to have displaced the panel/desktop configuration of the second
monitor, and after step 4, plasma will replace it with an empty default
configuration.

EXPECTED RESULT
The panels should be properly restored to their respective original monitors. I
guess it's fine and wanted that disconnecting the primary monitor would move
panels over to remaining monitors, e.g. for laptop usage. But when I restore
the original monitor connection for which I configured the panels, that
configuration should be restored, or at least I should have an easy way to
choose which panel configuration I want to restore. But in my case, it's gone
for good although it still seems to live in the qdbus layout dump (and it's
piling up there because I need to recreate the layout multiple times per day).

I think Plasma should store and apply layouts like this:

Store a layout of each monitor, also store a flag if this was made on the
primary monitor. If the current monitor is the primary monitor, use the panel
layout of the original primary monitor. Otherwise fall back to the layout
originally defined for this monitor. Do not remove but swap layouts when the
primary layout flag is involved. Move the primary layout flag only when the
layout is actively edited.

SOFTWARE/OS VERSIONS
Operating System: Gentoo Linux
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.3
Kernel Version: 5.15.37-gentoo (64-bit)
Graphics Platform: X11
Processors: 20 × 12th Gen Intel® Core™ i7-12700K
Memory: 31.1 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1660 Ti/PCIe/SSE2

ADDITIONAL INFORMATION

This behavior was triggered very rarely before 5.24.4, easily triggered with
5.24.4, and consistently triggers with 5.24.5. Given that history of behavior,
it's probably some race condition and is not intentional.

My clone monitor layout may play a role in this because I found in older
versions some months back, that sometimes plasma panels would be defined for my
TV instead of my main monitor (when I disabled the TV, all panels were gone).

I had situations when the panels actually moved to a "third" monitor right of
my second monitor. When I used nvidia-settings to place the TV at the right of
my second monitor, I would suddenly see panels there. But I saw that only once
or twice in the last few weeks, and I could not see it this time.

# xrandr | grep connected
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 connected 1920x1080+3840+540 (normal left inverted right x axis y axis)
160mm x 90mm
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 3840x2160+0+0 (normal left inverted right x axis y axis)
1872mm x 1053mm
DP-4 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis)
607mm x 345mm
DP-5 disconnected (normal left inverted right x axis y axis)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to