summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
Commit message (Collapse)AuthorAgeFilesLines
* QEventDispatcher*: port the Unix dispatchers to V2Thiago Macieira2024-03-131-13/+14
| | | | | | | | | | | They're all ported in one go because all the changes are the same and they all rely on QTimerInfoList. The changes are: - use Qt::TimerId to uniquely identify timer IDs - use Duration (nanoseconds) to specify the timer interval - rename registeredTimers() to timersForObject(), which is const Change-Id: I83dda2d36c904517b3c0fffd17b52958767d8a68 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* macOS: Avoid adding modal session for window that's already addedTor Arne Vestbø2023-10-261-0/+20
| | | | | | | | | | | | | | | | | Investigating QCocoaWindow::setVisible idempotence revealed that our QCocoaEventDispatcherPrivate::beginModalSession() implementation would happily add the same window multiple times, resulting in trying to re-start a modal session for the same window when the window was closed, confusing AppKit's logic for choosing the next key window when a modal window is closed. We now bail out if we detect this scenario, even if setVisible has been fixed. Additional logging has also been added. Pick-to: 6.6 6.5 Change-Id: I07418c12b421fb0b4ebf875050e32f56fdad6197 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QTimerInfoList: change timerWait() to return std::optional<ms>Ahmad Samir2023-08-111-6/+7
| | | | | | | | | | | | | QEventDispatcherGlib: it used the out-parameter timespec to set a timeout in milliseconds, making timerWait() return milliseconds is more straightforward. Also timerWait() returns the time rounded to milliseconds, so the code in QEventDispatcherGlib that rounded up the timespec::tv_nsec part was no-op, tv_nsec was always 0 IIUC. In QEventDispatcherGlib, guard against overflow with qt_saturate. Change-Id: Ie6f78374d00cbe8a6adf7b50ed67c8c86ab4d29d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTimerInfoList: don't inherit from a container in an exported classAhmad Samir2023-07-191-1/+1
| | | | | | | | | | | | | | | | | | | Instead use composition by using a container member; inheriting from containers has a couple of issues: - containers (STL and Qt) don't have virtual destructors, which means that deleting via a pointer to the base-class would be troublesome - as it turns out, inheriting from containers, QList in this case, in an exported derived-class could lead to binary-incompatibility issues (see linked bug report) Drive-by change: - group all private members in one place - make timerInsert() private, nothing should use it from outside the class anyway Change-Id: I69843835d8c854fa4b13e8b4ba3fb69f1484f6a6 Fixes: QTBUG-111959 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* macOS: Ensure NSEvent processing during NSApp initializationTor Arne Vestbø2023-01-031-0/+1
| | | | | | | | | | | | | After 27f08548131e385f3c0c1fd4721e5979d512effe we are ensuring NSApp initialization without relying on our own runloop sources. But stopping the app only happens after it has processed an NSEvent, such as a mouse move or key press, which in the case of an auto tests might not happen. To ensure that the [NSApp stop] has an effect we post a synthetic event, that has no other effect than waking up the runloop. Change-Id: Ifa8912a80f9deff62645cbef56c1b1230542f3e4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Don't send posted events via runloop observerTor Arne Vestbø2022-11-181-37/+0
| | | | | | | | | | | | | | | | The logic was added in b0016ea9a6b225757e3ee06b50e8f7d05463ddf7, but the test-case in the bug report works fine without this logic. As sending events from a runloop observer is dubious, and causes problems since it's not tied to the quite complex machinery of the general event processing, it's better to remove it. The original issue is already tested by sendEventsOnProcessEvents in tst_QCore/GuiApplication. Task-number: QTBUG-4521 Change-Id: I857519a09a13a72b7434727c0229606403be7ed3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Ensure NSApp initialization without relying on event processingTor Arne Vestbø2022-11-151-12/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | When processing events without QEventLoop::EventLoopExec we can not rely on [NSApp run] for running the native run loop. This can happen e.g. when running a dialog, or when processing events manually via processEvents(). Unfortunately, AppKit relies on at least one call to [NSApp run] for doing critical initialization of NSApplication, so when we end up spinning the native runloop via other means, we still need to ensure we pass through [NSApp run] at least once. Doing so in a way that relies on our own runloop sources firing and interrupting the NSApp run is fragile though. For example, the logic added in bffbfc5b3368abaa5f95b7e4f8342e9202ab065a to avoid live locks in CFRunLoop by skipping out event runloop source when processEvents() is called manually will also result in the [NSApp run] never being stopped. To fix this we use a dedicated runloop block instead, where we explicitly call [NSApp stop:] when first entering the runloop. In addition we ensure that none of our sources will process events, so that we don't end up recursing into a runModal or similar call until after we've initialized NSApp. Change-Id: I137df46d5fa4105cdc39fe74b6c12275cfd46127 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Move QMacAutoReleasePool from qglobal.h to qcore_mac_p.hSona Kurazyan2022-09-011-0/+1
| | | | | | | | And include qcore_mac_p.h where needed. Task-number: QTBUG-99313 Change-Id: Idb1b005f1b5938e8cf329ae06ffaf0d249874db2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* qcocoa: Fix typos in source code commentsJonas Kvinge2021-10-121-1/+1
| | | | | | Pick-to: 6.2 5.15 Change-Id: Ide20e1d133891890a7673c8403ea91b489baa8f6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QAbstractEventDispatcher: change event dispatcher timer interval to qint64Liu Yang2020-09-211-1/+1
| | | | | | | | | Resolve remaining Qt6 TODO [ChangeLog][QtCore][QAbstractEventDispatcher] The signature of the abstract virtual registerTime function now takes a qint64 value for the interval parameter. Change-Id: I10166ad5cfb455edc404d465a3731ff094a8977e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Get rid of hasPendingEvents() and flush()Lars Knoll2020-09-061-10/+0
| | | | | | | They are unused. Change-Id: I77383f2be45551401ed9c2f88285511134cc8b0d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Clean up modal sessions after each pass of processEvents()Richard Moe Gustavsen2020-06-271-0/+5
| | | | | | | | | | | The Qt macOS event dispatcher defers modal session cleanup until the next runloop pass. But as it stood, we never did do so for stand-alone qApp->processEvents() calls. The result was that a NSModalSession would be kept alive longer than necessary, which would impact the activation state of other QWindows. Change-Id: I054f3084132c9d20a29a3f5823c19b7123ef40bf Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* macOS: Clean up headersTor Arne Vestbø2020-06-051-2/+2
| | | | | | | | | | | | | | The headers are now C++ clean and can be used outside of Objective-C code. All includes of Objective-C frameworks have been moved to the implementation files. Header guards have been added in the few places they were missing. All includes are now done via #include, instead of sometimes using the #import variant. Change-Id: Ibb0a9c0bcfefbda4347737212e40e300a3184982 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Clean up header includes to use quotes or brackets as appropriateTor Arne Vestbø2020-04-151-9/+12
| | | | | | | | The includes can be sorted and unified even more, but that's left for another rainy day. Change-Id: I4d5670d6d8389f69d2631b83b8f421d1f685a0f9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QCocoaEventDispatcher: make 'interrupt' workTimur Pocheptsov2019-12-101-2/+20
| | | | | | | | | | | | | | | | | | | even if we are currently inside processEvents (apparently called manually and not from QEventLoop::exec()). A carefully crafted application (see, for example, the linked QTBUG or even updated auto-test) can trigger itself into failing to exit the current (potentially nested) event loop. We can harden our Cocoa event dispatcher to detect such condition and properly propagate 'interrupt' to where it'll do its job, indeed, interrupting the real event loop (aka [NSApp run]). This mainly means we have to undo what bool blocker would erroneously do. Also, long live (as people love to say these days) to another tricky (somewhat) auto-test (surely, it's not flaky!). Fixes: QTBUG-79477 Change-Id: I794f0cda23e24d36be67f2bb63d52b74be057c31 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> 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>
* Cocoa: rename IsMouseOrKeyEvent -> isUserInputEventMorten Johan Sørvig2019-10-291-36/+32
| | | | | | | | This matches the intended use of this function. Reformat to modern Qt style. Change-Id: I076d2bdb3ac14b346f0dc6934f7a47765badc6b0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Replace use of deprecated API in macOS event dispatchersTor Arne Vestbø2019-09-281-1/+1
| | | | | | Change-Id: I077ba12b406f662ba22b2f2cddf0171963335739 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Cocoa: always send queued user input eventsMorten Johan Sørvig2019-03-211-10/+21
| | | | | | | | | | | | | | | | | | | | | | | | | User input events will be queued if processEvents() is called with the ExcludeUserInputEvents flag. User code then expect that the queued events will be sent when the corresponding exec() call returns. We were sending queued user input event at the beginning of processEvents(). However, the cocoa event dispatcher also has a mode where it makes a blocking call to [NSApp run], in which case processEvents() never returns during event processing. This means we don’t get to call the queued-event-sending code. Factor out the queued-event-sending code to a new sendQueuedUserInputEvents() function. Call it from postedEventsSourceCallback() to make sure the queue is emptied after the ExcludeUserInputEvents processEvents() call is done. Task-number: QTBUG-69687 Change-Id: I4ff554ef4d39a69356736c33a650886b56bfdb4c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* macOS: Remove redundant tracking of modal sessions in QCocoaWindowTor Arne Vestbø2019-02-181-0/+5
| | | | | Change-Id: I43a40889b0731e4b480155256fc51eaa836e62a3 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Modernize worksWhenModal handlingTor Arne Vestbø2019-02-181-41/+0
| | | | | | | The code in QCocoaEventDispatcher was dead and could be removed. Change-Id: I0c57e64791045d65033376c096220983059028ba Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Use single call site for timer processing in event dispatcherTor Arne Vestbø2018-09-061-5/+10
| | | | | | | | | | Makes it easier to add shared logic later on. The call to maybeCancelWaitForMoreEvents() has been left out as it was not called from all call sites. Change-Id: Ibcb10ab4d788de80850b0e5a4286b4d49091cddb Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* macOS: Update all deprecated enums to their 10.12+ equivalentsTor Arne Vestbø2018-08-311-23/+23
| | | | | Change-Id: I3034258da95c9c70eb6758db92967f438617f6e9 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Cocoa QPA: Clean up 0 as pointerGabriel de Dietrich2018-04-191-30/+30
| | | | | | | | We use nil for Objective-C null pointers and nullptr everywhere else, including CoreFoundation and similar opaque types. Change-Id: Id75c59413dec54bf4d8e83cf7ed0ff7f3d8bb480 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Cocoa: Fix crash in currentModalSession()Morten Johan Sørvig2018-03-191-0/+11
| | | | | | | | | | | | | | | | | | | | | Add null-pointer checks to QCocoaEventDispatcher:: currentModalSession(): - window->handle() may return nullptr if the window has been destroyed. - We call beginModalSessionForWindow, which processes events. This can potentially destroy or delete the current window; pointers to it must be checked again. This also has the effect that currentModalSessionCached is not set to a session that does not have a window, also prevents clearing the cleanupModalSessionsNeeded flag for such sessions. Task-number: QTBUG-66536 Change-Id: Ie055933c872a8ede3c938882fb2d4f7cf8ff3c81 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-311-1/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/examples.pro qmake/library/qmakebuiltins.cpp src/corelib/global/qglobal.cpp Re-apply b525ec2 to qrandom.cpp(code movement in 030782e) src/corelib/global/qnamespace.qdoc src/corelib/global/qrandom.cpp src/gui/kernel/qwindow.cpp Re-apply a3d59c7 to QWindowPrivate::setVisible() (code movement in d7a9e08) src/network/ssl/qsslkey_openssl.cpp src/plugins/platforms/android/androidjniinput.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/widgets/widgets/qmenu.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp Change-Id: If7ab427804408877a93cbe02079fca58e568bfd3
| * Cocoa integration: do not use released sessionTimur Pocheptsov2017-08-291-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTBUG_10735_crashWithDialog started to show flakyness recently - it crashes, but not every time (which fits the definition of UB perfectly). While the test itself is doing weird things and puts our event dispatcher into a weird state, our API allows to: 1. Using QDialog to enter event loop (with runModalSession under the hood), then ... 2. to call from a slot (e.g. timer-attached) QApplication::closeAllWindows() while ... 3. we are still inside that special loop and using the 'session' object, thus ... 4. on the next iteration with [NSApp runModalSession:session] we'll re-use already released session (released by endModalSession which in turn was called indirectly by closeAllWindows). And Cocoa gives us a warning/hint: "Use of freed session detected. Do not call runModalSession: after calling endModalSesion:." Task-number: QTBUG-62589 Change-Id: Ie651cee1fba43cfd2b0fc44af5eddc5fd52e2907 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | macOS: Remove workaround for queued input events to stale windowsTor Arne Vestbø2017-06-291-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | We now track the platform window with a QPointer, so the event callbacks can (and do) check the validity of the platform window before passing them on. The window property of the NSView is also nil at the point of even delivery, if we need another way to check if the event is still valid. Task-number: QTBUG-39211 Change-Id: I6179bdb3af9606cd0abf981c0fe6cacb9a2d98ab Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | QCocoaEventDispatcher: Remove Carbon dependencyGabriel de Dietrich2017-04-041-2/+1
|/ | | | | | | | | | | | QCoreApplication::hasPendingEvents() is deprecated, and so is the event dispatchers' eponymous function. (A subsequent patch will remove all of the event dispatchers' function, and add a warning in QCoreApplication.) The replacing logic is based upon QEventDispatcherCoreFoundation. Change-Id: If2c1920148dc6d910e77c1dc8ac5b4459c149e2b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix deprecated API usageJake Petroules2017-01-241-2/+2
| | | | | | Change-Id: I62448507f80daf6be72994ee99f0fb1aa107eb78 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-161-0/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/common/linux-android.conf src/gui/opengl/qopengl.h src/network/socket/qnativesocketengine_winrt.cpp src/network/socket/qnativesocketengine_winrt_p.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/eglfs/api/qeglfsintegration.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp sync.profile Change-Id: If70aaf2c49df91157b864cf0d7d9513546c9bec4
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-11-151-0/+13
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/plugins/platforms/eglfs/qeglfsintegration.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp Change-Id: Id2da7c775439adb62646d5b741ee7c638042b34b
| | * macOS: Clear event dispatcher interrupt stateGabriel de Dietrich2016-11-081-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A pending interrupt of a QEventLoop may interfere with native runModal calls, resulting in Cocoa's main event loop to be stopped unexpectedly. After commit 9ab60b9c processEvents() no longer resets the event dispatcher interrupt flag. Add QCocoaEventDispatcher::clearCurrentThreadCocoa EventDispatcherInterruptFlag(). Use it to clear the interrupt state before calling runModal and variants. Work around the inability to use platform API in the print support code. Change-Id: I52f26f99a63cbb46969db42f65b09a3c3119ad15 Task-number: QTBUG-56746 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | | macOS: Remove workaround for including AppKit.h with slots definedTor Arne Vestbø2016-10-131-1/+0
|/ / | | | | | | | | | | | | | | | | | | The workaround doesn't seem to be needed anymore, and wasn't applied uniformly anyways. If it turns out AppKit still needs this workaround we should add CONFIG += no_keywords to cocoa.pro, instead of trying to wrap every single include of AppKit in a undef slots dance. Change-Id: Ia1b15137c03abcc92f0dd246796622772e99ca68 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-051-1/+1
|\| | | | | | | Change-Id: I34b5e290233d0869fbafac094a939aec2bf83fd5
| * QCocoaEventDispatcher: Save interrupt state between embedded callsGabriel de Dietrich2016-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since QCocoaEventDispatcher::processEvents() resets the interrupt state, this may prevent a higher level event loop from returning. For example, calling QMenu::exec() and, as a result of an action being triggered, the application calls QCoreApplication::processEvents() after QMenu::hideEvent(). In this case, the menu event loop can be stuck until we run another event loop. Task-number: QTBUG-53947 Change-Id: If7efe1c3c07f7222c695195cbb4f41715e49b02e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Wayne Arnold <wayne.arnold@autodesk.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | 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>
* | Link to AppKit instead of Cocoa.Jake Petroules2015-09-051-1/+1
|/ | | | | | | | | | | | | Cocoa is basically just AppKit + CoreData. Since we do not use CoreData in Qt, there is no reason to link to it or (transitively) import its headers. This is just a mechanical replacement of -framework Cocoa with -framework AppKit and <Cocoa/Cocoa.h> with <AppKit/AppKit.h> Change-Id: Ibcfc8a03c0ddff27a67fbc87dd7bd58a4b648956 Reviewed-by: Mika Lindqvist <postmaster@raasu.org> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Add shared implementation of a NSAutoreleasePool wrapper to qglobalTor Arne Vestbø2015-05-271-6/+5
| | | | | | | | | | | We have at least 5 different (but equal) implementations of a wrapper in Qt, and some code uses explicit NSAutoreleasePools. Having a shared implementation lets us clean up things a bit and makes it easier to reason about which pools are actually needed. Change-Id: I2fd8eefc3ae7308595ef9899b7820206268362a5 Reviewed-by: Tim Blechmann <tim@klingt.org> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove <qhash.h> where it's not usedMarc Mutz2015-04-201-1/+0
| | | | | | | | To avoid source-incompatibilites, wrap in QT_DEPRECATED_SINCE(5, 5) in public headers. Change-Id: I6117e8a6b11200d2f1a0a94a0e87d5c27538218e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.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>
* Cocoa: cleanup modal sessions for dialogs not run with .exec()Dyami Caliri2014-06-231-0/+3
| | | | | | | | | For modal dialogs not run through QDialog.exec(), the modal sessions were not cleaned up, causing the application's menus to be inaccessible. Task-number: QTBUG-37699 Change-Id: I2704c23fec8989aa2e8ddcc3d5e3f21bb6c5db73 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Cocoa: clear queued user input events when window is destroyedDyami Caliri2014-06-031-0/+15
| | | | | | | | | | QCocoaEventDispatcher stores user input events in a queue in certain cases. If the target of those events is destroyed, the events are later sent to the stale window, causing a crash. Task-number: QTBUG-39211 Change-Id: Ie55d2df5697c742bcb644ebf8c5028015a0b8148 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Cocoa: Make QMacNativeWidget event processing workMorten Johan Sørvig2014-06-031-1/+1
| | | | | | | | | | | | | | | | | Don't interrupt the Qt event loop if the Qt event loop isn't running (meaning processEvents has not/ will not be called). This can happen in the QMacNativeWidget or plugin case where the native code calls [NSApp run] and QApplication::exec() is never called. In Qt 4 this was not necessary since UI event processing was more direct: QCocoaView would call QCoreApplication::sendMouseEvent/sendSpontaneousEvent directly on mouse events. Task-number: QTBUG-36225 Change-Id: I2894cbbca66a902652c9f8bc916e94ad8ce0e18e Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Cocoa: Fix modal session cleanup.Morten Johan Sørvig2014-05-281-3/+10
| | | | | | | | | | | | | | | | Call [NSApp endModalSession] at the correct time. Calling cleanupModalSessions() from processPostedEvents() resulted in endModalSession being called from within [NSApp runModalSession] - ending and cleaning up the the modal session while Cocoa is still using it. Move the cleanupModalSessions() call to to after runModalSession returns. Task-number: QTBUG-37699 Change-Id: I5868def36f6869667b0bbe33733286e3e49488eb Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Partially revert "Cocoa: support modal windows"Morten Johan Sørvig2014-05-281-24/+12
| | | | | | | | | | | | | | | This reverts parts of commit d9875f7bff6d52a52a1d0bf4002044a5304cf6bf, in particular the code for "2. Make interrupt() use [NSApp abortModal]" abortModal is not the right way to end a modal session, and introduced bad side effects, as reported in QTBUG-34677. Restore this part of the event dispatcher to the Qt 4 state. Change-Id: Iacc2d4a0757807c87c4320c93ed4db186622945c Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Revert "Cocoa: Don't stop NSApp when showing a modal dialog"Morten Johan Sørvig2014-05-281-15/+1
| | | | | | | | | | | This reverts commit ff3dcc49c4a1912189091e35e87cb61af2f62d47. The reverted commit is an incorrect bug-fix for a regression introduced by adding a call to [NSApp abortModal] in change d9875f7b. Change-Id: I1307d1790ada740e0552d62267b6009cbccd6c4c Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Revert "Cocoa: Post event to "show()" a modal window"Morten Johan Sørvig2014-05-281-14/+11
| | | | | | | | | | | This reverts commit a9cbddf4739f3cfabd38367b5f872fe2c1a3814c. The reverted commit is an incorrect bug-fix for a regression introduced by adding a call to [NSApp abortModal] in change d9875f7b. Change-Id: If23463ebdfe2ff64c68739dbece73a13773683c9 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>