perf-tool: Allow to run as a Wayland compositor
On Wayland, the display server is the Wayland compositor, i.e. gnome-shell
itself.
As a result, we cannot spawn gnome-shell-perf-helper
before gnome-shell
is started, as gnome-shell-perf-helper
needs to connect to the display server.
So, instead of spawning gnome-shell-perf-helper
from the Python script gnome-shell-perf-tool
, start it from gnome-shell
itself.
Also, using the --replace
option which does not work when gnome-shell is a Wayland compositor.
Add a --wayland
option to gnome-shell-perf-tool
so that it can spawn gnome-shell as a Wayland compositor so the whole perf tool can be starred from a console with:
$ dbus-run-session -- gnome-shell-perf-tool --wayland
For testing purpose, --nested
is also added, but the performance reported when gnome-shell
runs as a nested Wayland compositor might not be significant:
$ dbus-run-session -- gnome-shell-perf-tool --nested