Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

249 lines
11KB

  1. diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
  2. index aa61245..2423378 100644
  3. --- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
  4. +++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
  5. @@ -78,7 +78,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
  6. mHelper = 0;
  7. mStolenContentView = 0;
  8. mPanelButtons = nil;
  9. - mResultCode = NSModalResponseCancel;
  10. + mResultCode = NSCancelButton;
  11. mDialogIsExecuting = false;
  12. mResultSet = false;
  13. mClosingDueToKnownButton = false;
  14. @@ -166,7 +166,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
  15. mClosingDueToKnownButton = true;
  16. [mColorPanel close];
  17. [self updateQtColor];
  18. - [self finishOffWithCode:NSModalResponseOK];
  19. + [self finishOffWithCode:NSOKButton];
  20. }
  21. - (void)onCancelClicked
  22. @@ -175,7 +175,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
  23. mClosingDueToKnownButton = true;
  24. [mColorPanel close];
  25. mQtColor = QColor();
  26. - [self finishOffWithCode:NSModalResponseCancel];
  27. + [self finishOffWithCode:NSCancelButton];
  28. }
  29. }
  30. @@ -236,12 +236,12 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
  31. [NSApp runModalForWindow:mColorPanel];
  32. mDialogIsExecuting = false;
  33. - return (mResultCode == NSModalResponseOK);
  34. + return (mResultCode == NSOKButton);
  35. }
  36. - (QPlatformDialogHelper::DialogCode)dialogResultCode
  37. {
  38. - return (mResultCode == NSModalResponseOK) ? QPlatformDialogHelper::Accepted : QPlatformDialogHelper::Rejected;
  39. + return (mResultCode == NSOKButton) ? QPlatformDialogHelper::Accepted : QPlatformDialogHelper::Rejected;
  40. }
  41. - (BOOL)windowShouldClose:(id)window
  42. @@ -250,7 +250,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
  43. if (!mPanelButtons)
  44. [self updateQtColor];
  45. if (mDialogIsExecuting) {
  46. - [self finishOffWithCode:NSModalResponseCancel];
  47. + [self finishOffWithCode:NSCancelButton];
  48. } else {
  49. mResultSet = true;
  50. if (mHelper)
  51. @@ -276,7 +276,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
  52. // This check will prevent any such recursion.
  53. if (!mResultSet) {
  54. mResultSet = true;
  55. - if (mResultCode == NSModalResponseCancel) {
  56. + if (mResultCode == NSCancelButton) {
  57. emit mHelper->reject();
  58. } else {
  59. emit mHelper->accept();
  60. diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
  61. index b22f1b1..d2dd645 100644
  62. --- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
  63. +++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
  64. @@ -401,7 +401,7 @@ bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
  65. // [NSApp run], which is the normal code path for cocoa applications.
  66. if (NSModalSession session = d->currentModalSession()) {
  67. QBoolBlocker execGuard(d->currentExecIsNSAppRun, false);
  68. - while ([NSApp runModalSession:session] == NSModalResponseContinue && !d->interrupt) {
  69. + while ([NSApp runModalSession:session] == NSRunContinuesResponse && !d->interrupt) {
  70. qt_mac_waitForMoreEvents(NSModalPanelRunLoopMode);
  71. if (session != d->currentModalSessionCached) {
  72. // It's possible to release the current modal session
  73. @@ -445,7 +445,7 @@ bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
  74. if (flags & QEventLoop::WaitForMoreEvents)
  75. qt_mac_waitForMoreEvents(NSModalPanelRunLoopMode);
  76. NSInteger status = [NSApp runModalSession:session];
  77. - if (status != NSModalResponseContinue && session == d->currentModalSessionCached) {
  78. + if (status != NSRunContinuesResponse && session == d->currentModalSessionCached) {
  79. // INVARIANT: Someone called [NSApp stopModal:] from outside the event
  80. // dispatcher (e.g to stop a native dialog). But that call wrongly stopped
  81. // 'session' as well. As a result, we need to restart all internal sessions:
  82. diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
  83. index 9a96895..b227794 100644
  84. --- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
  85. +++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
  86. @@ -104,7 +104,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
  87. mHelper = 0;
  88. mStolenContentView = 0;
  89. mPanelButtons = 0;
  90. - mResultCode = NSModalResponseCancel;
  91. + mResultCode = NSCancelButton;
  92. mDialogIsExecuting = false;
  93. mResultSet = false;
  94. @@ -169,7 +169,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
  95. - (void)onOkClicked
  96. {
  97. [mFontPanel close];
  98. - [self finishOffWithCode:NSModalResponseOK];
  99. + [self finishOffWithCode:NSOKButton];
  100. }
  101. - (void)onCancelClicked
  102. @@ -177,7 +177,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
  103. if (mPanelButtons) {
  104. [mFontPanel close];
  105. mQtFont = QFont();
  106. - [self finishOffWithCode:NSModalResponseCancel];
  107. + [self finishOffWithCode:NSCancelButton];
  108. }
  109. }
  110. @@ -222,12 +222,12 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
  111. [NSApp runModalForWindow:mFontPanel];
  112. mDialogIsExecuting = false;
  113. - return (mResultCode == NSModalResponseOK);
  114. + return (mResultCode == NSOKButton);
  115. }
  116. - (QPlatformDialogHelper::DialogCode)dialogResultCode
  117. {
  118. - return (mResultCode == NSModalResponseOK) ? QPlatformDialogHelper::Accepted : QPlatformDialogHelper::Rejected;
  119. + return (mResultCode == NSOKButton) ? QPlatformDialogHelper::Accepted : QPlatformDialogHelper::Rejected;
  120. }
  121. - (BOOL)windowShouldClose:(id)window
  122. @@ -236,7 +236,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
  123. if (!mPanelButtons)
  124. [self updateQtFont];
  125. if (mDialogIsExecuting) {
  126. - [self finishOffWithCode:NSModalResponseCancel];
  127. + [self finishOffWithCode:NSCancelButton];
  128. } else {
  129. mResultSet = true;
  130. if (mHelper)
  131. @@ -262,7 +262,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
  132. // This check will prevent any such recursion.
  133. if (!mResultSet) {
  134. mResultSet = true;
  135. - if (mResultCode == NSModalResponseCancel) {
  136. + if (mResultCode == NSCancelButton) {
  137. emit mHelper->reject();
  138. } else {
  139. emit mHelper->accept();
  140. diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
  141. index 191553e..e6abf49 100644
  142. --- a/src/plugins/platforms/cocoa/qcocoawindow.h
  143. +++ b/src/plugins/platforms/cocoa/qcocoawindow.h
  144. @@ -217,7 +217,9 @@ public:
  145. Q_NOTIFICATION_HANDLER(NSWindowDidExitFullScreenNotification) void windowDidExitFullScreen();
  146. Q_NOTIFICATION_HANDLER(NSWindowDidOrderOffScreenNotification) void windowDidOrderOffScreen();
  147. Q_NOTIFICATION_HANDLER(NSWindowDidOrderOnScreenAndFinishAnimatingNotification) void windowDidOrderOnScreen();
  148. +#if 0
  149. Q_NOTIFICATION_HANDLER(NSWindowDidChangeOcclusionStateNotification) void windowDidChangeOcclusionState();
  150. +#endif
  151. Q_NOTIFICATION_HANDLER(NSWindowDidChangeScreenNotification) void windowDidChangeScreen();
  152. Q_NOTIFICATION_HANDLER(NSWindowWillCloseNotification) void windowWillClose();
  153. diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
  154. index c7aa579..56eb291 100644
  155. --- a/src/plugins/platforms/cocoa/qcocoawindow.mm
  156. +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
  157. @@ -1532,6 +1532,7 @@ void QCocoaWindow::windowDidOrderOnScreen()
  158. exposeWindow();
  159. }
  160. +#if 0
  161. void QCocoaWindow::windowDidChangeOcclusionState()
  162. {
  163. // Several unit tests expect paint and/or expose events for windows that are
  164. @@ -1547,6 +1548,7 @@ void QCocoaWindow::windowDidChangeOcclusionState()
  165. }
  166. }
  167. }
  168. +#endif
  169. void QCocoaWindow::windowDidChangeScreen()
  170. {
  171. diff --git a/src/printsupport/dialogs/qpagesetupdialog_mac.mm b/src/printsupport/dialogs/qpagesetupdialog_mac.mm
  172. index 1e39845..9305566 100644
  173. --- a/src/printsupport/dialogs/qpagesetupdialog_mac.mm
  174. +++ b/src/printsupport/dialogs/qpagesetupdialog_mac.mm
  175. @@ -77,7 +77,7 @@ QT_USE_NAMESPACE
  176. QPageSetupDialog *dialog = static_cast<QPageSetupDialog *>(contextInfo);
  177. QPrinter *printer = dialog->printer();
  178. - if (returnCode == NSModalResponseOK) {
  179. + if (returnCode == NSOKButton) {
  180. PMPageFormat format = static_cast<PMPageFormat>([printInfo PMPageFormat]);
  181. PMRect paperRect;
  182. PMGetUnadjustedPaperRect(format, &paperRect);
  183. @@ -88,7 +88,7 @@ QT_USE_NAMESPACE
  184. printer->printEngine()->setProperty(QPrintEngine::PPK_Orientation, orientation == kPMLandscape ? QPrinter::Landscape : QPrinter::Portrait);
  185. }
  186. - dialog->done((returnCode == NSModalResponseOK) ? QDialog::Accepted : QDialog::Rejected);
  187. + dialog->done((returnCode == NSOKButton) ? QDialog::Accepted : QDialog::Rejected);
  188. }
  189. @end
  190. diff --git a/src/printsupport/dialogs/qprintdialog_mac.mm b/src/printsupport/dialogs/qprintdialog_mac.mm
  191. index 8547799..f7bbb59 100644
  192. --- a/src/printsupport/dialogs/qprintdialog_mac.mm
  193. +++ b/src/printsupport/dialogs/qprintdialog_mac.mm
  194. @@ -101,7 +101,7 @@ QT_USE_NAMESPACE
  195. QPrintDialog *dialog = static_cast<QPrintDialog *>(contextInfo);
  196. QPrinter *printer = dialog->printer();
  197. - if (returnCode == NSModalResponseOK) {
  198. + if (returnCode == NSOKButton) {
  199. PMPrintSession session = static_cast<PMPrintSession>([printInfo PMPrintSession]);
  200. PMPrintSettings settings = static_cast<PMPrintSettings>([printInfo PMPrintSettings]);
  201. @@ -190,7 +190,7 @@ QT_USE_NAMESPACE
  202. printer->setPageSize(pageSize);
  203. printer->setOrientation(orientation == kPMLandscape ? QPrinter::Landscape : QPrinter::Portrait);
  204. - dialog->done((returnCode == NSModalResponseOK) ? QDialog::Accepted : QDialog::Rejected);
  205. + dialog->done((returnCode == NSOKButton) ? QDialog::Accepted : QDialog::Rejected);
  206. }
  207. @end
  208. diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
  209. index 4c5c9e1..5b4a95e 100644
  210. --- a/src/testlib/qtestcase.cpp
  211. +++ b/src/testlib/qtestcase.cpp
  212. @@ -147,6 +147,7 @@ static bool debuggerPresent()
  213. return CFStringCompare(str1, str2, kCFCompareCaseInsensitive) == kCFCompareEqualTo;
  214. };
  215. +#if 0
  216. // Check if there is an exception handler for the process:
  217. mach_msg_type_number_t portCount = 0;
  218. exception_mask_t masks[EXC_TYPES_COUNT];
  219. @@ -163,6 +164,7 @@ static bool debuggerPresent()
  220. }
  221. }
  222. }
  223. +#endif
  224. // Ok, no debugger attached. So, let's see if CrashReporter will throw up a dialog. If so, we
  225. // leave it to the OS to do the stack trace.