Skip to content

Commit

Permalink
fix: wallpaper color not init
Browse files Browse the repository at this point in the history
init wallpaper color

Log:
  • Loading branch information
justforlxz authored and Groveer committed Oct 17, 2024
1 parent c3f02df commit 82c8c8b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/treeland/helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ void Helper::onOutputAdded(WOutput *output)
enableOutput(output);
m_outputManager->newOutput(output);
m_lockScreen->addOutput(o);

m_wallpaperColorV1->updateWallpaperColor(output->name(),
m_personalization->backgroundIsDark(output->name()));
}

void Helper::onOutputRemoved(WOutput *output)
Expand Down Expand Up @@ -617,6 +620,12 @@ void Helper::init()
m_wallpaperColorV1->updateWallpaperColor(output, isdark);
});

for (auto output : m_rootSurfaceContainer->outputs()) {
const QString &outputName = output->output()->name();
m_wallpaperColorV1->updateWallpaperColor(outputName,
m_personalization->backgroundIsDark(outputName));
}

connect(m_windowManagement,
&WindowManagementV1::desktopStateChanged,
this,
Expand Down Expand Up @@ -889,8 +898,7 @@ bool Helper::beforeDisposeEvent(WSeat *seat, QWindow *, QInputEvent *event)
}
// FIXME: end

if (event->type() == QEvent::MouseButtonPress ||
event->type() == QEvent::MouseButtonRelease) {
if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonRelease) {
handleLeftButtonStateChanged(event);
}

Expand Down Expand Up @@ -1362,7 +1370,7 @@ WSeat *Helper::seat() const
return m_seat;
}

void Helper::showAllWindows(WorkspaceModel* model, bool show)
void Helper::showAllWindows(WorkspaceModel *model, bool show)
{
auto surfaces = model->surfaces();

Expand Down Expand Up @@ -1462,4 +1470,3 @@ void Helper::handleDdeShellSurfaceAdded(WSurface *surface, SurfaceWrapper *wrapp
wrapper->setSkipMutiTaskView(skip);
});
}

0 comments on commit 82c8c8b

Please sign in to comment.