mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Fix deprecated declarations warnings on macOS
This commit is contained in:
@@ -226,7 +226,7 @@ MainWindow::MainWindow(not_null<Window::Controller*> controller)
|
||||
void MainWindow::closeWithoutDestroy() {
|
||||
NSWindow *nsWindow = [reinterpret_cast<NSView*>(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,
|
||||
|
@@ -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];
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user