summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
Commit message (Collapse)AuthorAgeFilesLines
* 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: 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>
* 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>
* Convert features.colordialog to QT_[REQUIRE_]CONFIGStephan Binner2017-07-024-8/+11
| | | | | Change-Id: If2ac57a10f38002db5a49be3882dfc507a84a3df Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.filedialog to QT_[REQUIRE_]CONFIGStephan Binner2017-06-295-9/+25
| | | | | Change-Id: I9bc229b0d1430b81eeb2cfca2b24474736d5d561 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.wheelevent to QT_CONFIGStephan Binner2017-06-281-3/+3
| | | | | Change-Id: I46083a9115c199d1ebe024ed5f64b160a27462f1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* macOS: Send text input and key events to focus object of window, not appTor Arne Vestbø2017-06-261-11/+8
| | | | | | | | | | | | | | | | The key events and input method callbacks coming from Cocoa are targeted at our specific NSView, so we should deliver them to the focus object of the corresponding QWindow, not the global application focus object. This means that we'll deliver key events to windows also when they are not key (active), but this is intentional, as we would otherwise fail to deliver input method events coming from e.g. the emoji/symbol picker, which steals the key window when active. Task-number: QTBUG-61359 Change-Id: I61326c08ad8bbd0c535b3cc8a67d0ceeec7ee910 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* macOS: Work around buildup of NSDisplayCycle objects during rapid paintingTor Arne Vestbø2017-06-261-0/+8
| | | | | | | Task-number: QTBUG-60012 Change-Id: Id5291f768a4b9d8d9c77804cb697e0c9fb151012 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QNSView: Remove tracking area on deallocationGabriel de Dietrich2017-06-131-1/+4
| | | | | | | | | | | | | | | Ultimately, the tracking areas seem to be managed by the NSWindow (or at least somewhere else than the NSView itself). So, it can happen that we involuntarily leave dangling pointers in the system after the QNSView is released. This has shown to crash applications creating and deleting many native views on a single QNSWindow, e.g. calling winId() on a complex and dynamic QWidget hierarchy. The crash would happen when the QNSWindow receives a native enter event, which results on Cocoa trying to invoke the owner of a previously deallocated NSTrackingArea. Change-Id: I3ca7a39ee5f1ec51c2215639f61ba907de3d8659 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Don't keep WA_MacAlwaysShowToolWindow windows always on topTor Arne Vestbø2017-05-242-2/+83
| | | | | | | | | | | | | | | | | | | | | | | | On macOS if an application is no longer active then it will cause any tool windows to hide until the application is active again. For applications that did not want this behavior and thus wanted the tool window to stay visible, the WA_MacAlwaysShowToolWindow flag is available. In order to ensure that this flag is respected, the tool window needs to have its level changed when the application active status changes. Once it is no longer active the window needs to be seen as a normal window, and when it is active then it needs to be set to be a window that is always on top to get the right behavior. Due to various bugs in AppKit we need to explicitly order windows in front during this process, which requires us to then iterate the windows in back-to-front order. For macOS versions < 10.12 there is no way to get an ordered list of windows, so we fall back to using the window creation order. Task-number: QTBUG-57581 Change-Id: If20b4698616707685f83b1378f87593f8169c8c6 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Cocoa: Clean up memory leak when providing the accessibilityActionsAndy Shaw2017-05-231-1/+1
| | | | | Change-Id: Ib69155ceedb7bf35e3a7b5daa309fc2d54e3f254 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* macOS: Don't create NSWindow for embedded viewsTor Arne Vestbø2017-05-161-2/+10
| | | | | | | | | | | An embedded view does not have a QCocoaWindow parent, but that doesn't mean it's a top level. Improved debug logging to make issues related to this code easier to spot in the future. Change-Id: I15b5acdd8d7112600618465a3b65b64fddc306f7 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* QCocoaMenuBar: Keep smart reference to platform windowGabriel de Dietrich2017-05-162-12/+12
| | | | | | Change-Id: Ib3a5b071f1cc66992969a85a092f8111e57dea44 Task-number: QTBUG-60786 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Add a few more platform window checks in QNSViewTor Arne Vestbø2017-05-081-27/+33
| | | | | | | | And unify all of them to use regular pointer check syntax, to stay consistent with other uses of non-smart pointers. Change-Id: Ic55d7a16f2010120aaa8eac5b2df8189490671a2 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Add autorelease-pool when recreating NSWindowTor Arne Vestbø2017-05-021-0/+2
| | | | | | | | Significantly reduces the number of objects left to rot in the root pool, which is only drained on application shutdown. Change-Id: Iad7520ab083715416d95413a63474b9153f22fb5 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Cocoa: Send correct mouse buttons for tabletsMorten Johan Sørvig2017-04-242-20/+22
| | | | | | | | | | | | | | | | | | | | | | | | Tablet vendors allow user configurable pen buttons where the user may assign a logical mouse button to a given physical button. In the case of Wacom tablets this mapping is not reflected in the buttonMask API, which returns the state of the physical buttons. Use NSEvent buttonNummber instead, which returns the logical button number, after applying user mappings. Unifiy button state stacking with the mouse handlers. Handle a special case where buttonNumber returns 0 for tablet right mouse presses. We get these events via rightMouse* event handlers and can hardcode the button number. Change-Id: I06b9b1aa98c49b84f7e3871e694c22c7ad0169d6 Task-number: QTBUG-57487 Task-number: QTBUG-54160 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* macOS: Initialize window geometry early on, instead of when creating NSWindowTor Arne Vestbø2017-04-191-2/+4
| | | | | | | | | We don't need to defer to NSWindow creation before determining the initial window geometry, and we don't need to redetermine each time we re-create an NSWindow for a QCocoaWindow. Change-Id: Ie13380830b44e96670ff16513f29deef5f5ae313 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* macOS: Split out font engine creation from QCoreTextFontDatabaseTor Arne Vestbø2017-04-041-1/+11
| | | | | | | | | | The Core Text font database can produce both Core Text and FreeType font engines. Refactor the code a bit so that the actual factory methods that differ between the two stand out, and do not require a granular runtime check in each method. Change-Id: Ib70f76f4a9001a8108d87c1101a50699a6ea8f55 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* macOS: Replace deprecated NSOpenSavePanelDelegate methodPavol Markovic2017-04-041-24/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | shouldShowFilename method has been deprecated since macOS 10.6. In 10.11 the behavior of this method has been broken, causing files containing metadata (e.g. audio) to be incorrectly filtered out, displayed them as disabled in file dialog even though they shouldn’t be. This erratic behavior applies also to NSOpenPanel setAllowedFileTypes if set to anything but nil. This has been confirmed to be a known bug in Cocoa. Using shouldEnableURL solves this problem and also removes risk of breaking compatibility with future SDKs. Renamed and simplified private method isHiddenFile to isHiddenFileAtURL. Renamed to be consistent with other Cocoa file query methods. Simplified to return true only if the file is hidden as the name of the method implies. Previously it might have returned true also if the file has not existed which was in fact very metaphysical answer. Check for presence of the file is done by other method before calling this one and the scope of the method is limited to one source file. Task-number: QTBUG-57527 Change-Id: I2fded712d4e7098eb444331d92e38cee71655100 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Remove workaround for default-sized NSViewsTor Arne Vestbø2017-03-283-15/+1
| | | | | | | | | | | | | | | | | The workaround introduced in 38a55c7 to explicitly call viewDidChangeFrame() was not ideal for a multitude of reasons. Instead we can just initialize the NSView with a NSZeroRect frame, which will ensure that whatever geometry we set from the Qt side will result in geometry change and expose events. The only case where we will not receive an expose event is if the QWindow is requested to be 0x0 sized, but that wouldn't warrant an expose event anyways. Also, it's not possible to initialize a QWindow to 0x0 from the Qt side, as that will trigger QPlatformWindow::initialGeometry() to pick the default size (160x160 in the case of macOS). Task-number: QTBUG-58963 Change-Id: Ia84de7edcfdf26b90e4e93186fabe8b5c7382caa Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Avoid expensive QHash::values() callsAnton Kudryavtsev2017-03-281-2/+4
| | | | | | | | | | | | | | qcocoawindow.mm: we can replace QHash::values() with std::vector since CoW is needless here and std::vector is more cache-friendly. Also replace foreach with range-based for. qitemeditorfactory.cpp: QHash::values() is used as auxiliary container to create QSet. Replace it with std::vector since CoW is needless here and apply sort-unique idiom to remove duplicates. Also avoid needless allocations. Change-Id: If34c7016977ceb7fab68e9298bf2e1944af79139 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QCocoaWindow - fix a compilation errorTimur Pocheptsov2017-03-281-7/+2
| | | | | | | | | | | | | Clang does not like Q_FALLTHROUGH in 'default' label, the diagnostics is: 'fallthrough annotation does not directly precede switch label'. Accodring to their docs: "The fallthrough (or clang::fallthrough) attribute is used to annotate intentional fall-through between switch labels. It can only be applied to a null statement placed at a point of execution between any statement and the next switch label." - obviously, there is no 'next switch label' in our case. Change-Id: Ia7dba4cb965a85d229d44b04b69633a8f07d4a0c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Disassociate NSView from contentView when switching NSWindowsTor Arne Vestbø2017-03-271-0/+7
| | | | | | | | | | | | | | | | | | | | | | When a NSView is the contentView of a NSWindow, it still has a superview, in this case an NSThemeFrame, and the theme frame is the view that retains the view, not the contentView property of the window. Unfortunately, when a view is removed from the NSThemeFrame by means of [NSView removeFromSuperview], or indirectly via [NSView addSubview:], AppKit does not update the contentView property of the corresponding NSWindow. The result is that the NSView might be deallocated while the NSWindow still is around, with a stale contentView property. To work around this we explicitly disassociate the view from the NSWindow when we know that we are going to release the NSWindow. This will take care of both resetting the property to nil, and remove the view from the NSThemeFrame superview. Task-number: QTBUG-59734 Change-Id: I1111d492f52fe5bdf86bbae071421f6a8a7a38b8 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-273-3/+3
|\ | | | | | | Change-Id: Icdd71e9713725bda9c305e338f5c8b41a92ed8e8
| * Fix spelling: neccessary -> necessaryMorten Johan Sørvig2017-03-223-3/+3
| | | | | | | | | | Change-Id: I7c1b1d4ef12391e1caf00eae4b816cdc6d08ee04 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | QMacPasteBoard - protect against dangling pointersTimur Pocheptsov2017-03-221-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QMacPasteboard we use converters from QMacInternalPasteboardMime, which has essentially a global QList of available converters. QMacInternalPasteboardMime and derived classes register/unregister their instances in this list (in ctors/dtors) and then QMacPasteboard is using converters from this list. Unfortunately, when we're un-registering converter (and this means we delete those objects) we do not remove dangling pointers from our pasteboard objects. Apparently, this problem can be seen only when working with macextras (thus having an access to this private API in client's code). Task-number: QTBUG-54832 Change-Id: Ie3aef4aaca8ef6c80544dc58821cf43fc26f84a1 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | QCocoaWindow: fix geometry issue when only minimumSize is setOleg Yadrov2017-03-183-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | When only minimumSize was set and it matched to the size NSView was created with, viewDidChangeFrame() was not called for the window and it's internal geometry value was still (0, 0) what led to unpleasant side effects such as QML content was not displayed until something caused an update. Task-number: QTBUG-58963 Change-Id: Ib12d36d405969971e7ff62b79b50c3d78928a649 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | QNSView: Harden logic around platform window accessGabriel de Dietrich2017-03-162-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some users have reported crashes in -[QNSView mouseEnteredImpl:] which we believe are due to null m_platformWindow. The stack traces are like the one below or similar: 0 libqcocoa_dylib QNSView mouseEnteredImpl_ 0x1F 1 appkit NSTrackingArea _dispatchMouseEntered_ 0xA2 2 appkit NSApplication sendEvent_ 0xF4D 3 libqcocoa_dylib QNSApplication sendEvent_ 0x4E 4 libqcocoa_dylib QCocoaEventDispatcher processEvents 0x184 5 qtcore QEventLoop exec 0x19C 6 qtwidgets QDialog exec 0x20B Moreover, since 2f505b79a49bdf5ba8d084e13ab339bcf956c849, that member is a QPointer, so we should do more systematic checks. Change-Id: Iced447515a4ae07a62734e587f5b08d46d313071 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-241-0/+4
|\| | | | | | | | | | | | | Conflicts: mkspecs/features/moc.prf Change-Id: Ia71c8e3b3185f7c999bf226d0675051b10b8740b
| * macOS: use active window device pixel ratio for drag pixmapOleg Yadrov2017-02-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QCocoaDrag::dragPixmap, it treats QDrag::source as a QWindow, but it is not - it's just a generic QObject* of some kind (which QQuickDrag sets to the originating QQuickItem, and the widgets stack sets to a QWidget). This failure means that dpr stayed at 1.0. Unfortunately it’s not possible to receive a pointer on QWindow directly from QQuickItem because QtWidgets and QtQuick do not share the sources, but we can use the same dpr as current focused window has because drag can only start from active window - press on a window which is not focused should activate it first. Task-number: QTBUG-57942 Change-Id: Id358c181d03d519188caaa83fb4226033b8ed1ea Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | macOS: Make sure NSResizableWindowMask is set when toggling fullscreenTor Arne Vestbø2017-02-222-14/+30
| | | | | | | | | | | | | | | | | | | | | | | | Instead of setting the mask in toggleFullScreen(), which is only hit when going to fullscreen via our own API, we do it in the window notification callbacks, which also includes going to full screen via the native macOS title bar buttons. This allows making customized windows without Qt::WindowMaximizeButtonHint full screen with the full geometry of the screen. Change-Id: I63c3e4582ea7c4fe8c0008265793c5f656b830b2 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | QWindow: Remove "_q_foreignWinId" dynamic propertyTor Arne Vestbø2017-02-224-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The platform plugins reading this out of the QWindow was a layering violation, and propagates the notion that a window can shape shift into representing a new native handle, while none of the platform plugins support this. A foreign QWindow is created via the factory function fromWinId(), at which point we can pass the WId all the way to the platform plugin as function arguments, where the platform will create a corresponding platform-window. The platform window can then answer the question of whether or not it's representing a foreign window, which determines a few behavioral changes here and there, as well as supplying the native window handle back for QWindow::winId(); [ChangeLog][QtGui][QWindow] The "_q_foreignWinId" dynamic property is no longer set nor read. [ChangeLog][QtGui][QPA] The function createForeignWindow() has been added to QPlatormIntegration and is now responsible for creating foreign windows. The function isForeignWindow() in QPlatformWindow has been added, and platforms should implement this to return true for windows created by createForeignWindow(). Task-number: QTBUG-58383 Change-Id: If84142f95172f62b9377eb5d2a4d792cad36010b Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | macOS: Retain foreign windowsTor Arne Vestbø2017-02-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Regression after 89842b97d74d1, where the retain was part of setView. We release m_view in the destructor, regardless of how the view was acquired, and the non-foreign window retains by being the one creating the view. Task-number: QTBUG-59001 Change-Id: I6d9621a63ea6ec2cee008986b0ab72ff61110ad7 Reviewed-by: René J.V. Bertin <rjvbertin@gmail.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | macOS: Move NSWindow creation properties into createNSWindow()Tor Arne Vestbø2017-02-161-56/+36
| | | | | | | | | | | | | | | | | | | | Allows the block in recreateWindowIfNeeded() that calls createNSWindow() to focus on how to (re)parent windows/views, while createNSWindow() takes care of how to set up the window. Dynamic properties that may change later on are handled in e.g. setWindowFlags(). Change-Id: Ice0e44d004bd2608b2b54e6dde0f404a1e07dc10 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | macOS: Rewrite window state handlingTor Arne Vestbø2017-02-166-110/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of relying on specific notifications to change the window state we now evaluate the state based on the current window state. This allows us to get rid of windowShouldZoom in the window delegate, making window state handling work for foreign windows as well, and also allows us to re-evaluate the state in more places, such as when moving a window, which may bring it out of maximized state. The full screen state is tracked by a helper category that doesn't just rely on the styleFlag, but also on the full screen notifications. This is needed as macOS will complain if you try to go in or out of fullscreen while a transition is in effect. The differentiation between performFoo: and foo: has been removed, as the latter works in both cases and doesn't rely on the button being visible/enabled. These changes fixes many observed quirks in the window state handling that also resulted in making it hard to write tests that relied on the fullscreen/maximized operations always working. Change-Id: I0538c42d9223a56f20ec9156f4939288e0750552 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | macOS: Don't hide NSWindowZoomButton when window can go into fullscreenTor Arne Vestbø2017-02-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The button in the title bar is used both for going into full screen and maximizing (zooming) the window. We can't hide/disable it unless both Qt::WindowFullscreenButtonHint and Qt::WindowMaximizeButtonHint are off. This means that when Qt::WindowMaximizeButtonHint is off, it's still going to be possible to Option-click the button to maximize the window, but this is less of a concern than hiding the full screen button when Qt::WindowFullscreenButtonHint is set. Change-Id: I70dbe27b3197fe22c1781277f8bf9a818d71d04d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | macOS: Don't try to cast foreign windows to QNSViewTor Arne Vestbø2017-02-112-3/+4
| | | | | | | | | | Change-Id: I08a4d76310a689c3c855d4c8306f9d7aa5cecadc Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | macOS: Handle window state changes directly in QCocoaWindowTor Arne Vestbø2017-02-114-29/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Now that notification callbacks are delivered directly to QCocoaWindow, it doesn't make sense to then send them to QPA via QNSView. By skipping the QNSView roundtrip we also enable window state notifications for foreign windows. As an optimization we no longer flush all window system events, but use the new synchronous API to deliver the window state change event. Change-Id: I529b625fbe22e664c34a51bcd4448d1bf0392e6b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Add QPlatformWindow::isForeignWindow()Tor Arne Vestbø2017-02-093-8/+9
| | | | | | | | | | | | | | | | Simplifies code at call sites and allows for refactoring how to decide if a window is foreign or not at a later point. Change-Id: Icc51a83bac187f4975535366b53b4990832b6c82 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-081-2/+9
|\| | | | | | | | | | | | | | | Conflicts: configure.json mkspecs/win32-icc/qmake.conf Change-Id: Ibf40546b024d644c7d9ed490bee15b82597f4d3f
| * Fix regression preventing VoiceOver following the keyboard focusFrederik Gladhorn2017-02-071-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | In fafdb171e0c317ee8f871dc7b504d3713d5860eb a potential nullptr deref was fixed, but it changed the hierarchy of accessible objects. The new hierarchy would prefer to send a parent object that represents the application, but macOS needs the window to be in the hierarchy for VoiceOver to behave as expected. Tweak it so that we give the window as parent again, not the app. Change-Id: I5f7f59b07d0966c8bcf96968e4ed65eba9e05be6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Merge remote-tracking branch 'gerrit/dev' into HEADOswald Buddenhagen2017-02-015-31/+23
|\ \
| * | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-301-10/+2
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/network-chat/peermanager.cpp src/widgets/util/qsystemtrayicon.cpp src/widgets/util/qsystemtrayicon_qpa.cpp src/widgets/util/qsystemtrayicon_win.cpp src/widgets/util/qsystemtrayicon_x11.cpp Change-Id: I1c026df83818c0ccaf956980370e7522960627db
| | * Fix mouse extra button mapping on macOSAlexandru Croitor2017-01-241-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously extra mouse buttons apart from left, right and middle buttons, were mapped incorrectly with an offset of -1. This resulted in the first extra button being recognized as the middle button, the second extra button as the first extra button, etc. Fix consists in using a binary shift with proper offset to create the corresponding Qt::MouseButton value. [ChangeLog][macOS] Fixed extra mouse buttons to be mapped to correct Qt::MouseButton values. Change-Id: I9e6084586cd4737a172b7706a805211f0edff749 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * | Merge "Merge remote-tracking branch 'origin/5.8' into dev" into refs/staging/devLiang Qi2017-01-264-21/+21
| |\ \