summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
Commit message (Collapse)AuthorAgeFilesLines
* Session management for macOSSamuel Gaist2019-12-021-1/+15
| | | | | | | | | | | | | | This patch aims to implement the session management available on macOS. Currently applicationShouldTerminate is just a go through that closes everything and ends the application. The new implementation calls first appCommitData and cancels the termination properly if required. This means that if a user wishes to logout, Qt applications can now cancel that like e.g. answering to Safari asking whether it is ok to close because of a number of opened tab/window. Fixes: QTBUG-33034 Change-Id: Id5d7416cb74c762c5424a77c9c7664f0749da7f6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Make QObjectPrivate::threadData a proper atomicGiuseppe D'Angelo2019-11-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QObjectPrivate::threadData used to be a QThreadData *, and was read and written from multiple threads without proper synchronization. As an example, it was read from QCoreApplication::postEvent and written from QObject::moveToThread, therefore causing UB. Port threadData to a proper atomic, removing the races. Fix all usage points. In general, QObject is documented to be simply reentrant, not thread-safe, and certain bits (e.g. timers, moveToThread) are not even reentrant. The reasoning therefore is that a given QObject's threadData is not supposed to be touched by multiple threads without some synchronization happening elsewhere, and therefore relaxed loads should be sufficient. As drive-by change: refactor QCoreApplication::postEvent. It was particularly subtle, because it had a loop using a volatile to cope with the possibility of the receiver object switching thread while we tried to lock its thread's event queue. However, volatile does not achieve any synchronization, so drop it, and refactor the algorithm using better locking primitives. Put this algorithm in a common place, and also reuse it from removePostedEvents, which was lacking any synchronization. Change-Id: Icc755f7eb418ff54b33db4bdd87fd8eaf4e82c7a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Propagate application termination requests through QPATor Arne Vestbø2019-10-191-19/+12
| | | | | | | | | | | | | | | | | | | | | | | | | Instead of having each platform plugin deal with application termination in their own weird ways, we now have a QPA API to signal that the system requested the application to terminate. On the QGuiApplication side this results in a Quit event being sent to the application, which triggers the default behavior of closing all app windows, and then finally calling QCoreApplication::quit(). The quit event replaces the misuse of a close event being sent to the application. Close events are documented as being sent to windows. The close events that are sent to individual windows as part of the quit process can be ignored. This will skip the final quit() of the application, and also inform the platform that the quit was not accepted, in case that should be propagated further. In the future the logic for closing windows should be unified between the various approaches in closeAllWindows, shouldQuit, and friends. Change-Id: I0ed7f1c0d3f0bf1a755e1dd4066e1575fc3a28e1 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* macOS: Merge [QCocoaApplicationDelegate canQuit] into callsiteTor Arne Vestbø2019-10-191-30/+24
| | | | | | | | The logic for handling termination without any event loops has been moved up as an early exit, and the code has been modernized. Change-Id: I202720b9923e35732cffea656e1ce108ef11953d Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* macOS: Let system decide whether modal window should prevent app terminationTor Arne Vestbø2019-10-181-22/+3
| | | | | | | | | | | | | | | The logic for preventing application termination when there are modal windows active was a leftover from the Carbon to Cocoa port, and is no longer needed. AppKit will deal with this on its own, by checking the preventsApplicationTerminationWhenModal property of each NSWindow. In some cases AppKit will also ignore this property, such as when quitting the application from the menu entry, which means we now get the default system behavior for this use-case. Change-Id: Iac5d8d8e17eb0974448f7ee6f39c9b7761bf4d90 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Don't dismiss menu during applicationShouldTerminateTor Arne Vestbø2019-10-161-2/+0
| | | | | | | The logic was a leftover from the Carbon days and is no longer needed. Change-Id: I557b669eadea902fa439c43162218c5864077df9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Simplify Objective-C namespacingTor Arne Vestbø2019-10-151-1/+1
| | | | | | | | | | | | | | | | We only need to use the QT_MANGLE_NAMESPACE macro when declaring the interface of the class. As long as we couple that with an alias declaration using QT_NAMESPACE_ALIAS_OBJC_CLASS, any further uses of the class name can be un-namespaced, including declaring categories on the class. The only snag with QT_NAMESPACE_ALIAS_OBJC_CLASS is that it can only be used once per class and translation unit, so forward declarations get hairy, but we can avoid that by just including the headers instead. Change-Id: I333bcd18fe1e18d81fbd560b0941c98b1c32460e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Don't override event handler for kAEQuitApplicationTor Arne Vestbø2019-10-111-13/+0
| | | | | | | | | | | The implementation of the default handler, [NSApp _handleAEQuit], does a lot more than just terminating the application, including sending NSWorkspaceWillPowerOffNotification if appropriate, and deals appropriately with state restoration. Change-Id: If725838fc0f40d09a0b8885eb3e7239499d8fea0 Fixes: QTBUG-18624 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* macOS: Simplify reflection delegate handling in QCocoaApplicationDelegateTor Arne Vestbø2019-10-111-25/+10
| | | | | | | | | | | | | | | Sending a message to a nil object returns nil, so there's no reason to check the delegate before calling respondsToSelector, and we can use the implicit _cmd argument to pass along the selector for the method we're in. For applicationShouldTerminate, if there's a reflection delegate but it doesn't answer to applicationShouldTerminate it makes no sense to skip our own logic. Change-Id: Iafcd883a5c8cec1b35d2f95238de55eff060d71f Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Decouple screen property updates from application delegateTor Arne Vestbø2019-02-201-12/+0
| | | | | | | Change-Id: I489c37131bf715d45f147964de4a8cd8c02adbcb Fixes: QTBUG-72966 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Remove special handling for hiding tool windows on application hideTor Arne Vestbø2019-02-201-36/+0
| | | | | | | | | | | | | | The code was needed when we had QCocoaWindow::hide(), that guarded the ordering out by checking the visible state of the NSWindow. We no longer have that method, and setVisible doesn't have the same guard. Added a comment in setVisible to prevent future travelers from adding logic that introduces the same situation. Change-Id: I0514619a303daceb1cd7d334f0de4bfce6c3e96f Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Remove dead code in window activation handlingTor Arne Vestbø2019-02-181-24/+0
| | | | | | Change-Id: I321ab68b51c4ba63204c0e15fec74164e2c93d34 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: restore hidden popup windowsRafael Roquetto2018-10-281-2/+20
| | | | | | | | | | | | | | We need to to explicitly unhide popup windows that were previously explicitly hidden by applicationWillHide, so that their visibility will be effectively restored when the application is unhidden (otherwise the windows are gone forever even though their internal visibility is set to true). Change-Id: I4dbd209b07f769cc815851b40c41db0739ca2dc9 Task-number: QTBUG-71014 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove codepaths and checks for unsupported Apple platformsTor Arne Vestbø2018-08-311-7/+5
| | | | | | | We no longer support macOS 10.11, iOS/tvOS 10, or watchOS 3. Change-Id: Ide03d8fac06185ef4162ba75ee54a0adf6916905 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Cocoa Menus: Add support for menu items in window-less appsGabriel de Dietrich2018-05-231-13/+54
| | | | | | | | | | | | | | | | | Since we moved the menu items validation and target/action to QNSView (thus relying on the responder chain), we need to take care of case when the applications that doesn't have any window open. By adding similar methods to QCocoaApplicationDelegate, the last responder, we ensure the menu items will be validated and will trigger properly. This is particularly necessary for dock menu items, which live separately from any top-level widget. Dock menu added to Menurama which won't quit when its last window is closed. This way we can test that dock menu items will trigger in the absence of any window. Change-Id: I56d864eb9da1f8dd5adb2a3b6c3dd5304c723117 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Clean up our Objective-C usageJake Petroules2018-02-201-7/+11
| | | | | | | | | | | | | | | | - Move ivars into @implementation - Use instancetype where applicable - Use dot notation for property access - Use subscript operator for dictionaries and arrays - Format selectors consistently - Use proper style for init methods - Use generics instead of void pointers where possible - Use "range for" loops instead of indexing - Replace or replace IBAction/IBOutlet with void Change-Id: I1667812a51d4dfe44ae80fe337cb1f4bc9699d92 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.11Liang Qi2018-02-141-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/corelib/animation/qvariantanimation.cpp src/corelib/global/qglobal.cpp src/corelib/global/qlogging.cpp src/corelib/io/qprocess_win.cpp src/corelib/json/qjsonarray.cpp src/corelib/tools/qsimd_p.h src/corelib/tools/qtimezoneprivate_p.h src/corelib/xml/qxmlstream_p.h src/gui/kernel/qsimpledrag.cpp src/gui/kernel/qsimpledrag_p.h src/plugins/generic/generic.pro src/plugins/platforms/cocoa/qcocoamenu.mm src/widgets/styles/qmacstyle_mac.mm tests/auto/concurrent/qtconcurrentmap/BLACKLIST tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/widgets/dialogs/qmessagebox/BLACKLIST Change-Id: I508d686cf20f7f8cc6a7119b9bc7c3bbb505c58e
| * Cocoa: Explicitly hide popup windows when the application is hiddenAndy Shaw2018-01-251-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the application is hidden then Qt will hide the popup windows associated with it when it has lost the activation for the application. However, when it gets to this point it believes the popup windows to be hidden already due to the fact that the application itself is hidden. As a result, when the application is restored it causes a problem with the still visible popup window as it is taking the input events without responding to them. Therefore we need to explicitly hide the windows right before the application is hidden to ensure that they are actually hidden correctly. Task-number: QTBUG-58727 Change-Id: I4be1e1c0b1388d0c9ec872e7732185670998b7af Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Cocoa QPA: Delete singletons on exitGabriel de Dietrich2017-12-261-29/+12
| | | | | | | | | | | | | | | | | | | | This involves QCocoaApplicationDelegate and QCocoaMenuLoader. The former has been modernized to use blocks. The latter was not being deleted previously. Change-Id: Ic4cbfed2d9598fa04130675b3330d985b9489a21 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | Clean up OS version checks for Apple platformsJake Petroules2017-09-291-1/+1
|/ | | | | | | | | | Convert QSysInfo/QOperatingSystemVersion to __builtin_available where required or possible, or to QOperatingSystemVersion where __builtin_available cannot be used and is not needed (such as negated conditions, which are not supported by that construct). Change-Id: I83c0e7e777605b99ff4d24598bfcccf22126fdda Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix spelling: neccessary -> necessaryMorten Johan Sørvig2017-03-221-1/+1
| | | | | Change-Id: I7c1b1d4ef12391e1caf00eae4b816cdc6d08ee04 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Cocoa: Unbreak app activation on macOS SierraMorten Johan Sørvig2016-12-081-5/+9
| | | | | | | | | | | | | | | | | | Previously, we would activate the application during QCocoaIntegration construction, which means at QApplication creation time. This now seems to interfere with application startup on macOS Sierra, where the application window ends up in an unfocused state. Move application activation to applicationDidFinishLaunching, at which point the Cocoa runtime should be completely initialized. Do this for 10.12+ only to avoid regressions/ test failures on previous versions. Change-Id: Ic5f150d53f06a302b53a3ba86a4a9b18bb2a1783 Task-number: QTBUG-57044 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Replace QCFString::to(CF/NS/Q)String usage with QString methodsTor Arne Vestbø2016-10-061-2/+2
| | | | | | | | Slims down QCFString and leaves only one implementation of converting back and forth between CF/NS strings and QStrings. Change-Id: I068568ffa25e6f4f6d6c99dcf47078b7a8e70e10 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Cocoa QPA Menus: Clean-up QCocoaMenuLoader related codeGabriel de Dietrich2016-08-011-12/+1
| | | | | | | | | | | | | | | Now that QCocoaMenuLoader is a singleton, we can access it the natural way. In all cases, it already needed to be done in an Objective-C file, so it doesn't change anything from this point of view. Furthermore, we decide to remove private accessor APIs in QCocoaApplication and QCocoaApplicationDelegate which are now redundant. Change-Id: I4190ed2e2536b778482c513727e279c9318acb7e Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QCocoaApplicationDelegate: Remove unused functionGabriel de Dietrich2016-07-231-6/+0
| | | | | | | | | This seems to be a leftover from pre-QPA Cocoa menus time. Change-Id: I1bcfb3a882f500a63a5dec0fbe01f4541e14d54a Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* Make QCocoaMenuLoader a singletonGabriel de Dietrich2016-07-221-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | In some auto-tests, we create several instances of QGuiApplication (though seldom, if ever, simultaneously). However, the QCocoaMenuLoader instance was never properly deallocated, resulting in NSApplication.servicesMenu to still be assigned. This resulted in an exception being raised (NSInternalInconsistencyException) the second time we would construct a QCocoaMenuLoader. The CPU cycles saving solution is to make QCocoaMenuLoader a singleton. This approach is also safe since this class' initialization doesn't depend on any state in QGuiApplication (even the application name is fetched from either the main bundle or the app's args). This also allows us to clean up some code in QCocoaApplication and QCocoaApplicationDelegate who have suffered from lack of attention over the years. Change-Id: Ic4c859d628ab8abd9b469b99c64293582f8e363d Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Cocoa: Don't send duplicate close events.Morten Johan Sørvig2015-09-251-6/+2
| | | | | | | | | Use the presence of a platform window to detect if the QWindow has already been closed. Change-Id: Ieedf231cc5b805ed6383e55a82ca137087805a4f Task-number: QTBUG-43344 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-07-011-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qglobal.h src/corelib/global/qsysinfo.h src/corelib/global/qsystemdetection.h src/corelib/kernel/qobjectdefs.h src/plugins/plugins.pro tests/auto/widgets/itemviews/qlistview/qlistview.pro Change-Id: Ib55aa79d707c4c1453fb9d697f6cf92211ed665c
| * Cocoa: QCocoaApplicationDelegate - correctly install cleanup handlerTim Blechmann2015-06-041-1/+1
| | | | | | | | | | | | | | | | | | + (id)allocWithZone:(NSZone *)zone returns before the cleanup handler is installed. this causes the QCocoaApplicationDelegate not to be cleaned up by the garbage collector Change-Id: Ic4862b96228539f3da857955f08157402974a104 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | Cocoa integration - menus and Qt::Tool windowsTimur Pocheptsov2015-03-271-0/+5
|/ | | | | | | | | | | | | | If an app has only Qt::Tool window(s) at start, menu is not updated, since Qt::Tool is also a Qt::Popup (included) and we have a special logic for Qt::Popup in QCocoaMenuBar::updateMenuBarImmediately. Using QCocoaApplicationDelegate (ivar 'inLaunch') we can avoid this problem. Change-Id: Ie1c4ef241cd19fa0af93c54de2b36e6e932cb77c Task-number: QTBUG-32539 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Fixed compilation on Mac OS X (qt namespace and preprocessor issues))Sergei Kulik2015-03-201-0/+2
| | | | | | | | Configured with -qtnamespace <...> -no-opengl -D QT_NO_PRINTER Change-Id: I1c959a89afda08d29a854f21e6e51732d136753c Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Fixed license headersJani Heikkinen2015-02-171-1/+1
| | | | | Change-Id: Ibebe1318d1c2de97601aa07269705c87737083ee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-22/+14
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* OS X - maximize app's window from the Dock or using cmd-tabTimur Pocheptsov2014-10-211-1/+1
| | | | | | | | | | | | | | | | | | | | On OS X it's possible to maximize app's window by clicking on an app's icon in the Dock. Another trick is to use cmd-tab to select an app +, while still holding the 'cmd' key, press the 'option' key - this should also maximize a window. None of these works at the moment, and to enable these features app delegate should return YES from the -applicationShouldHandleRepopen:hasVisibleWindows:. method. Task-number: QTBUG-40084 Change-Id: I33ba9e74d55d41d23deb429612519b746d461d9e Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-09-231-0/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The isAlwaysAskOption was removed in 38621713150b663355ebeb799a5a50d8e39a3c38 so manually removed code in src/plugins/bearer/connman/qconnmanengine.cpp Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qcollator_macx.cpp src/corelib/tools/qstring.cpp src/gui/kernel/qwindow.cpp src/gui/kernel/qwindow_p.h src/gui/text/qtextengine.cpp src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h src/plugins/platforms/android/qandroidinputcontext.cpp src/plugins/platforms/xcb/qglxintegration.cpp src/plugins/platforms/xcb/qglxintegration.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp src/testlib/qtestlog.cpp src/widgets/dialogs/qfiledialog.cpp src/widgets/kernel/qwindowcontainer.cpp tests/auto/corelib/tools/qcollator/tst_qcollator.cpp tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp Change-Id: Ic5d4187f682257a17509f6cd28d2836c6cfe2fc8
| * OSX: emit aboutToShow signal for top-level dock menu.Erik Verbruggen2014-09-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt sets a QCocoaMenuDelegate on every menu it creates in order to emit the (OSX specific) aboutToShow signal. However, there are a few cases where OSX will copy a menu without copying the delegate. One of those cases is the dock: the result of -[NSApplication applicationDockMenu:] is used to create a new menu, to which a few more items are copied. This copy is then send back to the dock. This patch invokes the delegate's -menuWillOpen: method when -[NSApplication applicationDockMenu:] is called. Note that sub-menus won't receive the call-back, because the dock doesn't tell the application what happens after returning from applicationDockMenu:. Task-number: QTBUG-39604 Change-Id: I0e06df371a3d77342ae4b7148041214e5c4579d7 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | Revert "Session management for OS X"Olivier Goffart2014-07-131-17/+14
| | | | | | | | | | | | | | | | | | Broke tst_QMenu::statusTip by closing the menu while it should not. (and therefore, a QTimer::singleShot that fires while following test are running is making the test fail) This reverts commit 50c04d631858639c630e85456e7e003a80e33493. Change-Id: Ib4ef8190f945b915fe268745cc64d471994c5e2d Reviewed-by: Richard J. Moore <rich@kde.org>
* | Session management for OS XSamuel Gaist2014-07-101-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch aims to implement the session management available on OS X. Currently applicationShouldTerminate is just a go through that closes everything and ends the application. The new implementation calls first appCommitData and cancels the termination properly if required. This means that if a user wishes to logout, Qt applications can now cancel that like e.g. answering to Safari asking whether it is ok to close because of a number of opened tab/window. Task-number: QTBUG-33034 Change-Id: Icedc8590a1c0934d9bc87d3a43d6702a9903bfb8 Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
* | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-031-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/accessible/qaccessiblecache_mac.mm src/gui/accessible/qaccessiblecache_p.h src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/widgets/kernel/qwidget_qpa.cpp Manually moved change in qwidget_qpa.cpp to qwidget.cpp (cd07830e3b27da7e96a0a83f91ba08c168b45e62) Change-Id: Ia51f471f9b53de2f3b07d77ea89db9303ac8961d
| * OS X: when opening a URL via QFileOpenEvent, pass as QUrlShawn Rutledge2014-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | Opening a file from Finder and opening a URL from the browser are two different operations, and the URL might not be a local file. Task-number: QTBUG-39972 Change-Id: I467dfef7efe8eb88c922410db16137e135bc8133 Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-011-1/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/qnx-x86-qcc/qplatformdefs.h src/corelib/global/qglobal.h src/network/socket/qnativesocketengine_winrt.cpp src/plugins/platforms/android/androidjniaccessibility.cpp src/plugins/platforms/windows/qwindowswindow.cpp Manually adjusted: mkspecs/qnx-armle-v7-qcc/qplatformdefs.h to include 9ce697f2d54be6d94381c72af28dda79cbc027d4 Thanks goes to Sergio for the qnx mkspecs adjustments. Change-Id: I53b1fd6bc5bc884e5ee2c2b84975f58171a1cb8e
| * Cocoa: Don't send duplicate close events.Morten Johan Sørvig2014-06-101-1/+8
| | | | | | | | | | | | | | | | | | | | | | Don't send QCloseEvents to QWidgetWindows during cmd-q application shutdown, since widgets will will already have received close events from QApplication close event handling. Task-number: QTBUG-39398 Change-Id: I7f6e892b0042361bed7a3bc5fac8518eabfc8e4e Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devJ-P Nurmi2014-06-051-1/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qt.prf src/plugins/platforms/xcb/qxcbwindow.h src/tools/qdoc/qdocindexfiles.cpp src/widgets/kernel/qwidget_qpa.cpp Change-Id: I214f57b03bc2ff86cf3b7dfe2966168af93a5a67
| * Cocoa: Adapt to Xcode 6 clang version sudden pickinessGabriel de Dietrich2014-06-031-1/+1
| | | | | | | | | | | | | | Yes, that means OS X Yosemite fix. Change-Id: I236f7af7b803de24ff0895e04c9a9253b5cfdb3b Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | OS X: Add support for ApplicationState capabilitySamuel Gaist2014-04-241-0/+22
|/ | | | | | | | | | | | | | | | Currently a click on e.g. the dock icon is not propagated to the application so if for example the main widget is hidden, it can't be brought back. Also neither applicationDidBecomeActive nor applicationDidResignActive do anything. This patch fixes it [ChangeLog][QPA][OS X] Add support for ApplicationState capability. Application can now detect when an application states has changed as well when the dock icon has been clicked. Task-number: QTBUG-10899 Change-Id: I53d3e6eed4adc62b343e7aa3e3d8068d3248e7df Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Cocoa: Close windows with QWSI::handleCloseEvent()Morten Johan Sørvig2014-03-201-1/+2
| | | | | | | | Calling QWindow::close() directly bypasses some of the window close logic in the QWindow subclasses. Change-Id: I208db5600e6a756e25e207eaaf55dcfad255f406 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Cocoa: Establish pattern for accessing globalsMorten Johan Sørvig2014-02-041-1/+1
| | | | | | | | | | Use a static QCocoaIntegration pointer instead of QGuiApplication. This removes the need to call out of the platform plugin as well as the casting from "platform" to "cocoa" types. Change-Id: If432b3567811223b73a67548e475e07d63635b73 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* QCocoaApplicationDelegate: Play nice with the user's application delegateGabriel de Dietrich2013-09-251-7/+6
| | | | | | | We tended to ignore the original application delegate a bit too often. Change-Id: I0844c8658d128e4fbb9a6fc5000025f55e5293c2 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Revert Mac event loop changes.Morten Johan Sørvig2013-09-021-5/+72
| | | | | | | | | | | | | | | "Make QGuiApplication::exec() run within NSApplicationMain()" "Make Qt process native and timer events on Cocoa applications" "Cocoa: Fix QFontDialog, QColorDialog auto-tests" This reverts commits 1e14762b8d79118540bd09a84dd3e48f4f5e113e e4b2a0b4bab2a17a65fedafe9bae50af1fe019f6 df7944e7d7dd8b2bbccbd639eff0ab09745d6cc3 Change-Id: I80b65b5ee0297b090f807bd420664233dfc44f7b Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>