mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 15:04:57 +00:00
fix: app restart & crashes on macOS
This commit is contained in:
@@ -92,6 +92,9 @@ void BuildAppIcon(SectionBuilder &builder, AyuSectionBuilder &ayu) {
|
||||
builder.addSkip();
|
||||
builder.addDividerText(tr::ayu_HideNotificationBadgeDescription());
|
||||
builder.addSkip();
|
||||
#else
|
||||
builder.addDivider();
|
||||
builder.addSkip();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -977,12 +977,12 @@ static bool prependPseudoReplyImpl(
|
||||
shiftEntities(textWithTags.tags, prefixLength);
|
||||
|
||||
EntitiesInText newEntities;
|
||||
const auto nameLength = name.length();
|
||||
const auto nameLength = int(name.length());
|
||||
|
||||
newEntities.push_back(EntityInText{
|
||||
EntityType::Blockquote,
|
||||
0,
|
||||
prefix.length(),
|
||||
int(prefix.length()),
|
||||
{}
|
||||
});
|
||||
|
||||
|
||||
@@ -65,6 +65,9 @@ QImage PrepareFrame(
|
||||
if (hasAlpha && request.keepAlpha) {
|
||||
cache.fill(Qt::transparent);
|
||||
}
|
||||
if (!QCoreApplication::instance()) { // fix crash on macOS on exit
|
||||
return cache;
|
||||
}
|
||||
{
|
||||
auto p = QPainter(&cache);
|
||||
const auto framew = request.frame.width();
|
||||
|
||||
@@ -33,15 +33,18 @@ bool Launcher::launchUpdater(UpdaterLaunch action) {
|
||||
}
|
||||
@autoreleasepool {
|
||||
|
||||
#ifdef OS_MAC_STORE
|
||||
// In AppStore version we don't have Updater.
|
||||
// We just relaunch our app.
|
||||
if (action == UpdaterLaunch::JustRelaunch) {
|
||||
NSDictionary *conf = [NSDictionary dictionaryWithObject:[NSArray array] forKey:NSWorkspaceLaunchConfigurationArguments];
|
||||
[[NSWorkspace sharedWorkspace] launchApplicationAtURL:[NSURL fileURLWithPath:Q2NSString(cExeDir() + cExeName())] options:NSWorkspaceLaunchAsync | NSWorkspaceLaunchNewInstance configuration:conf error:0];
|
||||
return true;
|
||||
#ifdef OS_MAC_STORE
|
||||
const auto updaterDisabled = true;
|
||||
#else
|
||||
const auto updaterDisabled = Core::UpdaterDisabled();
|
||||
#endif
|
||||
if (updaterDisabled) {
|
||||
NSDictionary *conf = [NSDictionary dictionaryWithObject:[NSArray array] forKey:NSWorkspaceLaunchConfigurationArguments];
|
||||
[[NSWorkspace sharedWorkspace] launchApplicationAtURL:[NSURL fileURLWithPath:Q2NSString(cExeDir() + cExeName())] options:NSWorkspaceLaunchAsync | NSWorkspaceLaunchNewInstance configuration:conf error:0];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endif // OS_MAC_STORE
|
||||
|
||||
NSString *path = @"", *args = @"";
|
||||
@try {
|
||||
|
||||
+1
-1
Submodule Telegram/lib_ui updated: 8f46f565f2...f9f592a3a0
Reference in New Issue
Block a user