Run in background on Linux when minimization is not supported

This commit is contained in:
Ilya Fedin 2023-09-12 09:14:18 +04:00 committed by John Preston
parent e8a1fc0300
commit e946bf5338
2 changed files with 8 additions and 4 deletions

View File

@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/platform/base_platform_info.h"
#include "base/platform/linux/base_linux_dbus_utilities.h"
#include "base/platform/linux/base_linux_xdp_utilities.h"
#include "ui/platform/ui_platform_window_title.h"
#include "platform/linux/linux_desktop_environment.h"
#include "platform/linux/linux_wayland_integration.h"
#include "lang/lang_keys.h"
@ -534,6 +535,13 @@ bool SkipTaskbarSupported() {
return false;
}
bool RunInBackground() {
const auto layout = Ui::Platform::TitleControlsLayout();
using TitleControl = Ui::Platform::TitleControl;
return !ranges::contains(layout.left, TitleControl::Minimize)
&& !ranges::contains(layout.right, TitleControl::Minimize);
}
QString ExecutablePathForShortcuts() {
if (Core::UpdaterDisabled()) {
const auto &arguments = Core::Launcher::Instance().arguments();

View File

@ -24,10 +24,6 @@ inline void WriteCrashDumpDetails() {
inline void AutostartRequestStateFromSystem(Fn<void(bool)> callback) {
}
inline bool RunInBackground() {
return false;
}
inline bool PreventsQuit(Core::QuitReason reason) {
return false;
}