summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-02-102-1/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro src/gui/image/qimage_conversions.cpp src/gui/opengl/qopenglextensions_p.h src/gui/text/qtextengine.cpp src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/eglfs/qeglfshooks_stub.cpp src/plugins/platforms/eglfs/qeglfsscreen.cpp src/plugins/platforms/eglfs/qeglfswindow.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp src/plugins/platforms/windows/qwindowsnativeinterface.cpp src/plugins/platforms/windows/qwindowsscreen.cpp src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/windows/qwindowswindow.h src/plugins/platforms/xcb/qxcbdrag.h src/widgets/itemviews/qabstractitemview.cpp src/widgets/kernel/qwidget.cpp src/widgets/util/qsystemtrayicon_p.h tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp Thanks to Friedemann Kleint for resolving the qwindowsfontdatabase.cpp conflicts. Change-Id: I937232c30523d5121c195d947d92aec6f129b03e
| * Cocoa: Don't crash on no target window.Morten Johan Sørvig2015-02-031-0/+8
| | | | | | | | | | | | | | | | | | | | | | findEventTargetWindow() will return 0 if m_window is a top-level window with Qt::WindowTransparentForInput set. Change-Id: I413dabf2a8993b0522653c4e586bb304b642f3ed Task-number: QTBUG-44013 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
| * Cocoa: Keep menu invisible when adding it to a menubarDaiwei Li2015-02-031-1/+3
| | | | | | | | | | | | | | | | | | | | | | In MenuBar.qml, it's possible for __isNative to be set after visible on a child QQuickMenu. In that case, the qcocoamenu.mm will have set submenu to nil, only to be overridden in insertNativeMenu when __isNative is set. Change-Id: Id3c6bca03f937528d05b166cbd6a6d1011db43e8 Task-number: QTBUG-44168 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | Cocoa plugin - showMaximized/showMinimized and Qt::FramelessWindowHintTimur Pocheptsov2015-02-041-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Qt::FramelessWindowHint imlplies NSBorderlessWindowMask, but should _not_ exclude NSResizableWindowMask - we still have API (showMaximized) to resize this window. Without NSResizableWindowMask showMaximized (calling NSWindow's '-zoom' under the hood) has no effect. 2. -performMiniaturize does not work with a borderless window, since such a window does not have a minimize button - use miniaturize for such window instead. Change-Id: I691182ad7c1d230e670bfb70ef758483acbf0792 Task-number: QTBUG-44195 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | Cocoa plugin - fix obscured/mapped/unmapped logicTimur Pocheptsov2015-02-032-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | NSWindow setStyleMask can call viewDidMoveToWindow, while setting the mask, view can have window == nil and we call 'obscure' on this view's platform window/QWindow == 'unmapping' it. As a result, it can happen that a child view (for example, QGLWidget's view) never gets mapped back. This patch tries to limit this special obscure/expose logic by the exact views it was introduced for (c7bd85e97df1b188bcbd4a2a511313d221c5bb83, QTBUG-19840). Change-Id: I4cc7a6b1bd3e34741ad50c2e0d2a2add242b28e4 Task-number: QTBUG-41701 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | OS X: Fix QWindowSystemInterface::handleExtendedKeyEventFrederik Gladhorn2015-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | In d7ca800a87a2291c94c6580f0cfe068bb2280caf another parameter was introduced to unify ShortcutOverride. The call to it in qnsview.mm accidentally passed false as last parameter which would go to count instead of tryShortcutOverride. The patch wasn't released yet, so this regression doesn't need a change log entry. Thanks to Felipe Seoane for spotting this! Change-Id: Ide2211806caf742d649e0d5dadcc47fd032d2cdf Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-01-212-5/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/global.pri src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.h src/corelib/tools/qdatetime.cpp src/plugins/platforms/xcb/qxcbscreen.h src/plugins/platforms/xcb/qxcbwindow.h src/widgets/dialogs/qcolordialog.cpp src/widgets/dialogs/qcolordialog_p.h tools/configure/configureapp.cpp Change-Id: Ie9d6e9df13e570da0a90a67745a0d05f46c532af
| * Fix namespacing of QNSViewMouseMoveHelperFrederik Gladhorn2015-01-162-5/+5
| | | | | | | | | | | | Task-number: QTBUG-43061 Change-Id: Ied8cdf49c34ef155b0f0bbc7e547b7c01bcd1d11 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* | Add QWheelEvent::sourceShawn Rutledge2015-01-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | This is analogous to 0a92295ca829a62125c9f122fd3daec991993855 which added QMouseEvent::source. For now, we say that a wheel event is synthetic when it comes from a trackpad or other device that provides scrolling by some means other than an actual wheel. Change-Id: I0452ca2080b551b18b9c2f6e42db925d14ae339e Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-12-292-14/+6
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/kernel/qplatformsystemtrayicon.cpp src/gui/kernel/qplatformsystemtrayicon.h src/plugins/platforms/xcb/xcb-plugin.pro Change-Id: I00355d3908b678af8a61c38f9e814a63df808c79
| * Revert "OS X: rename special menu items instead of duplicating"Timur Pocheptsov2014-12-222-14/+6
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8c538d10da618add00aba1acbc8d8dc2f24445b4. This patch, unfortunately, do not combine well with another problematic code producing, as a result, a serious regression. While the proper/better fix in Cocoa menu not found, I'm reverting this patch. Change-Id: I1ff03dbe12805da447cb3cfe3e2f231528bf1a16 Task-number: QTBUG-43471 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* | Add a function for QPA plugins to explicitly destroy QScreensGiulio Camuffo2014-12-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously QPlatformScreen was automatically deleting its QScreen in ~QPlatformScreen(). That means that we cannot use QScreen's methods when the screen is being removed, because doing so would call virtual methods of QPlatformScreen. By that point the QPlatformScreen subclass object does not exist anymore, and we call the default implementation instead of the subclassed one, or get a crash for the pure virtual methods. This happens for example when removing a screen which contains a QWindow with some QML item using QQuickScreenAttached. This patch adds a QPlatformIntegration::destroyScreen() function, which deletes the QScreen and later the QPlatformScreen. ~QPlatformScreen will still delete the QScreen if it was not deleted with destroyScreen(), so code not ported to the new approach will continue to work as before, with only a warning added. Task-number: QTBUG-41141 Change-Id: Ie4a03dee08ceb4c3e94a81875411f6f723273fe1 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-101-1/+5
|\| | | | | | | | | | | | | | | Conflicts: doc/global/template/style/online.css mkspecs/android-g++/qmake.conf Change-Id: Ib39ea7bd42f5ae12e82a3bc59a66787a16bdfc61
| * qt_mac_loadMenuNib: Prevent stale NIB files by diffing file sizeTor Arne Vestbø2014-12-051-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we're changing the contents of the nib files in Qt, we need to overwrite the nib files that we write to /tmp, as QFile::copy() does not overwrite files. This also catches the case where the files in /tmp are empty due to a possible broken qrc-run, where re-runs of qrc to fix the resources would still leave the corrupt nib in /tmp, resulting in: -[NSKeyedUnarchiver initForReadingWithData:]: data is empty; did you forget to send -finishEncoding to the NSKeyedArchiver? And as a consequence: qt_mac_loadMenuNib: could not instantiate nib ASSERT: "mainMenu" in file qcocoamenuloader.mm, line 154 Change-Id: I2907a32d1a56c23a27343c81839a06b65a529372 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | Harmonize QPA TrayIcon showMessage parameter orderShawn Rutledge2014-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | Parameters were misnamed in some places but still managed to pass them through in the right order. Rename to avoid confusion, and keep the parameter order the same as in QSystemTrayIcon::showMessage. Change-Id: Ib4c8fff15eff15034c4ea64757803b118e487144 Reviewed-by: Marco Martin <mart@kde.org> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Use the new warning enabling/disabling macros in qtbaseThiago Macieira2014-12-031-3/+3
| | | | | | | | | | | | Change-Id: I91ff06644e8047c2ca483f9768b46c1372eb6171 Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | OS X: remove use of Carbon API for scroll events; fix ScrollBeginShawn Rutledge2014-11-272-12/+14
| | | | | | | | | | | | | | | | NSEventPhaseMayBegin doesn't happen with some types of trackpads, so don't treat NSEventPhaseBegan as Qt::ScrollUpdate. Change-Id: Ica97d49692a904e20c8eb0250760e6370311ee40 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-2416-506/+279
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qiodevice.cpp src/plugins/bearer/linux_common/qofonoservice_linux.cpp src/plugins/bearer/linux_common/qofonoservice_linux_p.h src/plugins/platforms/android/qandroidplatformtheme.cpp src/tools/bootstrap/bootstrap.pro src/widgets/styles/qmacstyle_mac.mm Change-Id: Ia02aab6c4598ce74e9c30bb4666d5e2ef000f99b
| * Merge remote-tracking branch 'origin/5.4.0' into 5.4Frederik Gladhorn2014-11-212-7/+12
| |\ | | | | | | | | | Change-Id: I95f235a66ce2e9b1fa435c0f911c6f7e811755f0
| | * Make it possible to disable font embeddingEskil Abrahamsen Blomfeldt2014-11-152-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When font embedding is explicitly disabled, fall back to painter paths as we would if the font prohibits embedding. Note that this flag was never respected on any platform in any version of Qt, as far as I've been able to tell, because the handling of it in the X11 print engine was removed shortly after it was introduced in 2005. [ChangeLog][Printing] Disabling font embedding is now possible using the QPrinter::setFontEmbedding() function. Task-number: QTBUG-41943 Change-Id: Ice5e893f9893c5243310ae7892bec7497dd55c4a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * | Fix QAction::setFont crash on OSX, when font is unknown.David Faure2014-11-211-7/+12
| |/ | | | | | | | | | | | | | | | | | | customMenuFont was null, so objects was an empty array, and NSDictionary throws an exception when being called with arrays of different sizes. Task-number: QTBUG-42728 Change-Id: I8cdab449fd8c1d12b65c46dd5617a7f5e3e96c6e Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
| * Cocoa: get mouse position from event if possibleMorten Johan Sørvig2014-11-051-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ...instead of using the current mouse position. This is important if event processing is delayed: we want the QMouseEvent to have the position when the event happened, not the current position. Regression from Qt 4. Change-Id: Ifd4f0f02853236a204de96c5a97e72f86c29f0b7 Task-id: QTBUG-37926 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
| * Revert "OS X - unified toolbar and AA_NativeWindows"Morten Johan Sørvig2014-11-051-17/+1
| | | | | | | | | | | | | | | | | | Will be fixed in a different way. This reverts commit ae5f3df59b37e0ce8aaef27dc1e02f40def340ae. Change-Id: Ie706396667a5b6c9003bb92a018d88346a180e65 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
| * Cocoa: Guard against recursive event deliveryMorten Johan Sørvig2014-11-053-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Cocoa: refactor commit 876a428f.Morten Johan Sørvig2014-11-052-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conditions for when updateExposedGeometry() should actually send the expose event goes into the function itself. The window()->isVisible() check could arguably be moved to isWindowExposable(), but I'm keeping this as a straight refactor without any behavior changes. (isWindowExposable() is called from multiple locations) Change-Id: I6d792286ccbc50065ebfc588daca2240761a1937 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Cocoa: Don't activate popup windows.Morten Johan Sørvig2014-11-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Qt expects a handleWindowActivated call for non- popup windows only. Add a window type check, similar to the other handleWindowActivated calls. Task-number: QTBUG-38707 Change-Id: Iaa5959675f7e3ae4664bdf785d3f374debb0d0a7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
| * Cocoa plugin - fix a resource leakTimur Pocheptsov2014-10-311-0/+1
| | | | | | | | | | | | | | | | The patch 916dfcb8275bcce6b39606cd0b930239a60dc5df while fixing one problem, introduced another - leaking CGImage. Change-Id: I08db6ea9fa97ae3489a0bfa1f93e0d18f3671885 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * OS X: fix CFString leaks in mime classesDyami Caliri2014-10-301-2/+2
| | | | | | | | | | | | | | | | Some CFStringRefs created with CFStringCreate* methods were not being released. Using the QCFString helper class to perform auto release. Change-Id: I36d15c0d35118524089e99ea3cd53c41342d6308 Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
| * QCocoaPrintDevice: fix bad CFReleaseDyami Caliri2014-10-301-4/+4
| | | | | | | | | | | | | | CFRelease should be called IFF PMPrinterCopyDescriptionURL succeeds Change-Id: Id289aea3a4e3da397dae4062319256a043538597 Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
| * Cocoa: Handle Qt::WA_MacAlwaysShowToolWindowShawn Rutledge2014-10-291-1/+5
| | | | | | | | | | | | | | | | | | | | | | Forward the flag to QWindow by setting the _q_macAlwaysShowToolWindowproperty on the window in QWidgetPrivate::create_sys(). Test for the property when creating the window. Task-number: QTBUG-29816 Done-with: Morten Sørvig Change-Id: Id810dda98d02deb0902192cce1783d8b16b04d04 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Cocoa: Fix regression in key handlingLiang Qi2014-10-291-1/+1
| | | | | | | | | | | | | | | | The text should be empty when Cmd key is in modifiers. Task-number: QTBUG-36281 Change-Id: Ic71e532695ad4a947c86e8d21ae864d70f9afa4c Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Cocoa: Send obscure events on OcclusionStateHiddenMorten Johan Sørvig2014-10-291-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | This disables animations for windows that are completely obscured by other windows. On examples/quick/animation, obscured CPU usage goes from 10% to 1%. There has been reports of 100% CPU usage with Qt before this patch. Change-Id: Iefea43ed8c1cfaa2df13f1f5a4e4450146ade522 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
| * OS X - Cocoa backing store and drawRectTimur Pocheptsov2014-10-284-30/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | m_backingStore pointer has a limited 'lifetime' - usually it is set in -flushBackingStore:region:offset: method, then -drawRect: is invoked/forced by -setNeedsDisplayInRect:, after that it's dangerous to have a non-null pointer to a backing store (and we reset it). But if Cocoa invokes drawRect (due to some reason) our null backing store pointer is also not good. This patch instead is using a shared resource (QImage) from a backing store. This patch also makes getBackingStoreCGImage() redundant - -drawRect: was the only place we called it. Task-number: QTBUG-42206 Change-Id: Ie7726336f05d07c52f660f6326ae5cef114201dd Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
| * Cocoa QPA Plugin: Remove code depending depending on OS X 10.6 and olderGabriel de Dietrich2014-10-278-423/+187
| | | | | | | | | | | | | | Snow Leopard is unsupported from 5.4.0. Change-Id: I5c269cbdc93000a4657b63559cc3c526e298e3db Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
| * Send screen change events before expose events.Morten Johan Sørvig2014-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | This fixes the "expose event received for window with invalid geometry" warning from Qt Quick. The window's current screen is now up to date when processing the expose event. Change-Id: Ia5c83e34154182699ec587835f9063809d819d7d Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Cocoa: Expose on window size change onlyMorten Johan Sørvig2014-10-271-1/+1
| | | | | | | | | | | | | | | | Don't send expose events on window move. Task-number: QTBUG-42126 Change-Id: I6e758f9037a2a785c651b63d25b53e7a009b1fdf Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Clean up ShortcutOverride handlingFrederik Gladhorn2014-10-301-1/+1
|/ | | | | | | | | | | | | | | Instead of sending the event from random places, send it from QWindowSystemInterface. This allows to send override events on OS X to menus before doing other key processing and reduces the number of ShortcutOverride events on all platforms to exactly one per key press event. Additional test by Friedemann Kleint. Task-number: QTBUG-38986 Change-Id: I6981bb776aba586ebc7c3daa5fd7a0d84c25bc3e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Add searchEdit as accessible stateFrederik Gladhorn2014-10-253-3/+18
| | | | | | | The search state is used by VoiceOver on iOS to announce a search field. Change-Id: I464125827dbbf275daf38104e26e9591bb23365a Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* QPrinter - Fix DuplexMode on all platformsJohn Layt2014-10-242-7/+43
| | | | | | | | | | | | | Add support to get/set the DuplexMode on Windows and Mac, improve the CUPS duplex handling, ensure support is the same on all platforms. [ChangeLog][QtPrintSupport][QPrinter] Added duplex support for Windows and OS X. Task-number: QTBUG-11332 Change-Id: I9d61d63233d828c3b1fd6df54072c6049f3c6298 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Cocoa: Prevent FrameStrutMouseEvent double-clicksMorten Johan Sørvig2014-10-241-0/+6
| | | | | | | | | | | | | A window may see drag events without corresponding press/release events when dragging happens across several native windows. Handle NSLeftMouseDraged and NRightMouseDraged to synchronize mouse button state. Task-number: QTBUG-41609 Change-Id: Ieb66eb3460fc3cfd21e64c83ec1a28fe409af595 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Cocoa: Bring back qt_mac_set_raise_processMorten Johan Sørvig2014-10-241-3/+6
| | | | | | | | | In the form of an environment variable: QT_MAC_SET_RAISE_PROCESS. The default value is "on". Task-number: QTBUG-41569 Change-Id: Icf2e8818a6b126c7393ee022a1cab493fbc3a18e Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Cocoa: Don't send FrameStrut events during dragsMorten Johan Sørvig2014-10-241-0/+4
| | | | | | | | | Check the (normal) button state and return early if there is a pressed button. Task-number: QTBUG-41609 Change-Id: I69d23f02e55627ca3e03f2466103e0952ff442b3 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Don't flush user input events from setVisibleMorten Johan Sørvig2014-10-241-1/+1
| | | | | | | | | | | | | | Applications do not expect user input event delivery during QCocoaWindow::setVisible. The call to flushWindowSystemEvents still needs to be here for proper expose event processing, but we can at least exclude user input events. Task-number: QTBUG-39842 Change-Id: Ibd511efef47eeda21831481ef096a82d7b5a9cf8 Reviewed-by: Jonathan Liu <net147@gmail.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Cocoa: Fix trackpad scrolling modifiers.Morten Johan Sørvig2014-10-241-4/+0
| | | | | | | | | | | | | | | We would reset the keyboard modifier state on NSEventPhaseEnded, which meant that the state would be NoModifier as soon as the fingers left the trackpad. We want the modifier state to stay constant for the duration of the gesture. Remove the "reset" code and rely on setting currentWheelModifiers on NSEventPhaseNone only. Task-number: QTBUG-40197 Change-Id: I615aa5e1148b2b824f1a585bc042c9dbb3f1f250 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Cocoa: avoid sending exposes too earlyLaszlo Agocs2014-10-231-2/+6
| | | | | | | | | | | Expose events trigger backing store sync and thus paint events on QGLWidgets. Sending the exposes too early may lead to failures in the OpenGL calls. Sending exposes before even getting to calling setVisible(true) in QWidget::show() is just wrong. Task-number: QTBUG-36802 Change-Id: Ic7d5125f4e257d715009811217e453d79d0fcc7c Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Cocoa: Fix icon size calculation for system tray.Christoph Schleifenbaum2014-10-221-32/+64
| | | | | | | | | | | | | | | | | | | | | The Overall goal is to make it possible to use correctly- sized pixmaps in a predictable way, while still doing something reasonable with small and large pixmaps. (The recommended pixmap height is up to 18 points.) Enable use of rectangular icons by selecting pixmaps based on pixmap height. Draw a low-resolution pixmap on retina displays if there is no high-resolution pixmap available. Scale large pixmaps to fit the available menu bar area. Add a manual-test with various pixmap sizes Task-number: QTBUG-33441 Change-Id: I1926181fe27cae526bae58022df3240bae9f8ac8 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Cocoa: Delay QMimeData requests for DnD events.Morten Johan Sørvig2014-10-223-16/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We were delaying the conversion from Qt to OS X types, but not the data request to the application. Introduce "Eager" and "Lazy" pasteboard promises: Eager promises request the application data immediately and can continue to use the existing commit-promises- on-app-exit logic. Eager promises are the default type and will be used for copy/paste. Lazy promises delay requesting the data from the application for as long as possible, specifically until when promiseKeeper() is called. Lazy promises are used for drag-and-drop and are not committed on application exit. This brings OS X DnD behavior in line with the Windows behavior. [ChangeLog][OS X] Drag-and-drop QMimeData requests are now delayed until drop time. Task-number: QTBUG-31301 Change-Id: I8ddbba41593251f4c0c49c29492dce990066e20d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Revert "Cocoa: Send obscure events on OcclusionStateHidden"Morten Johan Sørvig2014-10-221-2/+4
| | | | | | | | | | | | | | This caused instability in the CI and testing system: Tests that expected expose and paint events no longer got them due to window placement/visibility, including: tst_QGraphicsProxyWidget::paintEvent tst_QMdiArea::tileSubWindows tst_QSizeGrip::hideAndShowOnWindowStateChange This reverts commit f5cf06f4afc48198780e3c3d0d1a52afce425507. Change-Id: I017fbf24f3ad99cce6602eddafc3a67f8edc494d Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* OS X: drag and drop and auto-scrollingTimur Pocheptsov2014-10-221-0/+13
| | | | | | | | | | | | Cocoa sens periodic drag updated events even if there is no actuall mouse movement (or any other updates). This breaks animations in different views/widgets supporting our own auto-scroll (done with timers). This patch kindly asks Cocoa _not_ to send us these events. Task-number: QTBUG-32761 Change-Id: I5dad4ceb0a490e2f3cb34a806a5bdb1045b4dac3 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* OS X - unified toolbar and AA_NativeWindowsTimur Pocheptsov2014-10-211-1/+17
| | | | | | | | | | | | | | | | | | | | In some cases QToolBar creates a child window (a child borderless NSWindow) placed on top of the toolbar's main window. As a result it's not possible to drag this main window using its toolbar - the window "jumps" on the screen. The reason is quite subtle - QNSView -handleMouseEvent: uses [NSEvent mouseLocation] and this location is invalid: - we have an NSWindow (parent) - we have a child NSWindow ([parent addChildWindow:child ....] - we handle drag event in a child window - we move a parent window as a result of drag event - Cocoa also moves a child window for us - when handling the next drag event, location [NSEvent mouseLocation] differs from the real event's location. Task-number: QTBUG-40106 Change-Id: Ic68cb92ab4233a1e0746b478820c1e33fd37a462 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>