|
8 | 8 | #include "components/DisplayServerBackendFactory.h" |
9 | 9 | #include "components/IDisplayServerBackend.h" |
10 | 10 | #include "components/PanelManager.h" |
11 | | -#include "components/shell_layer_impl/WallpaperShellLayerStrategy.h" |
12 | | -#include "components/shell_layer_impl/WidgetShellLayer.h" |
13 | | -#include "components/wallpaper/ImageWallPaperLayer.h" |
14 | 11 | #include "platform/DesktopPropertyStrategyFactory.h" |
15 | 12 | #include "platform/display_backend_helper.h" |
| 13 | +#include "platform/shell_layer_helper.h" |
16 | 14 | #include "qt_format.h" |
17 | 15 | #include <memory> |
18 | 16 |
|
@@ -86,23 +84,21 @@ CFDesktopEntity::RunsSetupResult CFDesktopEntity::run_init(RunsSetupMethod m) { |
86 | 84 |
|
87 | 85 | // ── Create PanelManager and ShellLayer ── |
88 | 86 | auto* panel_mgr = new PanelManager(desktop_entity_, desktop_entity_); |
89 | | - auto* shell = new WidgetShellLayer(desktop_entity_); |
| 87 | + |
| 88 | + auto shell_api = platform::native_shell_layer(); |
| 89 | + auto* shell = shell_api.shell_creator(desktop_entity_); |
| 90 | + auto strategy = shell_api.strategy_creator(); |
| 91 | + shell->setStrategy(std::move(strategy)); |
90 | 92 |
|
91 | 93 | // Inject into CFDesktop |
92 | 94 | CFDesktop::InitResources res; |
93 | 95 | res.panel_manager_ = panel_mgr; |
94 | 96 | res.shell_layer_ = shell; |
95 | 97 | desktop_entity_->register_desktop_resources(res); |
96 | 98 |
|
97 | | - // Set shell strategy with wallpaper support |
98 | | - auto wallpaper_layer = std::make_unique<wallpaper::ImageWallPaperLayer>(); |
99 | | - auto wallpaper_strategy = |
100 | | - std::make_unique<WallpaperShellLayerStrategy>(std::move(wallpaper_layer)); |
101 | | - shell->setStrategy(std::move(wallpaper_strategy)); |
102 | | - |
103 | 99 | // Connect PanelManager geometry changes to ShellLayer |
104 | | - QObject::connect(panel_mgr, &PanelManager::availableGeometryChanged, shell, |
105 | | - &WidgetShellLayer::onAvailableGeometryChanged); |
| 100 | + QObject::connect(panel_mgr, &PanelManager::availableGeometryChanged, desktop_entity_, |
| 101 | + [shell](const QRect& r) { shell->onAvailableGeometryChanged(r); }); |
106 | 102 |
|
107 | 103 | // Show the desktop full-screen |
108 | 104 | desktop_entity_->showFullScreen(); |
|
0 commit comments