summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoawindow.h
Commit message (Collapse)AuthorAgeFilesLines
* Cocoa: Add QCocoaWindowPointerGabriel de Dietrich2016-05-061-7/+32
| | | | | | | | | | | | | This patch extends 5b54c352edbc597ec5283bc9cfdd77906350161f by abstracting the watcher pattern. The class is specialized for QCocoaWindow since it's aware of the QObject sentinel there. We update the usage in QNSWindowHelper and extend it to the forward window (this one is used for mouse coordinate conversion when docking windows). Change-Id: I628415527593daec835bbad1b6e83d13fe7b6703 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* Cocoa integration - add a protection against dangling pointersTimur Pocheptsov2016-04-221-0/+6
| | | | | | | | Backport watcher-sentinel trick (QPointer->QObject) from dev. Task-number: QTBUG-42059 Change-Id: I9b2c7cde635c2ed9a3f667f216da62870d0b5ccb Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Clean up cancel operation handling on OS XTor Arne Vestbø2015-09-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* OS X adaptations to the high-DPI APIMorten Johan Sørvig2015-08-061-1/+1
| | | | | | | | | | | | Use QPlatformWindow::windowGeometry() and friends instead of the QWindow API, which now returns (possibly scaled) values in device-independent pixels. Rename QCocoaWindow::windowGeometry() -> nativeWindowGeometry() Change-Id: I70279145079c3df793059d16fed9aafba2d49a6d Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-07-011-26/+26
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qglobal.h src/corelib/global/qsysinfo.h src/corelib/global/qsystemdetection.h src/corelib/kernel/qobjectdefs.h src/plugins/plugins.pro tests/auto/widgets/itemviews/qlistview/qlistview.pro Change-Id: Ib55aa79d707c4c1453fb9d697f6cf92211ed665c
| * Add missing Q_DECL_OVERRIDE in Cocoa specific header filesGabriel de Dietrich2015-06-241-26/+26
| | | | | | | | | | | | Change-Id: I91831390e9e0d97ab28f0e34ca0573fb2c84e954 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add QCocoaWindowFunctions and add a function to find the clip offsetJorgen Lind2015-06-111-0/+3
| | | | | | | | | | | | Change-Id: I0f9cd1f923867f6f24b3bc54e442a16b5d2a11e4 Reviewed-by: Tim Blechmann <tim@klingt.org> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | Fix crash in tst_qfiledialog on OS XSimon Hausmann2015-06-041-0/+2
| | | | | | | | | | | | | | | | | | | | The test aggressively shows and hides dialogs and popups, and we would end up installing this global event monitor frequently. However we never cleaned up properly, for example if the window didn't get hidden properly or if the monitor was already installed for some reason. Change-Id: I6fa28eaeb03e089ced735912dbe29b0b8ad75d58 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-03-241-0/+1
|\| | | | | | | Change-Id: If5d2e621c2fa5476c3ab687a3f4620c54fc3b32e
| * Cocoa: Don't let key events triggering input method events close dialog.Christoph Schleifenbaum2015-03-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | Added a flag to QCocoaWindow to ignore shouldCloseWindow. This is set from within QNSView when escape is pressed and the current focus widgets is processing input method events (like QTextEdit). This lead to unwanted dialog rejects. Task-number: QTBUG-44076 Change-Id: Ic90a8a6ba8c5cddbc0d486563acad57dd384d179 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-03-161-1/+0
|\| | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/xcb/qxcbnativeinterface.cpp src/plugins/platforms/xcb/qxcbnativeinterface.h Change-Id: I31b38ba439b9341d51a01c0fd54bea33f7410076
| * Cocoa: Correct mouse event forwarding for popupsMorten Johan Sørvig2015-03-121-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to track the active popup globally, having parent windows track child popups is not sufficient since there may be one or more intermediate windows in between the event receiving window and popup window. Add API to QOCocoaIntegration for tracking the global popup window and use it instead of the per-window tracking. Make sure to only close popups on clicks outside the popup only. Add code to QNSView::handleMouseEvent that redirects mouse events to the active popup. Add manual test. Change-Id: Ia3e3fd42d8fddf5c69f0c6879b333ca544521f61 Task-number: QTBUG-43464 Task-number: QTBUG-31937 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* | Cocoa integration - do not report invalid coordinatesTimur Pocheptsov2015-03-061-0/+1
|/ | | | | | | | | | | | | setStyleMask with NSBorderlessWindow will call (indirectly) windowDidResize (window.delegate's method) and view's updateGeometry. At this point view.window can be nil (Cocoa is re-parenting the content view (?). If this is the case, do not set this updated geometry on a QWindow/platform window (since window is nil, self.window.frame is returned as {{0, 0} {0, 0}} by Cocoa). Found by tst_QWidget::setGeometry. Change-Id: Ic3cc0d944b5a8a5095c7fd0fdf2df7c9ea602b2a Reviewed-by: Morten Johan Sørvig <morten.sorvig@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>
* Cocoa: Guard against recursive event deliveryMorten Johan Sørvig2014-11-051-0/+1
| | | | | | | | | | | | Fix "Recursive repaint" crash. Add guard to QCococaWindow::setGeometry and QNSView updateGeometry to prevent processing window system events during setGeometry. Task-number: QTBUG-41449 Change-Id: I304fdf134d433cbc50fafd997ecd91e31cb57f4e Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-031-6/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/accessible/qaccessiblecache_mac.mm src/gui/accessible/qaccessiblecache_p.h src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/widgets/kernel/qwidget_qpa.cpp Manually moved change in qwidget_qpa.cpp to qwidget.cpp (cd07830e3b27da7e96a0a83f91ba08c168b45e62) Change-Id: Ia51f471f9b53de2f3b07d77ea89db9303ac8961d
| * Cocoa: Handle Qt::WA_ShowWithoutActivatingMorten Johan Sørvig2014-07-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Forward the flag to QWindow by setting the _q_showWithoutActivating property on the window in QWidgetPrivate::create_sys(). Implement by refusing to become the key window or first responder during QCocoaWindow::setVisible(). Task-number: QTBUG-19194 Change-Id: I8446927ec510d7226a5a7b51b7be49d2f9bfd098 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Cocoa: Handle Qt::WindowDoesNotAcceptFocusMorten Johan Sørvig2014-07-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Make windows with the Qt::WindowDoesNotAcceptFocus flag refuse to become the key window. This is in addition to the existing refusal to become the first responder in QNSView. Refactor the common test into a new function: bool shouldRefuseKeyWindowAndFirstResponder() Task-number: QTBUG-32385 Change-Id: I31021b5d8895a17c48f94f3691e6590c90b68627 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Cocoa: Fix Qt-in-namespace build.Tim Blechmann2014-07-021-6/+13
| | | | | | | | | | | | | | | | Wrap cocoa classes in namespace macros. Task-number: QTBUG-39382 Change-Id: Id840e666105afca21760fcb529b5765e0a534120 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | OS X: Fix build with QT_NO_OPENGLSergio Martins2014-06-301-0/+6
|/ | | | | | Task-number: QTBUG-31151 Change-Id: I7ed8117ae05ba0eebaf85731c7fdd2bb51d6ed04 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Cocoa: Send expose event on screen change.Morten Johan Sørvig2014-04-101-0/+1
| | | | | | | | | Required to repaint OpenGL content properly. Task-number: QTBUG-38105 Change-Id: Ie9441d56bd9d1a4eb399210369592f03e19c4929 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Mac: Implement unified toolbar look for QTabBarMorten Johan Sørvig2014-04-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Extend the unified title and toolbar gradient to tabs in document mode that are adjacent unified tool bars. Change the updateMacBorderMetrics() function to register the tab bar geometry and visibility status with the Cocoa platform plugin. The Cocoa platform plugin will then merge this area with other registered areas if possible. Add QCocoaNativeInterface::testContentBorderPosition(). This function tests whether the given point is within the unified title and toolbar area. Use testContentBorderPosition() in QMacStyle to enable code paths that skips drawing the QToolBar bottom separator line and paints the active tab background with transparent pixels to make the background gradient visible. Change-Id: I2b70f9bb0c2c59af053a691a7df538f958783dab Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Cocoa: Update unified toolbar area on toolbar hideMorten Johan Sørvig2014-04-091-2/+5
| | | | | | | | | | | | | | | | | | | | | Add setContentBorderAreaEnabled() which us used to enable or disable an area. Used together with registerContentBorderArea() this allows changing the border area geometry and enabled status independently. Add section to the QToolBar show/hide event handler which calls setContentBorderAreaEnabled(). Make sure QToolBar and QToolBarLayout uses the same identifier - the QToolBar object pointer. Rename enableContentBorderArea -> setContentBorderEnabled. The "ContentBorder" is now the entire unified toolbar area while "ContentBorderArea"s are the sub-areas covered by toolbars. Change-Id: I339f381a50856e048ae40e7ffadd6a8a510c4994 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* OSX: a window can be de-maximized by resizingShawn Rutledge2014-03-271-0/+1
| | | | | | | | After that, QWidget::isMaximized() should return false. Task-number: QTBUG-37703 Change-Id: Ic8b0de63ab007066cd277f511dfaa969404ff069 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* OSX: make reported window state consistent with realityShawn Rutledge2014-03-251-0/+1
| | | | | | | | | | | | | You can't always get what you want: if you exit from fullscreen mode via showNormal, it might actually be maximized; or if you exit via showMaximized, it might actually be normal, if that's the mode the NSWindow remembers. We can't set the state, we can only toggle it. But now at least it's predictable, so that if you call showNormal or showMaximized twice, you will definitely get back to that state. Task-number: QTBUG-35166 Change-Id: I7422960a64f624920566c25763f5c3b03a684fb5 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Cocoa: Fix geometry for embedded QWindows.Morten Johan Sørvig2014-03-201-0/+1
| | | | | | | | | | | | | | | | Report for correct geometry for QMacNativeWidget and other QWindows that are embedded in a NSView hierarchy. This also makes mapFrom/ToGlobal work. The implementation is different than for the other cases: Add a QCoocaWindow::geometry() overload and query the geometry there, instead of using a geometry change notification which sets the geometry on the QWindow. Task-number: QTBUG-36322 Change-Id: Iab5f0c96b89610c8a4b4a7de49887b0683d551dd Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Set unified toolbar height accurately.Morten Johan Sørvig2014-03-201-0/+12
| | | | | | | | | | | | | | | Add registerContentBorderArea() to the Cocoa native interface which allows registering multiple "unified toolbar" areas for each window. Use this function in QToolBarLayout::setGeometry() to register the area for each TopToolBarArea toolbar. Task-number: QTBUG-36700 Change-Id: I52efcc5662556bb94f25f504be3710d0491f79b9 Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Denis Dzyubenko <denis@ddenis.info>
* Cocoa: Disable the zoom button when appropriateMorten Johan Sørvig2014-03-151-0/+1
| | | | | | | | | | Disable the zoom (maximize) button for fixed-size windows and customized windows with the MaximizeButton flag not set. Task-number: QTBUG-37078 Change-Id: I6da88496474713de37b48aa65742203632ba99d6 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Cocoa: Fix crash when closing window from title barGabriel de Dietrich2014-03-141-0/+1
| | | | | | | | | | Some mouse event may result in the window being deleted so we need to take extra precaution when calling the super class' 'sendEvent:' method. Task-number: QTBUG-37287 Change-Id: Idf89ea177c78053bcdef52c54a197409e20bf38e Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Cocoa: Keep child NSWindow alive while it grabs the mouseGabriel de Dietrich2014-03-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise, Cocoa loses sight on which window to send the dragging mouse event. If the window is kept alive (but hidden) Cocoa will send the events to it, and we can forward them to the actual QWindow. This is the expected use-case: 1. Start dragging a QWindow and change its flags. 2. This triggers a call to QCocoaWindow::recreateWindow(), which will get rid of the old NSWindow and create a new one (the QNSView is moved to the new NSWindow). 3. When we stop dragging, the NSWindow is finally destroyed. QNSView Pointer References Remarks: In QNSView, m_window points to the QWindow which remains unchanged until deleted. Similarly m_platformWindow remains valid until deleted, in which case we delete the QNSView, the NSWindow and its helper (see QCocoaWindow destructor). This fixes undocking QToolBars when they are a child NSWindow. Task-number: QTBUG-33082 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Change-Id: I6fc53292cd96586cfdf401481c5442d759f1fae5 Reviewed-by: Liang Qi <liang.qi@digia.com>
* Cocoa: Use helper class for event handling in native windowsGabriel de Dietrich2014-03-041-11/+39
| | | | | | | | | | | | | | | | | | | | | | | | | QNSWindow and QNSPanel duplicate some code when it comes to event handling, which can be refactored. Also, it's currently not possible to keep an NSWindow derived instance temporarily alive as QCocoaWindow is not designed to keep track of more than one NSWindow. Finally, we can reduce the size of (and eventually remove) the QCocoaWindowCategory which polutes the NSWindow namespace. We move QNSWindow and QNSPanel specific API into QNSWindowProtocol, and define QCocoaNSWindow as NSWindow extended by that protocol. This gives us a type we can refer to any of the native windows QCocoaWindow instanciates. We introduce QNSWindowHelper which gathers the common code between QNSWindow and QNSPanel. This is a one-to-one mapping that keeps a weak (non-retaining) reference to the NSWindow and a weak reference to the QCocoaWindow. It has the same life span as its associated NSWindow. Task-number: QTBUG-33082 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Change-Id: I38d001bf13f64a1ba4f1439291c5103c3f755183 Reviewed-by: Liang Qi <liang.qi@digia.com>
* Cocoa: Bring back two-class native window systemGabriel de Dietrich2014-02-121-21/+32
| | | | | | | | | | | | | | While inheriting from NSPanel proved to be robust enough, it is not really future proof as we're at the mercy of Apple changing NSPanel's behavior. On the other hand, we can't inherit exclu- sively from NSWindow as the tool window case, where the QWindow should look like an NSPanel, can't be emulated perfectly without using private APIs. This reverts commits 79fb39a87ce5ffbda and df86721bb4028ae. Change-Id: I9021193e3614633a943578df9e2794b00094a1f7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2014-02-111-1/+0
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-02-071-1/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformintegration.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/android/qandroidplatformopenglcontext.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/sql/doc/src/sql-driver.qdoc src/widgets/widgets/qtoolbararealayout.cpp Change-Id: Ifd7e58760c3cb6bd8a7d1dd32ef83b7ec190d41e
| | * Cocoa: Popups should not become keyGabriel de Dietrich2014-01-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... at least not like that. We still need to find a way for the popup to receive and process key events on its own, instead of depending on other layers inside Qt. This would make Qt Quick control's PopupWindow implementation much simpler, for example. Revert "Cocoa: Allow popups to grab mouse and keyboard" This reverts commit a25e6528d3806d3b5fd87c5a1cacd6c748215db1. Task-number: QTBUG-35820 Task-number: QTBUG-35904 Change-Id: Ica10529308ab25938397c16b9c1e1ce6cbd8f247 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | | Cocoa: Add setNSToolbar(QWindow *, NSToolBar *)Morten Johan Sørvig2014-02-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling this function associates the given native toolbar with the QWindow. QWindow will then set it on the native NSWindow at the appropriate time during window creation. Change-Id: I2a50f79b2a0453cc739f8d68e965e37b95998083 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | | Cocoa: Simplify native view access.Morten Johan Sørvig2014-02-081-0/+2
|/ / | | | | | | | | | | | | | | Use NSWindow and NSView accessors on QCocoaWindow instead of QGuiApplication and nativeResourceForWindow. Change-Id: Iabee1e42dd119726d932f89c66a90810463d70db Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | Cocoa: Allow frameless NSWindow child QWindowsGabriel de Dietrich2014-02-051-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Showing, moving and resizing Contrarily to what an NSWindow does to its NSViews, child NSWindows need to be explicitly shown and hidden, and clipped if the parent NSWindow changes geometry. Also, hiding an NSWindow will not hide its child windows. This needed to be managed manually, adding 2 additional states to QCocoaWindow to reflect whether a child window has been clipped out by any ancestor geometry change, or hidden by any ancestor being hid. Also, ordering out an NSWindow will remove it fromm its parent's child windows array, making necessary to maintain a parallel list of child windows in QCocoaWindow. Stack order Although child NSWindows can be ordered relatively to each other, they need to be added again to be moved lower in the window stack. This also means the windows above it need to be added on top. Key (focus) status One of the remaining issues, is to make sure the top level window keeps the "key status" while still forwarding key events to the child window. Keeping same event propagation This use case is best illustrated with undocking QDockWidgets (if these are child NSWindows). The main issue is to make sure the QDockArea will get the mouse events right after undocking a dock widget. We used a similar workaround as the "key status" problem, and manually forward the mouse events to the dock area's QWindow. Manual test, by Morten Johan Sørvig, included. Task-number: QTBUG-33082 Task-number: QTBUG-22815 Change-Id: I50e34936fb82bff013e99f4bcb3bd0db0704c6ae Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | Cocoa: Merge QNSWindow and QNSPanel, inherit NSPanelGabriel de Dietrich2014-01-311-23/+24
| | | | | | | | | | | | | | | | | | | | | | Since we will later have frameless NSWindow child QWindows, it makes sense to be able to keep and reuse the instantiated NSWindows in cases like QDockWidgets. If we keep these 2 different classes, it becomes impossible to morph one into the other. Task-number: QTBUG-33082 Change-Id: I351c628b887101b1cfd67689afbf689f119554de Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-201-0/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qstring.cpp src/gui/image/image.pri src/gui/image/qimage.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/eglfs/qeglfshooks_stub.cpp tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp Change-Id: I3b9ba029c8f2263b011f204fdf68c3231c6d4ce5
| * Cocoa: Add setContentBorderThickness().Morten Johan Sørvig2014-01-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add setContentBorderThickness() to the Cocoa platform plugin. This functions requests that the platform plugin draws a gradient in the unified title and toolbar area and/or the status bar area. The background gradient is drawn before and under the Qt backing store content. It is expected that parts of the backing store will be filled with transparent pixels to allow the gradient to be visible. To facilitate this the backing store image is created with an alpha channel. Task-number: QTBUG-34411 Change-Id: Iadc5e64ee9b9b42e92fb84a615817fdffd7a8802 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | OSX: support fake fullscreen and etcLiang Qi2014-01-031-0/+5
|/ | | | | | | | | | | | * Fix QCocoaWindow::setGeometry() to respect WindowFrameInclusive * Support fake fullscreen on 10.6 or WindowFullscreenButtonHint was not set on 10.7 and later * Fix tst_qwindow on 10.6 and later Task-number: QTBUG-23059 Task-number: QTBUG-34629 Change-Id: I6e032ca55b45674388b00506a424d3bd7ece429f Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Improve expose event handling.Morten Johan Sørvig2013-12-041-0/+4
| | | | | | | | | | | | | | | | | | Prevent the cocoa platform plugin from sending expose events for windows that are off-screen or has invalid geometry. Differentiate between initial exposes and geometry update exposes, in order that e.g. geometry updates that happen before setVisible() don't trigger expose events. After the initial expose geometry updates to and from invalid geometry will trigger obscure and expose events. Task-number: QTBUG-35143 Task-number: QTBUG-35091 Change-Id: Ibbff20c69974f098ea7635e9ca38620597840a05 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Cocoa: Improve cursor setting.Morten Johan Sørvig2013-11-011-1/+5
| | | | | | | | | | | | | | | | Implement cursor setting in terms of [NSCursor set] and [NSView cursorUpdate] using the window tracking area. Refactor cursor conversion into QCocoaCursor:: convertCursor. Rename QCoocaWindow::m_underMouseWindow to m_enterLeaveTargetWindow since it's set according to spesific enter/leave logic. Add m_windowUnderMouse which tracks mouseEntered/mouseExited state. Task-number: QTBUG-33961 Change-Id: Id5e12594f5db365e09c9926a4c08d748a9afb935 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Cocoa: Allow popups to grab mouse and keyboardGabriel de Dietrich2013-10-181-0/+1
| | | | | | | | | According to the QWindow documentation this should happen regardless of the window type. (It also mimics the current behavior on Linux and Windows). Change-Id: I1b0959ad8cf19bce452fd79a13b07d0a3a3c49e9 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Ensure that context menus show even if the window is not active on MacAndy Shaw2013-10-161-0/+1
| | | | | | | | | | | When using the mouse to show a context menu on Mac then even if the window is not active then it will show the menu for native applications. So this ensures that this is respected for context menus in Qt too. Task-number: QTBUG-31497 Change-Id: Ibfcb4b893b0e31d4ce36926a83c9214d130d8fa2 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Cocoa: Use internal style mask to disable resizing popup parentsGabriel de Dietrich2013-09-241-0/+1
| | | | | | | | | Using QCocoaWindow::windowStyleMask() resets some private flags Cocoa sets when showing sheets. Task-number: QTBUG-33126 Change-Id: I34f0713f98e81e7010b0b7620ee24ea30f04dcff Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-06-201-0/+2
|\ | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp tools/configure/configureapp.cpp Change-Id: I3092bd3276af14304b7ab3ae1e1cc05d11cdede0
| * Cocoa: Make sure we update internal window fullscreen stateGabriel de Dietrich2013-06-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | We update the internal/synched state by assigning it its QWindow's state. Since that one is not a flag, it can only be in one state at a time, meaning that we may lose the maximized state (but we've been losing it for some time). Task-number: QTBUG-30139 Change-Id: Idf30713c6ae912cafe3bbdd7be18214cf4de34f7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>