Skip to content
Merged
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
6 changes: 5 additions & 1 deletion src/dbus/applicationservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,14 @@ ApplicationService::Launch(const QString &action, const QStringList &fields, con
}

// Notify the compositor to show a splash screen if in a Wayland session.
// Suppress splash for system autostart launches.
// Suppress splash for system autostart launches or singleton apps with existing instances.
const bool isAutostartLaunch = optionsMap.contains("_autostart") && optionsMap.value("_autostart").toBool();
const bool isSingleton = findEntryValue(DesktopFileEntryKey, "X-Deepin-Singleton", EntryValueType::Boolean).toBool();
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

Consider adding a null check before calling toBool() for consistency with the existing pattern used in noDisplay() (line 541-547). While calling toBool() on a null QVariant safely returns false, the codebase convention appears to explicitly check for null first. For example:

auto val = findEntryValue(DesktopFileEntryKey, "X-Deepin-Singleton", EntryValueType::Boolean);
const bool isSingleton = val.isNull() ? false : val.toBool();

This matches the pattern at line 541 where noDisplay() checks val.isNull() before calling val.toBool().

Copilot uses AI. Check for mistakes.
const bool singletonWithInstance = isSingleton && !m_Instances.isEmpty();
if (isAutostartLaunch) {
qCInfo(amPrelaunchSplash) << "Skip prelaunch splash (autostart)" << id();
} else if (singletonWithInstance) {
qCInfo(amPrelaunchSplash) << "Skip prelaunch splash (singleton with existing instance)" << id();
} else if (auto *am = parent()) {
if (auto *helper = am->splashHelper()) {
const auto iconVar = findEntryValue(DesktopFileEntryKey, "Icon", EntryValueType::IconString);
Expand Down