linuxdeepin / treeland

17 stars 14 forks source link

wallpaper protocols #230

Open justforlxz opened 4 months ago

justforlxz commented 4 months ago

https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Wallpaper.html

zorowk commented 4 months ago

this has been done https://github.com/linuxdeepin/treeland/pull/258

there are two questions :

  1. treeland-wallpaper cannot use qApp->screens to get the correct output name
    
    QWaylandScreen::QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uint32_t id)
    : QtWayland::wl_output(waylandDisplay->wl_registry(), id, qMin(version, 3))
    , m_outputId(id)
    , mWaylandDisplay(waylandDisplay)
    , mOutputName(QStringLiteral("Screen%1").arg(id))
now  treeland-wallpaper run treeland evironment get output name is  *Screen25*

the client does not execute initxdgoutput, normally the following stack should be called

1 QtWaylandClient::QWaylandScreen::initXdgOutput qwaylandscreen.cpp 2 QtWaylandClient::QWaylandScreen::QWaylandScreen qwaylandscreen.cpp 3 QtWaylandClient::QWaylandIntegration::createPlatformScreen qwaylandintegration.cpp 4 QtWaylandClient::QWaylandDisplay::registry_global qwaylanddisplay.cpp 5 QtWayland::wl_registry::handle_global qwayland-wayland.cpp ...



2. treeland call *QuickPersonalizationManagerPrivate::loadWallpaperSettings()* load all output background 
It will traverse *qApp->screens()* but  this time QWlrootsIntegration::addScreen(WOutput *output) has not yet put the screen data into the qt container.
zorowk commented 4 months ago

https://github.com/linuxdeepin/treeland/commit/f15e0ba7a13f28685fc3f70f313169946990911e this will solve treeland-wallpaper problem