Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions misc/dconfig/org.deepin.dde.treeland.user.json
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,17 @@
"description[zh_CN]": "多任务视图加载因子",
"permissions": "readonly",
"visibility": "private"
},
"wallpaperConfig": {
"value": "",
"serial": 0,
"flags": ["global"],
"name": "Wallpaper Config",
"name[zh_CN]": "壁纸配置",
"description": "A configuration to manage wallpapers used by the system, including desktop and lockscreen wallpapers for each screen and workspace.",
"description[zh_CN]": "用于管理系统当前使用的壁纸配置,包括每个屏幕和工作区的桌面壁纸和锁屏壁纸。",
"permissions": "readwrite",
"visibility": "public"
}
}
}
1 change: 1 addition & 0 deletions misc/systemd/treeland.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Environment=DSG_APP_ID=org.deepin.dde.treeland
Environment=ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer
# For Debug: if enable asan, you can't get it's log from journalctl, so ensure the log to a file
Environment=ASAN_OPTIONS=log_path=/tmp/treeland-asan:detect_leaks=0:abort_on_error=1:symbolize=1
Environment=DDM_DISPLAY_MANAGER=1
ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/treeland.sh --lockscreen
Restart=on-failure
RestartSec=1s
Expand Down
12 changes: 8 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,16 @@ qt_add_qml_module(libtreeland
utils/loginddbustypes.cpp
utils/fpsdisplaymanager.cpp
utils/fpsdisplaymanager.h
wallpaper/wallpapercontroller.cpp
wallpaper/wallpapercontroller.h
wallpaper/wallpaperimage.cpp
wallpaper/wallpaperimage.h
wallpaper/wallpapersurface.h
wallpaper/wallpapersurface.cpp
wallpaper/wallpaperitem.cpp
wallpaper/wallpaperitem.h
wallpaper/wallpapermanager.cpp
wallpaper/wallpapermanager.h
wallpaper/wallpaperconfig.h
wallpaper/wallpaperconfig.cpp
wallpaper/wallpaperlauncher.h
wallpaper/wallpaperlauncher.cpp
workspace/workspace.cpp
workspace/workspace.h
workspace/workspaceanimationcontroller.cpp
Expand Down
21 changes: 12 additions & 9 deletions src/core/qml/Effects/LaunchpadCover.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@ Item {
z: (wrapper.z ?? 0) - 1
anchors.fill: wrapper

WallpaperController {
id: wallpaperController
Wallpaper {
id: wallpaper
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wallpaper is used as a ShaderEffectSource.sourceItem but has no size bindings; it may stay 0x0 and produce an empty source. Bind it to the cover size (e.g. anchors.fill: parent) to ensure the blur/scale effect has valid input.

Wallpaper 作为 ShaderEffectSource.sourceItem 使用但没有绑定尺寸,可能保持 0x0 导致源内容为空。建议将其绑定到 cover 尺寸(例如 anchors.fill: parent),保证模糊/缩放效果有有效输入。

Suggested change
id: wallpaper
id: wallpaper
anchors.fill: parent

Copilot uses AI. Check for mistakes.
output: root.output
lock: true
type: mapped ? WallpaperController.Scale : WallpaperController.Normal
workspace: Helper.workspace.current
}

ShaderEffectSource {
id: wallpaper
sourceItem: wallpaperController.proxy
id: wallpaperSource
sourceItem: wallpaper
recursive: true
live: true
smooth: true
Expand All @@ -38,14 +37,14 @@ Item {
State {
name: "Normal"
PropertyChanges {
target: wallpaper
target: wallpaperSource
scale: 1
}
},
State {
name: "Scale"
PropertyChanges {
target: wallpaper
target: wallpaperSource
scale: 1.4
}
}
Expand Down Expand Up @@ -75,7 +74,7 @@ Item {

Blur {
anchors.fill: parent
z: wallpaper.z + 1
z: wallpaperSource.z + 1
}

Rectangle {
Expand All @@ -92,4 +91,8 @@ Item {
easing.type: Easing.OutExpo
}
}

onMappedChanged: {
Helper.setLaunchpadMapped(root.output, root.mapped)
}
}
89 changes: 81 additions & 8 deletions src/core/qml/PrimaryOutput.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import Treeland
OutputItem {
id: rootOutputItem
readonly property OutputViewport screenViewport: outputViewport
property alias wallpaperVisible: wallpaper.visible
property bool forceSoftwareCursor: false

devicePixelRatio: output?.scale ?? devicePixelRatio
Expand Down Expand Up @@ -99,11 +98,11 @@ OutputItem {
anchors.fill: parent
Wallpaper {
id: wallpaper

readonly property int duration: 1000
output: rootOutputItem.output
workspace: Helper.workspace.current
anchors.fill: parent
fillMode: Image.PreserveAspectCrop
retainWhileLoading: true
clip: true

states: [
Expand All @@ -120,14 +119,88 @@ OutputItem {
target: wallpaper
scale: 1.4
}
},
State {
name: "ScaleTo1.2"
PropertyChanges {
target: wallpaper
scale: 1.2
}
},
State {
name: "ScaleWithoutAnimation"
PropertyChanges {
target: wallpaper
scale: 1.4
}
}
]

transitions: [
Transition {
from: "*"
to: "Normal"
PropertyAnimation {
property: "scale"
duration: wallpaper.duration
easing.type: Easing.OutExpo
}
},
Transition {
from: "*"
to: "Scale"
PropertyAnimation {
property: "scale"
duration: wallpaper.duration
easing.type: Easing.OutExpo
}
},
Transition {
from: "*"
to: "ScaleTo1.2"
PropertyAnimation {
property: "scale"
duration: wallpaper.duration
easing.type: Easing.OutExpo
}
},
Transition {
from: "*"
to: "ScaleWithoutAnimation"
PropertyAnimation {
property: "scale"
duration: 0
}
}
]

Behavior on scale {
enabled: GreeterProxy.showAnimation
NumberAnimation {
duration: 1000
easing.type: Easing.OutExpo
Connections {
target: Helper
function onLaunchpadMappedChanged(output, mapped) {
if (output !== rootOutputItem.output) {
return;
}

wallpaper.state = mapped ? "Scale" : "Normal"
}

function onShowDesktopRequested(output) {
if (output !== rootOutputItem.output) {
return;
}

wallpaper.state = "Normal"
wallpaper.play = true
wallpaper.slowDown()
}

function onStartLockscreened(output, showAnimation) {
if (output !== rootOutputItem.output) {
return;
}

wallpaper.play = false
wallpaper.state = showAnimation ? "ScaleTo1.2" : "ScaleWithoutAnimation"
}
}
}
Expand Down
16 changes: 4 additions & 12 deletions src/core/qml/WorkspaceSwitcher.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ Item {
width: output.outputItem.width
height: output.outputItem.height

WallpaperController {
id: wpCtrl
output: animationDelegate.output.outputItem.output
type: WallpaperController.Normal
lock: true
}

Row {
x: - Helper.workspace.animationController.viewportPos * animationDelegate.localAnimationScaleFactor
spacing: Helper.workspace.animationController.refGap * animationDelegate.localAnimationScaleFactor
Expand All @@ -44,12 +37,11 @@ Item {
height: animationDelegate.output.outputItem.height
id: workspaceDelegate
required property WorkspaceModel workspace
ShaderEffectSource {
id: wallpaperShot
sourceItem: wpCtrl.proxy
hideSource: false
anchors.fill: parent
Wallpaper {
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wallpaper is instantiated without any size bindings, so it may remain 0x0 and not render during workspace switching. Bind it to the delegate size (e.g. anchors.fill: parent) so it can actually be displayed.

这里的 Wallpaper 没有绑定尺寸,可能保持 0x0,导致工作区切换时不显示。建议将其绑定到 delegate 尺寸(例如 anchors.fill: parent),确保能够正常渲染。

Suggested change
Wallpaper {
Wallpaper {
anchors.fill: parent

Copilot uses AI. Check for mistakes.
workspace: workspaceDelegate.workspace
output: animationDelegate.output.outputItem.output
}

WorkspaceProxy {
workspace: workspaceDelegate.workspace
output: animationDelegate.output
Expand Down
11 changes: 11 additions & 0 deletions src/core/shellhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
#include "rootsurfacecontainer.h"
#include "seat/helper.h"
#include "surface/surfacewrapper.h"
#include "treelandconfig.hpp"

Check warning on line 16 in src/core/shellhandler.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "treelandconfig.hpp" not found.
#include "treelanduserconfig.hpp"

Check warning on line 17 in src/core/shellhandler.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "treelanduserconfig.hpp" not found.
#include "workspace/workspace.h"

Check warning on line 18 in src/core/shellhandler.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "workspace/workspace.h" not found.
#include "session/session.h"

Check warning on line 19 in src/core/shellhandler.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "session/session.h" not found.
#include "wallpapershellinterfacev1.h"

Check warning on line 20 in src/core/shellhandler.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "wallpapershellinterfacev1.h" not found.

#include <xcb/xcb.h>

Check warning on line 22 in src/core/shellhandler.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <xcb/xcb.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <winputmethodhelper.h>
#include <winputpopupsurface.h>
Expand Down Expand Up @@ -295,6 +297,15 @@
connect(m_layerShell, &WLayerShell::surfaceRemoved, this, &ShellHandler::onLayerSurfaceRemoved);
}

void ShellHandler::initWallpaperShell(Waylib::Server::WServer *server)
{
Q_ASSERT_X(!m_wallpaperShell, Q_FUNC_INFO, "Only init once!");
m_wallpaperShell = server->attach<TreelandWallpaperShellInterfaceV1>(m_wallpaperShell);
if (Helper::instance()->isDDMDisplay()) {
m_wallpaperShell->setFilter([this](WClient *client) { return Helper::instance()->sessionManager()->isDDEUserClient(client); });
}
}

WXWayland *ShellHandler::createXWayland(WServer *server,
WSeat *seat,
qw_compositor *compositor,
Expand Down
7 changes: 7 additions & 0 deletions src/core/shellhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ QT_END_NAMESPACE

class AppIdResolverManager; // forward declare new protocol manager
class WindowConfigStore; // forward declare config store
class TreelandWallpaperShellInterfaceV1;
class TreelandWallpaperSurfaceInterfaceV1;

class ShellHandler : public QObject
{
Expand All @@ -74,6 +76,7 @@ class ShellHandler : public QObject
void createComponent(QmlEngine *engine, QQuickItem *parentItem);
void initXdgShell(WAYLIB_SERVER_NAMESPACE::WServer *server);
void initLayerShell(WAYLIB_SERVER_NAMESPACE::WServer *server);
void initWallpaperShell(WAYLIB_SERVER_NAMESPACE::WServer *server);
[[nodiscard]] WAYLIB_SERVER_NAMESPACE::WXWayland *createXWayland(
WAYLIB_SERVER_NAMESPACE::WServer *server,
WAYLIB_SERVER_NAMESPACE::WSeat *seat,
Expand All @@ -87,6 +90,9 @@ class ShellHandler : public QObject
WAYLIB_SERVER_NAMESPACE::WXWayland *defaultXWaylandSocket() const;
void setupDockPreview(QObject *dockPreview);

TreelandWallpaperShellInterfaceV1 *wallpaperShell() const {
return m_wallpaperShell;
}
Q_SIGNALS:
void surfaceWrapperAdded(SurfaceWrapper *wrapper);
void surfaceWrapperAboutToRemove(SurfaceWrapper *wrapper);
Expand Down Expand Up @@ -153,6 +159,7 @@ private Q_SLOTS:

WAYLIB_SERVER_NAMESPACE::WXdgShell *m_xdgShell = nullptr;
WAYLIB_SERVER_NAMESPACE::WLayerShell *m_layerShell = nullptr;
TreelandWallpaperShellInterfaceV1 *m_wallpaperShell = nullptr;
WAYLIB_SERVER_NAMESPACE::WInputMethodHelper *m_inputMethodHelper = nullptr;
QList<WAYLIB_SERVER_NAMESPACE::WXWayland *> m_xwaylands;
ForeignToplevelV1 *m_treelandForeignToplevel = nullptr;
Expand Down
3 changes: 2 additions & 1 deletion src/core/treeland.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@ bool Treeland::ActivateWayland(QDBusUnixFileDescriptor _fd)
u->setWaylandSocket(socket);
}

socket->setEnabled(userModel->currentUserName() == user);
socket->setEnabled(userModel->currentUserName() == user,
Helper::instance()->sessionManager()->globalSession()->socket());

d->helper->addSocket(socket.get());

Expand Down
5 changes: 4 additions & 1 deletion src/greeter/usermodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@

#include "usermodel.h"

#include "common/treelandlogging.h"

Check warning on line 23 in src/greeter/usermodel.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "common/treelandlogging.h" not found.
#include "helper.h"

Check warning on line 24 in src/greeter/usermodel.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "helper.h" not found.
#include "session/session.h"

Check warning on line 25 in src/greeter/usermodel.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "session/session.h" not found.

#include <Configuration.h>

Check warning on line 27 in src/greeter/usermodel.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <Configuration.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <DDBusInterface>

Expand Down Expand Up @@ -313,7 +315,8 @@

for (const auto &user : d->users) {
if (user->waylandSocket()) {
user->waylandSocket()->setEnabled(user->userName() == userName);
user->waylandSocket()->setEnabled(user->userName() == userName,
Helper::instance()->sessionManager()->globalSession()->socket());
}
}

Expand Down
Loading
Loading