From 1940edd6ee555c96dfc65b39049ccee2d2b26e83 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sat, 11 Feb 2023 00:51:52 +0400 Subject: [PATCH] Fix deprecated declarations warnings on macOS --- Telegram/SourceFiles/platform/mac/main_window_mac.mm | 4 ++-- Telegram/SourceFiles/platform/mac/specific_mac_p.mm | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/platform/mac/main_window_mac.mm b/Telegram/SourceFiles/platform/mac/main_window_mac.mm index 5214c0b09f..108b094bd6 100644 --- a/Telegram/SourceFiles/platform/mac/main_window_mac.mm +++ b/Telegram/SourceFiles/platform/mac/main_window_mac.mm @@ -226,7 +226,7 @@ MainWindow::MainWindow(not_null controller) void MainWindow::closeWithoutDestroy() { NSWindow *nsWindow = [reinterpret_cast(winId()) window]; - auto isFullScreen = (([nsWindow styleMask] & NSFullScreenWindowMask) == NSFullScreenWindowMask); + auto isFullScreen = (([nsWindow styleMask] & NSWindowStyleMaskFullScreen) == NSWindowStyleMaskFullScreen); if (isFullScreen) { _hideAfterFullScreenTimer.callOnce(kHideAfterFullscreenTimeoutMs); [nsWindow toggleFullScreen:nsWindow]; @@ -266,7 +266,7 @@ bool MainWindow::preventsQuit(Core::QuitReason reason) { // chromium.org/developers/design-documents/confirm-to-quit-experiment return (reason == Core::QuitReason::QtQuitEvent) && Core::App().settings().macWarnBeforeQuit() - && ([[NSApp currentEvent] type] == NSKeyDown) + && ([[NSApp currentEvent] type] == NSEventTypeKeyDown) && !Platform::ConfirmQuit::RunModal( tr::lng_mac_hold_to_quit( tr::now, diff --git a/Telegram/SourceFiles/platform/mac/specific_mac_p.mm b/Telegram/SourceFiles/platform/mac/specific_mac_p.mm index ef445e1139..a3231e3e7f 100644 --- a/Telegram/SourceFiles/platform/mac/specific_mac_p.mm +++ b/Telegram/SourceFiles/platform/mac/specific_mac_p.mm @@ -266,7 +266,10 @@ void SetApplicationIcon(const QIcon &icon) { void objc_debugShowAlert(const QString &str) { @autoreleasepool { - [[NSAlert alertWithMessageText:@"Debug Message" defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:@"%@", Q2NSString(str)] runModal]; + NSAlert *alert = [[NSAlert alloc] init]; + alert.messageText = @"Debug Message"; + alert.informativeText = Q2NSString(str); + [alert runModal]; } }