index desktop views by qscreen instead of id, making ScreenPool
the single source of truth for the mapping between screen names
and ids. This is less error prone and easier to consistency check
(if view->screenToFollow() is ever different to its has key it will
assert)
The whole logic of screen management is moved to ScreenPool.
ShellCorona will have to never call QGuiApp->screens, but only trust what ScreenPool it's telling it
Also adds an autotests on screenpool which makes a fake wayland server which sends screen added/removed/changed events
Refactors XRandr support together with the new Wayland code into a
PrimaryOutputWatcher class.
For X11 it listens to xcb events.
For Wayland it uses the kde_output_management_v2 protocols.
Summary:
Otherwise we have a gap during load (waiting querying kactivities))
between screen pool being created and us connecting to the screen
changed signals, which in turn are used to update screen pool.
In particular the primary screen can get out of sync between the current
state and the screen pool.
Test Plan: Based on Christopher Feck's research and initial patch
Reviewers: #plasma
Subscribers: mart, rwooninck, fvogt, cfeck, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3319
CCBUG:372099
CCBUG:371858
CBUG:371991
CCBUG:371819
CCBUG:371734
if the machine has a primary screen, inserting to
0 will give an assert. take that into account
and insert starting from 1 if a primary screen is found
this should fix the autotest on ci
Summary:
We used to append them, but that didn't work well and was crashing plasmashell
on fresh start.
A default desktop would be created alongside with the one provided by the
layout instead of replacing it.
If a layout wants to provide an additional screen for a desktop in the secondary
screen, it should specify the screen.
Test Plan:
Now the plasmashell tests pass. In fact I noticed it was broken due to an e-mail
Jonathan sent me that the test on neon was timing out. The test in neon will
freeze when the test crashes. Probably something to look into.
It can be reproduced by running:
```
xvfb-run -a --server-args="-screen 0 1024x768x24" dbus-launch --exit-with-session <exec>
```
Where `exec` is the process we need to run.
Now the test passes.
It's a crash that I had reproduced locally in the past. I can't now.
Reviewers: #plasma, mart
Reviewed By: mart
Subscribers: sitter, jriddell, plasma-devel, #neon
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2117