summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
Commit message (Collapse)AuthorAgeFilesLines
* Replace Q_DECL_OVERRIDE with override where possibleKevin Funk2017-09-1922-193/+193
| | | | | | | | | | | | | | | | Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-318-7/+28
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * QCocoaMenu: Stop update timerGabriel de Dietrich2017-08-281-0/+1
| | | | | | | | | | | | | | | | This amends patch f27d1ccbb24ec2fd4098f2976503478831006cc8. Change-Id: I4c7a390a5f2cdd3307007c7b6708692c36f861b4 Task-number: QTBUG-62396 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * Cocoa: Fix compile when using QT_NO_TABLETEVENTAndy Shaw2017-08-252-0/+6
| | | | | | | | | | Change-Id: I76f08d747009a5bf2c0e8004c3443e16e83b6a7d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * Initialize the print engine with the given printer nameAndy Shaw2017-08-254-6/+10
| | | | | | | | | | | | | | | | | | | | | | Originally when the QPrinter was created it would create the engine with the default printer and then change it afterwards even though the desired printer may already be known here. So by passing the printer name we ensure that it is initialized with the desired one right away. Task-number: QTBUG-62221 Change-Id: Iaa90243708b57bf89354a527a982ac45c991f603 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | macOS: Deduplicate QNSWindow/QNSPanel codeTor Arne Vestbø2017-08-245-213/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By sharing the implementations of the methods between QNSWindow and QNSPanel we don't need a helper, and can remove duplicated code. This duplication would expand in the future, as for each method added to the QNSWindowProtocol, we would have to add forwarding functions in both QNSWindow and QNSPanel, forwarding to QNSWindowHelper, and then two more functions in QNSWindow and QNSPanel in case we wanted to call super from the helper, similar to [QNSWindow superSendEvent]. The only snag is that calls to super are hard-coded to a specific superclass during complication, so we provide our wrapper for objc_msgSendSuper that resolves the superclass at runtime. The helper class QSendSuperHelper provides compile time implicit instantiation of the right template without having to provide the return type as a template argument, via operator T and a fallback for the case of no return type via the destructor. Change-Id: Iaf13f27675d90f884470f5005270ea0d9d0316f3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | macOS: Simplify and correct style mask determinationMorten Johan Sørvig2017-08-221-43/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function had accumulated a fair bit of accidental complexity over the years. - No early returns, make sure to preserve fullscreen state for all windows. - Use windowIsPopupType() directly to set borderless for Qt::Popup (but not Qt::Tool). - Handle Qt::Tool explicitly. - Deduplicate Qt::CustomizeWindowMask handling. - Remove case that used the absence of NSResizableWindowMask to remove the maximize button. Maximize is now disabled elsewhere (setWindowZoomButton). All windows now get NSResizableWindowMask by default. - Qt::ForeignWindow now gets a standard window style mask instead of NSBorderlessWindowMask. The old code did not handle this case and left the mask value unmodified. Change-Id: I56499e9f05c3f481b5a96e0507da2fb195f207fa Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | macOS: Restore support for layered modeTor Arne Vestbø2017-08-213-2/+55
| | | | | | | | | | | | | | | | | | After 871966 we now do drawing as a result of drawRect calls, but layer backed mode was not taken into account. This restores support for both pull and push-mode drawing in layer-backed mode. Change-Id: I35039ee9eb4486206f9f92f8230df104473368c9 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | macOS: Redraw window bottom corners after synchronous backing store flushTor Arne Vestbø2017-08-182-1/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Flushing outside of the display cycle does not care about any ordering between views, including the NSThemeFrame responsible for drawing the rounded corners of the window. Since Qt Widgets is doing a lot of synchronous flushing (for now, until we plumb update() to requestUpdate(), or enable layer-backing), we add a workaround that explicitly draws the corners after flushing, just like the logic in [NSView displayIfNeeded]. This is the same workaround used by WebKit: https://trac.webkit.org/changeset/85376/webkit Change-Id: I884152cdb2685569704e577b64b5ae278ed82c21 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Revert "macOS: Create NSView as initially hidden, to match QWindow behavior"Shawn Rutledge2017-08-181-9/+8
| | | | | | | | | | | | | | | | | | | | It seems to break the ability to grab an offscreen QQuickView. That in turn breaks the tst_qquickimage::hugeImages autotest. This reverts commit 096b56f336e5bb994d46f073d55496d36d38e6b1. Task-number: QTBUG-62548 Change-Id: I11ce452341bfc2cc3cbc832b613c7366049b31d5 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-154-4/+39
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qcocoamenu.h src/plugins/platforms/cocoa/qcocoamenu.mm src/plugins/platforms/cocoa/qcocoawindow.mm src/widgets/styles/qstylehelper_p.h Change-Id: I54247c98dd79d2b3826fc062b8b11048c9c7d9bb
| * QCocoaMenu: Sync menubar menu when adding itemsGabriel de Dietrich2017-08-152-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Empty menus on a menubar are hidden by default. If the menu gets added to the menubar before it contains any item, we need to get the menubar to sync the menu, which will update its native menu item hidden property. Menurama manual test's 'Add Many Items' button should now work. Change-Id: I8ce1df21031c171789318fdf28ae495819458d71 Task-number: QTBUG-62260 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * QCocoaMenu: De-pessimize the number of calls to validateMenuItem:Gabriel de Dietrich2017-08-152-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Calling -[NSMenu update] every time we add a new item can result in a quadratic behavior since the function itself will iterate over all the items in the menu. We solve this by using a 0-timer which will trigger the call to update the next time the event loop spins. Menurama manual test updated. Change-Id: Ic155d364515cc93eb81b1c8085c8e44c93799954 Task-number: QTBUG-62396 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * macOS: Make alpha-based click-trough work againMorten Johan Sørvig2017-08-091-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 3ea04c7d made it so that we always set the ignoresMouseEvent property on the NSWindow, based on the WindowTransparentForInput flag. However, this overwrites the magical secret initial state where click-trough is determined based on window content transparency - setting the property to false makes the window capture all events. Restore 5.6 behavior by not modifying ignoresMouseEvent if we can. Toggling WindowTransparentForInput on and off again is still broken. Task-number: QTBUG-54830 Change-Id: I5f44ce14d9a7dc1713f9efb1ef929e2969838d90 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | macOS: Create NSView as initially hidden, to match QWindow behaviorTor Arne Vestbø2017-08-111-8/+9
| | | | | | | | | | Change-Id: I25af6635ea9b6aa3fcc642fa2da0553341aabda8 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | macOS: Remove dead code from Leopard timesTor Arne Vestbø2017-08-101-6/+0
| | | | | | | | | | Change-Id: I02bc0a8488763fea525771636538b9d0943b8971 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | macOS: Log target view for backingstore flush without quotesTor Arne Vestbø2017-08-101-1/+1
| | | | | | | | | | Change-Id: I0d5f9f9172aaa7b9b7575dce6ba59b23567b35ce Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devOswald Buddenhagen2017-08-023-3/+13
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/xcb/qxcbconnection.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp src/plugins/styles/mac/qmacstyle_mac.mm src/widgets/widgets/qdockarealayout.cpp src/widgets/widgets/qmainwindow.cpp src/widgets/widgets/qmainwindowlayout.cpp src/widgets/widgets/qmainwindowlayout_p.h tests/auto/corelib/tools/qlocale/tst_qlocale.cpp tests/auto/other/macnativeevents/BLACKLIST tests/auto/widgets/widgets/qmenu/BLACKLIST Change-Id: Ic8e724b80a65e7b1af25511b0e674d209265e567
| * Fix 32-bit build on macOSJake Petroules2017-07-203-3/+13
| | | | | | | | | | | | | | | | | | | | Some customers still need this for interoperability with legacy code. Let's continue to keep it working in 5.9.x, and then move to 64-bit exclusive features (thus dropping 32-bit entirely) in 5.10. Task-number: QTBUG-58401 Change-Id: Ibb7200c1885e9caba70439df5f7c86c81b1312b5 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | macOS: Modernize QCocoaBackingStore::flush()Tor Arne Vestbø2017-07-295-145/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of forwarding the flush to the view, using CoreGraphics to blit the backing store to the window, we do everything in flush(), and use higher level AppKit APIs to do the blit. This simplifies the flow and code quite a bit, and also supports blitting of individual regions in a flush instead of the whole bounding rect. Change-Id: I2173c1a7763fe652a94125c7e3ae93a655412cd3 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | macOS: Send expose event with individual rects instead of bounding rectTor Arne Vestbø2017-07-261-3/+11
| | | | | | | | | | | | Change-Id: I914521e1dfecb0157a8b9e1c9d9a86ca45e0826e Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | macOS: Send expose event at drawRect and trigger updates via setNeedsDisplayTor Arne Vestbø2017-07-254-116/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the drawing model on macOS from the following: 1. Sending synchronous expose events directly from callbacks such as windowDidOrderOnScreen and windowDidChangeOcclusionState 2. Waiting for a resulting flush of the backing store, and issuing setNeedsDisplay as a response 3. Waiting for the asynchronous drawRect call in response to setNeedsDisplay, where the backing store is finally drawn to the window To the following: 1. Issue setNeedsDisplay as a response to callbacks such as windowDidOrderOnScreen and windowDidChangeOcclusionState, when needed (in many cases this is automatic by AppKit) 2. Send synchronous expose events from the resulting drawRect callback 3. Draw the backing store to the window when flushed The new model matches how normal Cocoa application draw in response to drawRect, and makes the backing store flush synchronous instead of having to trigger a async setNeedsDisplay. This gives AppKit more information about how much time we're spending in drawRect, as the actual drawing and flushing all happens within the synchronous expose event. Qt applications that draw outside of drawRect, e.g. in response to timers, are still supported by manually locking focus of the view and flushing the window at the end of the backingstore flush. Task-number: QTBUG-50414 Change-Id: I2efb9ff8df51ab6e840ad20c497b71f53e21e1c2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devSimon Hausmann2017-07-192-3/+4
|\| | | | | | | | | | | | | | | Conflicts: src/corelib/io/qwindowspipewriter.cpp src/widgets/styles/qcommonstyle.cpp Change-Id: I0d33efdc4dc256e234abc490a18ccda72cd1d9e6
| * macOS: Don't assume the proposed fullscreen size matches the screen sizeTor Arne Vestbø2017-07-171-3/+3
| | | | | | | | | | | | | | | | | | Sometimes AppKit will pass in a proposed size that's smaller than the geometry of the screen. We don't know why, but shouldn't assert. Change-Id: I9970c5f587e1e0fb3f2fa932de5a32ac4e1eb76d Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * Add missing #include for -no-widgetsStephan Binner2017-07-141-0/+1
| | | | | | | | | | | | Task-number: QTBUG-61780 Change-Id: I62fccc6474965278cb1b258b512fda3b60f995f3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | macOS: Improve QCocoaWindow logging a bitTor Arne Vestbø2017-07-181-17/+19
| | | | | | | | | | | | Change-Id: Ic3555445b045edda884983aa01834a4ae243d6fa Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Add QPlatformWindow::initialize() for two-step window creationTor Arne Vestbø2017-07-172-16/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QWindow::create method calls createPlatformWindow, and assigns the result to d->platformWindow. If the platform sends any sort of events synchronously during the creation, the event will be delivered to a QWindow that doesn't have a handle() yet, resulting in noop handling of the event, or crashes. To mitigate this situations, platforms should do as little a possible in the QPlatformWindow constructor, and leave initialization to the new method, where the QWindow will have a handle(). The macOS platform plugin still has a m_initialized guard, to prevent sending geometry changes during initialization, as this will result in a resize event before a show event. This forced behavior seems dubious, but is left for a followup patch. Task-number: QTBUG-61977 Change-Id: I04d32d93391e89d068752b719270438e7024ad46 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/devThiago Macieira2017-07-145-12/+34
|\ \
| * | Merge remote-tracking branch 'origin/5.9' into devGabriel de Dietrich2017-07-135-12/+34
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/widgets/qmainwindowlayout.cpp Change-Id: I306b4f5ad11bceb336c9091241b468d455fe6bb6
| | * macOS: Fix unused variable in window:willUseFullScreenContentSize:Tor Arne Vestbø2017-07-121-0/+1
| | | | | | | | | | | | | | | | | | Change-Id: I419f884f4145dbe2b60751bf6cde3968cf34fe4a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| | * Convert features.fontdialog to QT_[REQUIRE_]CONFIGStephan Binner2017-07-114-9/+13
| | | | | | | | | | | | | | | Change-Id: Iebc091ffd023595278fa177b7f205b6e0cd7ec52 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| | * Fix macOS build for -no-widgets, take 2Stephan Binner2017-07-101-2/+2
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-61780 Change-Id: Ic67074b19b3b5c409c0f1254be77ba122ad61a85 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| | * macOS: Account for fullscreen geometry bug in AppKit on OS X 10.10Tor Arne Vestbø2017-07-071-0/+15
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-61776 Change-Id: Ifac502cf422088eafe9211d759f2f5cd9769d0d3 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
| | * Fix macOS build for -no-widgetsStephan Binner2017-07-051-1/+3
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-61780 Change-Id: Icb337c4daeb976a6616dc289a5ffd0ec9345834f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | | macOS: Improve QDebug output for QNSView and QCocoaWindowTor Arne Vestbø2017-07-133-0/+42
|/ / | | | | | | | | | | | | | | | | | | By printing the corresponding QPlatformWindow and QWindow for a given QNSView we make it easier to track issues regardless of which of the views/windows are being logged. Change-Id: I4a42eff7f87cf3c8e722cd6ad8baccd4eeab8eb3 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | macOS: Remove unused m_maskData member in QNSViewTor Arne Vestbø2017-07-121-1/+0
| | | | | | | | | | | | Change-Id: If0dc8f90c657e09fc71bfae1fbffe6be980453da Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | macOS: Deliver screen change on window creation instead of on first exposeTor Arne Vestbø2017-07-111-10/+5
| | | | | | | | | | | | | | | | We know the resulting screen based on the geometry mappings we now do, so no need to wait until expose to deliver the screen change. Change-Id: Ibb84948ab091d8f74d31cdd2d300b381e2e1e7cc Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | macOS: Rename NSWindow variable in QCocoaWindow::createNSWindowTor Arne Vestbø2017-07-111-11/+11
| | | | | | | | | | | | | | To distinguish it from window(). Change-Id: I90eb5207c6d9f178f009ecf755e2be8d29149a6b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | macOS: Don't special-case QTestLib when reacting to occlusion eventsTor Arne Vestbø2017-07-111-12/+4
| | | | | | | | | | | | | | | | The tests (and Qt) should be able to handle occlusion of windows. Change-Id: I5e93e032f6a5282f19a20d0e230863d2a165f4e3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | QMacStyle: Simplify CE_PushButtonLabel, CE_TabBarTabLabelGabriel de Dietrich2017-07-101-2/+3
| | | | | | | | | | | | | | | | | | | | We don't need the calls to HIThemeDrawTextBox after all. These render simple text nowadays, so we can do this with Qt APIs. Also fixes TabBarPalette in QCocoaTheme. Change-Id: Ib9436be83f03bd62fca40feb110a86602794c5b7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | macOS: Use same naming for QPA event forwarding functionsTor Arne Vestbø2017-07-092-22/+26
| | | | | | | | | | | | | | Expose events and others will follow. Change-Id: I8e11a133381a678517b54ad1872fe302515d4104 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | macOS: Simplify QCocoaWindow::handleGeometryChangeMorten Johan Sørvig2017-07-093-11/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are really only two cases here, where the difference is the coordinate system of the window position. 1) Child QWindow and embedded QWindow: The position is relative to parent view/window origin. 2) Top-level QWindow: The position is relative to screen origin. Change-Id: I867133a5adbbf3a690f574aec06b70c2bc64ad95 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | macOS: Move geometry reporting from QNSView to QCocoaWindowTor Arne Vestbø2017-07-084-55/+61
| | | | | | | | | | | | | | | | | | | | | | There's no longer any reason to call out from QCocoaWindow to QNView for this, as the geometry events from AppKit are delivered directly to the QCocoaWindow. Most of the data used in the implementation are coming from QCocoaWindow anyways, and this enables geometry events for foreign windows in the future. Change-Id: Idd724d078e9981304dcbe6742b9ddc71640a2350 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Relieve platform plugins of having to persist geometry on WM callbacksTor Arne Vestbø2017-07-072-13/+2
| | | | | | | | | | | | | | | | | | We can offload this to QGuiApplication, just like the geometry of the QWindow is set. This ensures that all platforms behave the same, and that the documentation of QPlatformWindow::setGeometry is adhered. Change-Id: I19dbc32cb4fb146d716ec289c28030a547d3afaa Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | macOS: Deliver native events to windows, as well as to event filtersTor Arne Vestbø2017-07-061-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt has two APIs to intercept native events today: - QAbstractEventDispatcher::installNativeEventFilter() - Q{Window|Widget}::nativeEvent() On macOS we only implemented one of them, the native event filter code path, by calling filterNativeEvent from the Cocoa event dispatcher. We now also propagate the native event to the corresponding QWindow, and QWidget if applicable. It would be nice if there was only one Qt API for this, or at least only one codepath for platform plugins to care about, but since the event filter might catch more event types than gets delivered to the window, we probably need both code paths going forward. Task-number: QTBUG-40116 Change-Id: I0796bd62a2b7c08b2eaaf6f15db8088e9703af02 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | macOS: Don't deliver events via NSWindow for deleted QCococaWindowsTor Arne Vestbø2017-07-061-0/+8
| | | | | | | | | | | | Change-Id: Icb3794f37c929019de1e997e15f7d975492224c2 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-07-061-1/+17
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I43531e087bb810889d5c1fbfcdffb29b78804839
| * Cocoa: Reset the target + action for a menuitem after showing a dialogAndy Shaw2017-07-031-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | To make it more reliable and efficient we now do the reverse of what we are doing when redirecting the items. This will ensure that the actions are correctly reset to the original target and action. The original approach of updateMenubarImmediately() was not always doing this and it also does other unnecessary things as a result when all we need is to just reset the things we changed. Change-Id: Icefa38d47ec9434894f05caeed75fbf8bdfecb93 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-07-048-31/+55
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_unix.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/widgets/util/util.pri tests/auto/corelib/thread/qthread/qthread.pro tests/auto/corelib/thread/qthread/tst_qthread.cpp Change-Id: I5c45ab54d46d3c75a5c6c116777ebf5bc47a871b