aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Rusak <lorusak@gmail.com>2020-02-08 16:46:02 +0000
committerGitHub <noreply@github.com>2020-02-08 16:46:02 +0000
commit6ec05fcd7198b6e586bd97873fe3cf42e4aa853f (patch)
treec95f117e123ab83261cc36f0aa95571df09fffb3
parent0e48da6a086e49914ab34f3e32c85961d80fb661 (diff)
parenta6b395380de41ad4d5df4a0abca80dab551687fe (diff)
Merge pull request #17329 from lrusak/use-app-name
[linux] use GetAppName() to get compiled app name
-rw-r--r--xbmc/platform/freebsd/CMakeLists.txt1
-rw-r--r--xbmc/platform/linux/CMakeLists.txt1
-rw-r--r--xbmc/platform/linux/PlatformConstants.h24
-rw-r--r--xbmc/windowing/linux/OSScreenSaverFreedesktop.cpp7
-rw-r--r--xbmc/windowing/wayland/WinSystemWayland.cpp57
5 files changed, 35 insertions, 55 deletions
diff --git a/xbmc/platform/freebsd/CMakeLists.txt b/xbmc/platform/freebsd/CMakeLists.txt
index 98d9bdd414..c80f4858b4 100644
--- a/xbmc/platform/freebsd/CMakeLists.txt
+++ b/xbmc/platform/freebsd/CMakeLists.txt
@@ -7,7 +7,6 @@ set(SOURCES CPUInfoFreebsd.cpp
set(HEADERS CPUInfoFreebsd.h
OptionalsReg.h
../linux/OptionalsReg.h
- ../linux/PlatformConstants.h
../linux/TimeUtils.h)
if(ALSA_FOUND)
diff --git a/xbmc/platform/linux/CMakeLists.txt b/xbmc/platform/linux/CMakeLists.txt
index a36f4e82fa..186c6dc7cc 100644
--- a/xbmc/platform/linux/CMakeLists.txt
+++ b/xbmc/platform/linux/CMakeLists.txt
@@ -6,7 +6,6 @@ set(SOURCES CPUInfoLinux.cpp
set(HEADERS CPUInfoLinux.h
OptionalsReg.h
- PlatformConstants.h
SysfsPath.h
TimeUtils.h)
diff --git a/xbmc/platform/linux/PlatformConstants.h b/xbmc/platform/linux/PlatformConstants.h
deleted file mode 100644
index 1e6dee050b..0000000000
--- a/xbmc/platform/linux/PlatformConstants.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2017-2018 Team Kodi
- * This file is part of Kodi - https://kodi.tv
- *
- * SPDX-License-Identifier: GPL-2.0-or-later
- * See LICENSES/README.md for more information.
- */
-
-#pragma once
-
-#include <string>
-
-namespace KODI
-{
-namespace LINUX
-{
-
-/**
- * Name of the kodi .desktop file without the extension
- */
-const std::string DESKTOP_FILE_NAME = "kodi";
-
-}
-}
diff --git a/xbmc/windowing/linux/OSScreenSaverFreedesktop.cpp b/xbmc/windowing/linux/OSScreenSaverFreedesktop.cpp
index 69ece88226..167930dacb 100644
--- a/xbmc/windowing/linux/OSScreenSaverFreedesktop.cpp
+++ b/xbmc/windowing/linux/OSScreenSaverFreedesktop.cpp
@@ -8,12 +8,12 @@
#include "OSScreenSaverFreedesktop.h"
+#include "CompileInfo.h"
#include "guilib/LocalizeStrings.h"
#include "utils/log.h"
#include "platform/linux/DBusMessage.h"
#include "platform/linux/DBusUtil.h"
-#include "platform/linux/PlatformConstants.h"
using namespace KODI::WINDOWING::LINUX;
@@ -42,7 +42,8 @@ void COSScreenSaverFreedesktop::Inhibit()
}
CDBusMessage inhibitMessage(SCREENSAVER_INTERFACE, SCREENSAVER_OBJECT, SCREENSAVER_INTERFACE, "Inhibit");
- inhibitMessage.AppendArguments(KODI::LINUX::DESKTOP_FILE_NAME, g_localizeStrings.Get(14086));
+ inhibitMessage.AppendArguments(std::string(CCompileInfo::GetAppName()),
+ g_localizeStrings.Get(14086));
if (!inhibitMessage.SendSession())
{
// DBus call failed
@@ -74,4 +75,4 @@ void COSScreenSaverFreedesktop::Uninhibit()
}
m_inhibited = false;
-} \ No newline at end of file
+}
diff --git a/xbmc/windowing/wayland/WinSystemWayland.cpp b/xbmc/windowing/wayland/WinSystemWayland.cpp
index 8963af8f63..d6fcee51a8 100644
--- a/xbmc/windowing/wayland/WinSystemWayland.cpp
+++ b/xbmc/windowing/wayland/WinSystemWayland.cpp
@@ -8,12 +8,20 @@
#include "WinSystemWayland.h"
-#include <algorithm>
-#include <limits>
-#include <numeric>
-
#include "Application.h"
+#include "CompileInfo.h"
#include "Connection.h"
+#include "OSScreenSaverIdleInhibitUnstableV1.h"
+#include "OptionalsReg.h"
+#include "Registry.h"
+#include "ServiceBroker.h"
+#include "ShellSurfaceWlShell.h"
+#include "ShellSurfaceXdgShell.h"
+#include "ShellSurfaceXdgShellUnstableV6.h"
+#include "Util.h"
+#include "VideoSyncWpPresentation.h"
+#include "WinEventsWayland.h"
+#include "WindowDecorator.h"
#include "cores/RetroPlayer/process/wayland/RPProcessInfoWayland.h"
#include "cores/VideoPlayer/Process/wayland/ProcessInfoWayland.h"
#include "guilib/DispResource.h"
@@ -21,34 +29,27 @@
#include "input/InputManager.h"
#include "input/touch/generic/GenericTouchActionHandler.h"
#include "input/touch/generic/GenericTouchInputHandler.h"
-#include "platform/freebsd/OptionalsReg.h"
-#include "platform/linux/powermanagement/LinuxPowerSyscall.h"
-#include "platform/linux/OptionalsReg.h"
-#include "platform/linux/PlatformConstants.h"
-#include "platform/linux/TimeUtils.h"
#include "messaging/ApplicationMessenger.h"
-#include "OptionalsReg.h"
-#include "OSScreenSaverIdleInhibitUnstableV1.h"
-#include "Registry.h"
-#include "ServiceBroker.h"
#include "settings/AdvancedSettings.h"
#include "settings/DisplaySettings.h"
#include "settings/Settings.h"
#include "settings/SettingsComponent.h"
-#include "ShellSurfaceWlShell.h"
-#include "ShellSurfaceXdgShell.h"
-#include "ShellSurfaceXdgShellUnstableV6.h"
#include "threads/SingleLock.h"
-#include "Util.h"
-#include "utils/log.h"
+#include "utils/ActorProtocol.h"
#include "utils/MathUtils.h"
#include "utils/StringUtils.h"
-#include "VideoSyncWpPresentation.h"
-#include "WindowDecorator.h"
-#include "WinEventsWayland.h"
-#include "windowing/linux/OSScreenSaverFreedesktop.h"
-#include "utils/ActorProtocol.h"
#include "utils/TimeUtils.h"
+#include "utils/log.h"
+#include "windowing/linux/OSScreenSaverFreedesktop.h"
+
+#include "platform/freebsd/OptionalsReg.h"
+#include "platform/linux/OptionalsReg.h"
+#include "platform/linux/TimeUtils.h"
+#include "platform/linux/powermanagement/LinuxPowerSyscall.h"
+
+#include <algorithm>
+#include <limits>
+#include <numeric>
#if defined(HAS_DBUS)
# include "windowing/linux/OSScreenSaverFreedesktop.h"
@@ -327,15 +328,19 @@ bool CWinSystemWayland::CreateNewWindow(const std::string& name,
// Try with this resolution if compositor does not say otherwise
UpdateSizeVariables({res.iWidth, res.iHeight}, m_scale, m_shellSurfaceState, false);
- m_shellSurface.reset(CShellSurfaceXdgShell::TryCreate(*this, *m_connection, m_surface, name, KODI::LINUX::DESKTOP_FILE_NAME));
+ // Use AppName as the desktop file name. This is required to lookup the app icon of the same name.
+ m_shellSurface.reset(CShellSurfaceXdgShell::TryCreate(*this, *m_connection, m_surface, name,
+ std::string(CCompileInfo::GetAppName())));
if (!m_shellSurface)
{
- m_shellSurface.reset(CShellSurfaceXdgShellUnstableV6::TryCreate(*this, *m_connection, m_surface, name, KODI::LINUX::DESKTOP_FILE_NAME));
+ m_shellSurface.reset(CShellSurfaceXdgShellUnstableV6::TryCreate(
+ *this, *m_connection, m_surface, name, std::string(CCompileInfo::GetAppName())));
}
if (!m_shellSurface)
{
CLog::LogF(LOGWARNING, "Compositor does not support xdg_shell protocol (stable or unstable v6) - falling back to wl_shell, not all features might work");
- m_shellSurface.reset(new CShellSurfaceWlShell(*this, *m_connection, m_surface, name, KODI::LINUX::DESKTOP_FILE_NAME));
+ m_shellSurface.reset(new CShellSurfaceWlShell(*this, *m_connection, m_surface, name,
+ std::string(CCompileInfo::GetAppName())));
}
if (fullScreen)