mirror of https://github.com/procxx/kepka.git
Add Platform::AutostartSupported
This commit is contained in:
parent
413ddf285e
commit
e098922a4b
|
@ -174,6 +174,10 @@ void Application::run() {
|
|||
psNewVersion();
|
||||
}
|
||||
|
||||
if (cAutoStart() && !Platform::AutostartSupported()) {
|
||||
cSetAutoStart(false);
|
||||
}
|
||||
|
||||
if (cLaunchMode() == LaunchModeAutoStart && !cAutoStart()) {
|
||||
psAutoStart(false, true);
|
||||
App::quit();
|
||||
|
|
|
@ -516,6 +516,13 @@ std::optional<crl::time> LastUserInputTime() {
|
|||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool AutostartSupported() {
|
||||
// snap sandbox doesn't allow creating files in folders with names started with a dot
|
||||
// and doesn't provide any api to add an app to autostart
|
||||
// thus, autostart isn't supported in snap
|
||||
return !InSnap();
|
||||
}
|
||||
|
||||
void FallbackFontConfigCheckBegin() {
|
||||
if (!CheckFontConfigCrash()) {
|
||||
return;
|
||||
|
|
|
@ -262,6 +262,10 @@ void IgnoreApplicationActivationRightNow() {
|
|||
objc_ignoreApplicationActivationRightNow();
|
||||
}
|
||||
|
||||
bool AutostartSupported() {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace Platform
|
||||
|
||||
void psNewVersion() {
|
||||
|
|
|
@ -40,6 +40,7 @@ bool OpenSystemSettings(SystemSettingsType type);
|
|||
}
|
||||
|
||||
void IgnoreApplicationActivationRightNow();
|
||||
bool AutostartSupported();
|
||||
|
||||
namespace ThirdParty {
|
||||
|
||||
|
|
|
@ -381,6 +381,10 @@ std::optional<crl::time> LastUserInputTime() {
|
|||
return LastTrackedWhen;
|
||||
}
|
||||
|
||||
bool AutostartSupported() {
|
||||
return !IsWindowsStoreBuild();
|
||||
}
|
||||
|
||||
} // namespace Platform
|
||||
|
||||
namespace {
|
||||
|
|
|
@ -404,8 +404,7 @@ void SetupTrayContent(not_null<Ui::VerticalLayout*> container) {
|
|||
}, taskbar->lifetime());
|
||||
}
|
||||
|
||||
#ifndef OS_WIN_STORE
|
||||
if (Platform::IsWindows() || Platform::IsLinux()) {
|
||||
if (Platform::AutostartSupported()) {
|
||||
const auto minimizedToggled = [] {
|
||||
return cStartMinimized() && !Global::LocalPasscode();
|
||||
};
|
||||
|
@ -454,6 +453,7 @@ void SetupTrayContent(not_null<Ui::VerticalLayout*> container) {
|
|||
}, minimized->lifetime());
|
||||
}
|
||||
|
||||
#ifndef OS_WIN_STORE
|
||||
if (Platform::IsWindows()) {
|
||||
const auto sendto = addCheckbox(
|
||||
tr::lng_settings_add_sendto(tr::now),
|
||||
|
|
Loading…
Reference in New Issue