summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qnsview.h
Commit message (Collapse)AuthorAgeFilesLines
* macOS: Handle update requests via setNeedsDisplay more carefullyTor Arne Vestbø2018-02-011-0/+3
| | | | | | | | | | | | | | | | | Instead of trying to detect situations where we need to send a real expose event instead of an update request in response to a drawRect call, we keep track of when we've asked the view to display due to a requestUpdate call, and only deliver the corresponding drawRect as an update request if no other code has asked the view to display. This should cover all cases of asking the view to display, issued from our code or from AppKit, such as the view changing its backing scale factor, or otherwise needing a real expose event. Task-number: QTBUG-65663 Change-Id: I1783787823aee889dad8e48f34a1cb0f1b7b06bd Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-061-0/+2
|\ | | | | | | | | | | | | | | | | | | Conflicts: examples/opengl/qopenglwidget/main.cpp src/3rdparty/pcre2/src/pcre2_printint.c src/plugins/platforms/cocoa/qnsview.mm src/widgets/widgets/qcombobox.cpp Change-Id: I37ced9da1e8056f95851568bcc52cd5dc34f56af
| * macOS: Reset composition when focus object changes inside windowEskil Abrahamsen Blomfeldt2017-09-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the focus object inside a window changes and we are currently composing text, we have to cancel composition to avoid getting into an inconsistent state. This is what already happens if you switch to a different top level window. Note: Because we limit the user's ability to change focus inside a window when composing text, this would only happen under certain circumstances, such as creating a new MDI window with an editor while still composing text in a previous one. [ChangeLog][macOS] Switching focus objects inside a top level window while composing text using dead keys or input method events would leave the application in an inconsistent state. The composition now automatically cancels when the focus object changes. Task-number: QTBUG-59222 Change-Id: I06792a7db1441dcc5c87e4bf0861b422a25f7f7c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge dev into 5.10Frederik Gladhorn2017-09-021-0/+2
|\ \ | | | | | | | | | Change-Id: I5fb5e7e6e57bb5db6fcb1f670f7f6cbc8def2d60
| * | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-311-0/+2
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Fix compile when using QT_NO_TABLETEVENTAndy Shaw2017-08-251-0/+2
| | | | | | | | | | | | | | | Change-Id: I76f08d747009a5bf2c0e8004c3443e16e83b6a7d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | macOS: Respect responder chain when setting cursorTor Arne Vestbø2017-09-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no need for us to walk our own ancestor chain to figure out which cursor to set. AppKit will automatically call cursorUpdate: on the view that would be the hitTest target of the current mouse position, and by falling back to super when no cursor is set for the current view, we automatically get the behavior that effectiveWindowCursor tried to solve. In addition, it solves the case of applyEffectiveWindowCursor applying the arrowCursor when no cursor was set, which would mean that if any native parent view of our view _did_ have a cursor set, we would not fall back to the native view's cursor, but instead override it with the arrow cursor. Following the responder chain gives the correct behavior in this case. Unfortunately, due to rdar://34183708, if a subview of one of our views uses the legacy cursorRect approach to cursor management, the cursor will not be reset back to our cursor via cursorUpdate: when leaving the child and entering the parent view (our view). Moving our implementation over to the legacy API would solve this problem, but just propagate it to native parent views of our views, which could potentially use NSTrackingAreas, and would not have _their_ cursors re-set. Change-Id: Id20cc03136f0b1d4b9120750fe63ddc455363aaf Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | macOS: Modernize masking of windowsTor Arne Vestbø2017-09-011-7/+0
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of masking window blitting via a CGImage mask, we use the window's mask directly to intersect the region that we blit during flushing of the QCocoaBackingStore. This approach also enables masking of child windows. We now also support setting a mask for layer-backed views, by setting a CAShapeLayer as the layer's mask. The window shadow invalidation has been moved out of QNSView, as the view should not be involved in that process. For layer-backed views, the shadow is not invalidated as expected after the initial mask has been set, but this bug has been left as a fix for a later stage as it requires more research. Change-Id: Ie0127d8df49d95b2d6144816b19559f3d3c95d13 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | macOS: Modernize QCocoaBackingStore::flush()Tor Arne Vestbø2017-07-291-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 at drawRect and trigger updates via setNeedsDisplayTor Arne Vestbø2017-07-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | 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: Move geometry reporting from QNSView to QCocoaWindowTor Arne Vestbø2017-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* | macOS: Ctrl LMB override can be set on a per window basisMartin Porcelli2017-05-191-0/+1
|/ | | | | | | | | QNSView instances check the _q_platform_MacDontOverrideCtrlLMB window property along with the QT_MAC_DONT_OVERRIDE_CTRL_LMB environment variable during creation. Change-Id: Id6457fccdce2dff1fa83448dd2bc4d2757a87e9d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Cocoa: Send correct mouse buttons for tabletsMorten Johan Sørvig2017-04-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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: Remove workaround for default-sized NSViewsTor Arne Vestbø2017-03-281-1/+0
| | | | | | | | | | | | | | | | | 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>
* QCocoaWindow: fix geometry issue when only minimumSize is setOleg Yadrov2017-03-181-0/+1
| | | | | | | | | | | | | 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>
* macOS: Rewrite window state handlingTor Arne Vestbø2017-02-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Handle window state changes directly in QCocoaWindowTor Arne Vestbø2017-02-111-1/+0
| | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-11-171-1/+0
|\ | | | | | | | | | | | | | | Conflicts: mkspecs/features/mac/default_post.prf mkspecs/features/uikit/default_post.prf Change-Id: I2a6f783451f2ac9eb4c1a050f605435d2dacf218
| * Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-161-1/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+0
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/plugins/platforms/eglfs/qeglfsintegration.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp Change-Id: Id2da7c775439adb62646d5b741ee7c638042b34b
| | | * Cocoa: Make child window cursors work correctlyMorten Johan Sørvig2016-11-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing cursor logic had a couple of issues: - It made the faulty assumption that we could not use the NSWindow invalidateCursorRectsForView API for child NSViews. - It used NSWindow invalidateCursorRectsForView and NSView resetCursorRects. This API has been replaced by the more general NSTrackingArea API. - It did not implement falling back to the parent window cursor if the current window has no cursor set. Document that QWindow cursors work the same way as QWidget cursors in that a QWindow with no set cursor will fall back to the parent window cursor. Change the cocoa platform code to use NSTrackingArea exclusively and implement NSView cursorUpdate which sets the cursor. Handle immediate change on QWindow:: setCursor() manually. Add QWindow::effectiveWindowCursor() and applyEffectiveWindowCursor() which finds the correct window cursor. Add a manual test for the child window, child widget, and QWidget::createWindowChild cases. Task-number: QTBUG-33479 Task-number: QTBUG-52023 Change-Id: I0370e11bbadb2da95e8632e61be6228ec2cd5e9d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | | * OSX: mark mouse events from tablet devices as synthesizedShawn Rutledge2016-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is equivalent to d7db6c6c1944894737babf3958d0cff1e6222a22 on the xcb platform. Task-number: QTBUG-51617 Change-Id: I837a764c8382244307ba6aa02bd8bde12bd08bff Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | | macOS: Handle NSViewGlobalFrameDidChangeNotification via QCocoaWindowTor Arne Vestbø2016-10-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The notification is only posted for NSViews with attached surfaces, meaning NSOpenGLContext, so there's no need to guard the subscription within [QNSView setQCocoaGLContext:]. Change-Id: I8179e58c84925a756315b711d15fa9c356adaecf Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | | | macOS: Decouple NSWindow notifications and delegate callbacks from QNSViewTor Arne Vestbø2016-10-271-1/+5
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic for handling NSWindow events was split partly between QNSView observing notifications, and QNSWindowDelegate implementing direct delegate callbacks. The logic of how to handle the events was then split further by sometimes handling the event in the delegate callback or notification handler, and sometimes forwarding the event to QCocoaWindow. We now handle most events via notifications, and propagate these directly to QCocoaWindow, so that all the logic is in one place. This improves the situation for foreign windows, since we're not relying on having a QNSView, or being able to inject our QNSWindowDelegate. To keep code duplication to a minimum and risking missing a notification in the forwarding logic, the logic is based on QMetatType and QMetaMethod tags, so that the notifications are declared in the header file, along with the handler function. Change-Id: I2fb6372010048a8a1f6e4426b988a3f6f5abdbab Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | macOS: Remove QNSView member m_window in favor of going via m_platformWindowTor Arne Vestbø2016-10-131-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The two should never be out of sync, but by having them as separate members we risk that they do. By going though m_platformWindow for QWindow access, it's also more clear in the callsites that we're dealing with a QWindow instead of a NSWindow, as referenced though self.window. Finally, removing the member slims down memory use of a QNSView, however small. Change-Id: Iec96cebf813fae82d3af339331781419f234c28b Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | macOS: Use QPointer to track QNSView -> QCocoaWindowTor Arne Vestbø2016-10-131-2/+1
| | | | | | | | | | | | | | | Change-Id: I4de581dda03d25e781112eff34de28dfd1797a7f Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | Cocoa: Add drawBackingStoreUsingCoreGraphicsMorten Johan Sørvig2016-09-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drawRect is a general “repaint now” function, which we should handle also for OpenGL content. Make that clearer by moving the implementation details of drawing the raster backing store using CoreGraphics to a separate function. Behavior change: Call invalidateWindowShadowIfNeeded also for the OpenGL case. Change-Id: I158ebef548e063f826db2dc708c14ab1d784b095 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | | Remove all code paths related to unsupported Apple platforms.Jake Petroules2016-06-041-1/+0
|/ / | | | | | | | | | | | | | | | | Now that the minimum deployment target (and thus SDK) is 10.9 for OS X and 7.0 for iOS, all code paths affecting platform versions lower than the aforementioned are removed. Change-Id: Id985c7259c4ac069319d88f2c29c9559ae9e8641 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | OSX: remove tablet->mouse event synthShawn Rutledge2016-04-251-1/+1
| | | | | | | | | | | | | | | | | | The synthesis of mouse events for unhandled tablet events is now in cross-platform code, so the platform plugins don't need to do it. Task-number: QTBUG-47007 Change-Id: I948be398e4b1ab627a8dc97ca20c08dba4390238 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | Cocoa: Forward masked out mouse events.Morten Johan Sørvig2016-03-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Forward mouse events hitting the a masked out window area to the next responder by calling the superclass event handler. Implement "inverse mouse grabbing": Qt will not take dragged and up events if the mouseDown was in a masked out area. Change-Id: Ie86281245513cad515b77a468ac63f31ae41bfe0 Task-number: QTBUG-41839 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* | Cocoa: Forward rejected key events.Morten Johan Sørvig2016-03-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Forward rejected key events to the next responder by checking the return value from QWindowSystemInterface and calling the superclass event handler. This is useful when Qt is running as a plugin in a host application; the host can now react to key events even if Qt has focus. Qt will often not accept keyUp events, even if the corresponding keyDown was accepted, for example in the case of text controls. We don't want to forward 'bare' keyUps, so keep track of which keyDowns have been seen. Change-Id: I976448a5d305a657a0e91aeb271b158f8b598286 Task-number: QTBUG-45768 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* | Cocoa: Unify mouse handling logicMorten Johan Sørvig2016-03-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce the code duplication for the various button type handlers. Fan in: (example) rightMouseDown handleMouseDownEvent handleMouseEvent The primary mouseDown function is still separate with some duplicated logic. Remove the "invalid button tracking" warning. qWarnings are for application developers in case of improper use of API etc, not internal Qt errors. Change-Id: Idb1a311e37446399668c2a207831fccc84716ca1 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>
* | Merge remote-tracking branch 'origin/5.6' into devSimon Hausmann2015-11-271-0/+1
|\| | | | | | | Change-Id: Ib43c6f126998eefcfed9a7c1f2bcbac8b4dd05ec
| * QPI/Cocoa: QNSView - guard removeFromSuperview by autorelease poolTim Blechmann2015-11-231-0/+1
| | | | | | | | | | | | | | | | | | | | removeFromSuperview could be called from outside the Qt domain (e.g from a native cocoa gui). we need to guard it by an autorelease pool to make sure that potential release/dealloc methods are not postponed to a point when we do not have a qapplication anymore Change-Id: If65cce4c524a16ffee125694c534f900c7d08fa8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-11-181-0/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess.cpp src/corelib/io/qprocess_unix.cpp src/network/kernel/qnetworkinterface_winrt.cpp tools/configure/configureapp.cpp Change-Id: I47df00a01597d2e63b334b492b3b4221b29f58ea
| * Cocoa integration - do not send move events while in -draggingUpdated:Timur Pocheptsov2015-11-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | Looks like it's not a good idea to send constant 'fake' mouse move events while mouse is actually moving (mouseDragged/rightMouseDragged) + we're receiving -dragginUpdated:. Change-Id: Ibed5def3d8f06b764dea6c2cd196e37ca19ce967 Task-number: QTBUG-49204 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> Reviewed-by: Filipe Azevedo <filipe.azevedo@kdab.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-11-041-0/+2
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/ptrsize.test configure src/corelib/global/qnamespace.h src/network/socket/qabstractsocket.cpp tests/auto/other/networkselftest/networkselftest.pro Change-Id: Ic78abb4a34f9068567cea876861d4220f5a07672
| * Cocoa: Implement QPlatformInputContext::locale().Liang Qi2015-10-241-0/+1
| | | | | | | | | | | | | | | | Listen to NSTextInputContextKeyboardSelectionDidChangeNotification. Task-number: QTBUG-48772 Change-Id: Icea4ef61fd184edbe65a7f195318832a22c312ab Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
| * QWidgetAction: Don't deactivate the current window on MacGabriel de Dietrich2015-10-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We check the name of the window class the widget's QNSView changes window and set a flag when the that window is a native Cocoa menu window. Later, only those views not inside a native menu can become first responder, ensuring Qt won't deactivate the main window. We're allowed to reject becoming the first responder mainly because Cocoa itself doesn't support sending key event to menu views and, therefore, it doesn't change what's already possible. This patch also sets the widget action visible, which needs to be done right after reparenting it to the container widget. Besides that, it also contains a few small code cleaning changes related to Cocoa's support of QWidgetAction. Change-Id: Ia2170bdc5e1f40bfa2f1091c05e9e99397c47187 Task-number: QTBUG-44015 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-10-141-1/+1
|\| | | | | | | | | | | | | | | | | Conflicts: tests/auto/corelib/io/qfile/tst_qfile.cpp tests/auto/corelib/io/qprocess/tst_qprocess.cpp tests/auto/corelib/tools/qversionnumber/qversionnumber.pro Change-Id: Ia93ce500349d96a2fbf0b4a37b73f088cc505c6e
| * Clean up cancel operation handling on OS XTor Arne Vestbø2015-09-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic for handling cancel operations was spread out through the code base and sometimes hard-coded to only include the Escape key shortcut, missing the Command+. shortcut. We now intercept both attempts at cancel operations from the system through cancelOperation, which we forward as normal key events. A new QKeySequence::StandardKey has been added for the Cancel sequence, which maps to Escape on all platforms, and Command+. in addition for OS X. The hard-coded logic in QWidget and subclasses for dealing with closing the dialogs has been replaced with this key sequence, which allows clients to override the behavior. Note that the widget code is not wrapped in checks for QT_NO_SHORTCUT, as we don't care about keeping widgets building and working under that define. The logic in QCocoaWindow to bypass windowShouldClose when delivering IM events has been removed as we now handle that specific case by also forwarding Escape as a cancel operation. Task-number: QTBUG-47557 Task-number: QTBUG-45771 Task-number: QTBUG-44076 Change-Id: Ibe0b3a4819f8659d246a2142dd7d9cd3a826ef78 Reviewed-by: Tim Blechmann <tim@klingt.org> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-09-251-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/io.pri src/corelib/io/qdatastream.cpp src/corelib/io/qdatastream.h src/network/socket/qabstractsocket.cpp src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h src/widgets/styles/qgtkstyle.cpp tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/qmimedatabase-cache.pro tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-xml/qmimedatabase-xml.pro tests/auto/dbus/qdbusconnection/qdbusconnection.pro tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp Change-Id: I347549a024eb5bfa986699e0a11f96cc55c797a7
| * Cocoa: Fix backing store performance regression.Morten Johan Sørvig2015-08-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 916dfcb8 introduced a regression where QNSView would hold a copy if the backing store QImage, which would cause a detach and deep copy if/when the image was painted on while the copy was held. Revert back to the previous share-by-pointer scheme. Make sure the following bugs stays fixed: QTBUG-38377 QTBUG-42206 QTBUG-44313 Change-Id: Ib8049051d51947113f23b66ee61dc34c22388914 Task-number: QTBUG-46959 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@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>
* cocoa: QNSView - guard implementation against deleted windowTim Blechmann2015-06-241-1/+1
| | | | | | | | | | | when embedding a QWindow into a native cocoa gui there are cases that the QWindow is destroyed while the QNSView is still available. this patch makes sure that the m_window pointer is cleared when the QWindow is destroyed and adds checks to the implementation to avoid that m_window is called when it has already been destroyed. Change-Id: I7e0614969dedb87b54df74d542a8c1fb15d8acf0 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* OS X: Do not re-create tracking areas over and over againEike Ziller2015-04-161-0/+1
| | | | | | | | | | | | | NSTrackingInVisibleRect already makes sure that the tracking area updates itself, so we only need to add our tracking area if it is missing. For some reason this also fixes that Qt mouse tracking was broken after showing e.g. an embedded native WebView. Task-number: QTBUG-21944 Change-Id: I8013517f474f18e44b1ddd411defe1b6e60f05bf Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Fix crash-on-exit when embedding QNViewMorten Johan Sørvig2015-02-121-0/+1
| | | | | | | | | | | | The QWindow and QCocoaWindow may be deleted before the QNSView (which Cocoa keeps a reference to). Clear pointers to the Qt windows on QCocoaWindow destruction and add null-pointer check to QNView::isOpaque. Change-Id: I71764886c27bf1d14fb4e684c15e7c72e1c0a17c Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | 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>