fix: don't check for Desktop Environment in unity_service.cc (#41211)

Don't check for Desktop Environment in unity_service.cc
This commit is contained in:
JakobDev 2024-04-19 15:58:32 +02:00 committed by GitHub
parent ed9fec7da4
commit 07a68c2bf8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -51,21 +51,10 @@ unity_launcher_entry_set_progress_visible_func entry_set_progress_visible =
nullptr; nullptr;
void EnsureLibUnityLoaded() { void EnsureLibUnityLoaded() {
using base::nix::GetDesktopEnvironment;
if (attempted_load) if (attempted_load)
return; return;
attempted_load = true; attempted_load = true;
auto env = base::Environment::Create();
base::nix::DesktopEnvironment desktop_env = GetDesktopEnvironment(env.get());
// The "icon-tasks" KDE task manager also honors Unity Launcher API.
if (desktop_env != base::nix::DESKTOP_ENVIRONMENT_UNITY &&
desktop_env != base::nix::DESKTOP_ENVIRONMENT_KDE4 &&
desktop_env != base::nix::DESKTOP_ENVIRONMENT_KDE5)
return;
// Ubuntu still hasn't given us a nice libunity.so symlink. // Ubuntu still hasn't given us a nice libunity.so symlink.
void* unity_lib = dlopen("libunity.so.4", RTLD_LAZY); void* unity_lib = dlopen("libunity.so.4", RTLD_LAZY);
if (!unity_lib) if (!unity_lib)