summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
Commit message (Collapse)AuthorAgeFilesLines
* Don't send posted events from QWindowSystemInterface::sendWindowSystemEventsTor Arne Vestbø2013-09-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The responsibility of sendWindowSystemEvents() is to process events from the window system. Historially that logic was part of the QPA/QWS event dispatcher, which naturally also sent posted events. Through refactoring, the code at some point ended up in in the QWindowSystemInterface class, still with the posting of events in place. This resulted in QPA event dispatchers adopting a pattern of just calling sendWindowSystemEvents(), as that would cover both posted and window system events. Other event dispatchers would call sendWindowSystemEvents(), and then use a base-class implementation from QtCore for processing events, resulting in two calls to QCoreApplication::sendPostedEvents() per iteration of processEvents(). This breaks the contract that processEvents will only process posted events that has been queued up until then. We fix this entanglement by removing the sendPostedEvents() call from QWindowSystemInterface::sendWindowSystemEvents() and move it to the respective event dispatchers. For some EDs it means an explicit call to sendPostedEvents, while others were already doing sendPostedEvents though a separate source (GLib), or using a base-class (UNIX/BB), and did not need an extra call. We still keep the ordering of the original sendWindowSystemEvents() function of first sending posted events, and then processing any window system events. Task-number: QTBUG-33485 Change-Id: I8b069e76cea1f37875e72a034c11d09bf3fe166a Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Merge branch 'stable' into devSergio Ahumada2013-09-132-3/+7
|\ | | | | | | | | | | | | | | Conflicts: src/concurrent/qtconcurrentmedian.h src/corelib/itemmodels/qabstractitemmodel.cpp Change-Id: Iac46a90bbb2958cef7670031a4b59c3becd8538a
| * Fix Invalid Drawable error when using createWindowContainer on Mac.Chris Meyer2013-09-102-3/+7
| | | | | | | | | | | | | | | | | | | | | | You are not supposed to call NSOpenGLContext -setView: for a view that has not yet called drawRect. Doing this would result in a invalid drawable error. Similar to 4.8 commit cd2a51a66f52767c20e80361033c573651b3a08d Change-Id: Ibb2300a8c6fe52f786f813987e93d4a3dc145366 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devSergio Ahumada2013-09-073-8/+10
|\| | | | | | | Change-Id: I9ee4176f0a0078908d49896508826154c9f71530
| * Cocoa: Fix NSMenu popup coordinatesGabriel de Dietrich2013-09-041-0/+2
| | | | | | | | | | | | | | | | | | Those should be in window coordinates (or rather, its content view) not view coordinates. Task-number: QTBUG-32826 Change-Id: I52dddeccf17b359163ad477ce4299b934633b4fa Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Cocoa: Unregister view from window's notifications onlyGabriel de Dietrich2013-09-042-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise the view will miss its own frame change notifications. And we must unregister from all the notifications during dealloc. This would also reveal a bug where we would expose an NSView before its super view is visible, leading to those "invalid drawable" warnings when using QQuickViews. Therefore, we add this extra check in QCocoaWindow::exposeWindow(). Task-number: QTBUG-32826 Change-Id: I69018cb6f199b242768d114b2aa34c7f2d243196 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Fix event delivery for apps with native widgets.Morten Johan Sørvig2013-09-041-0/+1
| | | | | | | | | | | | | | | | | | | | Native widgets, which have a NSView but not a NSWindow, must be created in the hidden state to prevent Cocoa from selecting them for event delivery. Change-Id: I741e52729047ad4e03959f2244abe5b14b5df46b Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * OSX: clicking outside a popup: don't propagate the event elsewhereShawn Rutledge2013-09-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | If you click outside a popup window, it only closes the popup; any other widget that was under the cursor at that time should not get the event. The bug was about the popup list on a combobox, but this patch assumes that this rule is universal; can't think of any exceptions at this time. (E.g. a tooltip is not a popup) Clicking on the application menubar still does not close the popup though. Task-number: QTBUG-33241 Change-Id: I2444b7cfd40cf75ff7b70e3fecfeceb2fd4623bf Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | Remove qSort usages from the Cocoa helpersGiuseppe D'Angelo2013-09-061-1/+3
| | | | | | | | | | | | | | | | QtAlgorithms is getting deprecated, see http://www.mail-archive.com/development@qt-project.org/msg01603.html Change-Id: I482ce9320c07458a9f76df5823f17d53beec00d8 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-273-1/+11
|\| | | | | | | | | | | | | Conflicts: examples/widgets/doc/src/addressbook-fr.qdoc Change-Id: Id1196e8e0c6445f1616c3f29234c974d809f8e48
| * Return 1.0 for devicePixelRatio in QCocoaWindow if no valid windowDaiwei Li2013-08-231-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | If m_window is invalid, devicePixelRatio returns 0, which leads to adverse effects in other parts of the code. For example, qquickshadereffectsource.cpp will get stuck in an infinite loop trying to multiply 0 by 2. Task-number: QTBUG-32975 Change-Id: Ie3db86f1f459df018ebce67bcb4226f6cffe854e Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Cocoa: Fix memory leak in event dispatcherGabriel de Dietrich2013-08-221-0/+1
| | | | | | | | | | | | | | | | | | We retain each modal NSWindow as long as its modal session is running, and we should release it every time that modal session ends. Task-number: QTBUG-32728 Change-Id: Ia30c9c2d15be1350e7150a0d3c2f530a2fe4f38b Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Cocoa: Bring back old exposure behavior on Mac OS X 10.6Gabriel de Dietrich2013-08-221-0/+4
| | | | | | | | | | | | Task-number: QTBUG-31864 Change-Id: Ife2429b2d6b845e5ccca31a03e66351a3ff5ba4b Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-213-5/+7
|\| | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/src.pro Change-Id: I0a560826c420e46988da3776bd8f9160c365459a
| * Merge branch 'release' into stableSergio Ahumada2013-08-151-2/+1
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp Change-Id: I1a92b0c0dc1f7bad947a54fdd3ea7cfd6a5a7694
| | * Avoid a potential crash in unignoredChildrenJan Arve Saether2013-08-091-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This doesn't actually fix the source of the problem, but its harmless. This was reproduced with tst_qcolumnview and voiceover enabled Task-number: QTBUG-32440 Change-Id: Iad27884e1ca9194f911271c16908ef358e4b1875 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
| * | Cocoa: bugfix mouse wheel + modifier keys not workingRichard Moe Gustavsen2013-08-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid using modifier keys when releasing a two-finger mouse wheel flick on a trackpad, we listen to event phases. But for a normal mouse, a separate phase NSEventPhaseNone is given. Ensure that we still send modifier keys when that state is reported. Task-number: QTBUG-32098 Change-Id: Ib840dd661b7842ae49127e5a8d42e3666ae2da4e Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| * | Cocoa: Set window title after setting window flags if window has borderDaiwei Li2013-08-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A QWindow should keep its title after removing and restoring the frame, so set it if we are setting window flags that include a frame. Task-number: QTBUG-32978 Change-Id: I0fe1b651eac05a210b06ec4f7f6fb78f2536834d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * | Fix QKeyEvent::isAutoRepeat on MacGatis Paeglis2013-08-141-1/+1
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-21500 Change-Id: Ifed85ddcdecd30453207728b0f376baa2abf6e66 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-08-166-20/+29
|\ \ \ | | | | | | | | | | | | refs/staging/dev
| * | | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-146-20/+29
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/macx-xcode/Info.plist.app mkspecs/macx-xcode/Info.plist.lib qmake/doc/qmake.qdocconf src/corelib/global/qglobal.h tests/auto/other/exceptionsafety/exceptionsafety.pro tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp Change-Id: I3c769a4a82dc2e99a12c69123fbf17613fd2ac2a
| | * | Cocoa: Allow to hide menu items in menubarGabriel de Dietrich2013-08-133-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-32899 Change-Id: I423ac2d636306303d39e973f19032c9004957095 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
| | * | Merge branch 'release' into stableSergio Ahumada2013-08-091-4/+1
| | |\| | | | | | | | | | | | | Change-Id: I5e94c4f01564df633c9925561ebb0b553bd31a2e
| | | * Don't release the printer after using it to change a propertyAndy Shaw2013-08-081-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The printer should not be released after changing a property on it as it is still needed by QPrinter elsewhere. It is released as appropriate automatically already. Task-number: QTBUG-32831 Change-Id: Idb2d98b25b62f343015a0a0fb3c9a0d506546132 Reviewed-by: Liang Qi <liang.qi@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| | * | [Mac] Fix modifier reporting issue in the key eventsGatis Paeglis2013-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This issue was introduced when porting key handling code from Qt4 to Qt5. To conform to the implementation of QKeyEvent::modifiers() we have to invert modifier state logic before sending them as QKeyEvents. Task-number: QTBUG-31332 Change-Id: I3bb41169f8ab2a4b0a13a224bb461d2792d3a65f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * | OSX: do not force a plain window to be on the same level as its parentShawn Rutledge2013-08-021-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2af0a778f464980594c36098e4a8ba4448edfd29 the fix for QTBUG-27410 caused this Designer bug. Doing the automatic level escalation only for "special" windows and avoiding it for plain Qt::Window type windows is one way of fixing the Designer problem. Task-number: QTBUG-31779 Change-Id: I1da5454f31111f36480fac3b53be6d5f0ce40047 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| | * | Cocoa: Make sure that resizeEvent is invoked after calling resizeNils Jeisecke2013-07-301-2/+5
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QWindow::resizeEvent documentation states that resizeEvent is invoked after the windowing system has acknowledged a setGeometry() or resize() request. The Cocoa plugin however did set the platform window geometry immediately so that the qnsview's updateGeometry returned too early. Task-number: QTBUG-32706 Change-Id: I1f359ab368833d174ab6740f4467b0848c290f13 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | | Add Wacom tablet support for CocoaRyohei Ikegami2013-08-162-0/+162
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-25867 Change-Id: I48178b8913224ac8e907d42f57620947df12e930 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | | Replace QWheelEvent::Phase with revised Qt::ScrollPhaseJ-P Nurmi2013-08-151-4/+4
| | | | | | | | | | | | | | | Change-Id: I4d8e7d48497d0d96a297191976c0d99feb67b538 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | | Change QNSView convertFromEvent: arguemnts to QPointFRyohei Ikegami2013-08-151-10/+14
|/ / | | | | | | | | | | | | | | | | | | | | | | Change QNSView convertFromEvent: toWindowPoint: andScreenPoint: arguments from QPoint to QPointF. QWindowSystemInterface event handlers already use QPointF and QPointF is needed for tablet support (https://codereview.qt-project.org/#change,62740). Change-Id: I6e5b2f19777fe24ae34e9e85028772e4be0a94f6 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | Cocoa: support QWheelEvent::PhaseJ-P Nurmi2013-08-091-1/+17
| | | | | | | | | | | | | | | | | | | | The started & ended phases are required for implementing correctly behaving transient scrollbars (ie. they become and stay visible when touching the pad with two fingers). Change-Id: I718d991ba6fd7e949cf9790f3bae285000fce576 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Cocoa: emit currentFontChanged signal in font dialog helperLiang Qi2013-07-311-1/+4
| | | | | | | | | | | | | | | | | | * changeFont is a delegate method of NSFontManager. * exec() will not be called in Qt Quick. Task-number: QTBUG-32450 Change-Id: I05e43ce84d28ff32c88d75bd6ee60653de6ca4f0 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Cocoa: align font dialog helper with the color oneLiang Qi2013-07-312-121/+142
| | | | | | | | | | | | | | | | The reference color dialog helper change is eeffcfbd89a0b386c5757e8c67b76c5bccc84ffd. Change-Id: I35b505cce133adeed91df7c95b21f7c74c55cb53 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Sergio Ahumada2013-07-241-0/+5
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-07-231-0/+5
| |\| | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp Change-Id: I18a9d83fc14f4a9afdb1e40523ec51e3fa1d7754
| | * OSX: Disable window restoration for the Mac font panelLiang Qi2013-07-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | because if it is automatically restored it's out of the application's control, so the user's interaction will be ignored. Change I8ce3cd94f5ae81d7877a346743ca4e0e188baa02 did this for normal windows by default, but the dialog helpers generate windows which aren't affected by that. Change-Id: I819d7ab4e51e90783d55cee0676dbc33b38c5b00 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | | Bump QPA-API-version.Friedemann Kleint2013-07-231-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | Changes f5dbc876378ae58a7bdfe1e9664fc81caca18dfb (Use QUrl in QFileDialog API) and c96a6ab627100452864eb4d8da973300401c1bfa (Pass argc, argv to platform plugin) introduced changes to the plugin API. Task-number: QTBUG-29396 Change-Id: I46ee22d16f045b69f141dc6c982017586efef662 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: David Faure (KDE) <faure@kde.org>
* | Have QFileDialog use QUrl internallyKevin Ottens2013-07-182-26/+30
| | | | | | | | | | | | | | | | | | | | | | | | When using the native dialog and through the helper, we use QUrl in QFileDialog. It is preparatory work for having QUrl based methods on QFileDialog interface itself. Done-with: sean.harmer@kdab.com Done-with: faure@kde.org Change-Id: I61e99d498252241f38ec05724702a90ba050c4bb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Merge branch 'stable' into devSergio Ahumada2013-07-119-145/+181
|\| | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/mac/pbuilder_pbx.cpp src/corelib/json/qjsonwriter.cpp src/corelib/kernel/qeventdispatcher_blackberry.cpp src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm Change-Id: I24df576c4cbd18fa51b03122f71e32bb83b9028f
| * Remove qWarning() in qt_mac_image_to_cgimage()Ivan Komissarov2013-07-031-4/+1
| | | | | | | | | | | | | | Change-Id: I839aa44735910012bf57daa9c8b55c5e6def3cd2 Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
| * Cocoa: fix shared color panel usageJ-P Nurmi2013-07-032-122/+144
| | | | | | | | | | | | Task-number: QTBUG-31819 Change-Id: I60162f4c4af8aaae02ba7be11b2793ad29c5e2b5 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * Avoid warnings when fetching file icons without a CGContextRefGabriel de Dietrich2013-07-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | This can happen when instantiating a QFileIconProvider and no suitable graphics context is available (e.g., when only using a QQuickView). The proper, longer (5.2) term solution would be to have the platform theme return a QIcon with a NSImage icon provider. Task-number: QTBUG-31908 Change-Id: Ibfdb51e0a7dd2c33761a463f4eb6619f0aca19f0 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| * Cocoa: Re-establish platform menu QObject hierarchyGabriel de Dietrich2013-07-021-0/+2
| | | | | | | | | | | | | | | | This amends commit 119882714f87ffeb6945fdb2d02997ae125ff50c. Change-Id: Ifb105596af5b00b04344cb665b3e68292c9187ae Reviewed-by: Romain Perier <romain.perier@gmail.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * Cocoa: Let Cocoa pick the right pixmap for menu item iconsGabriel de Dietrich2013-07-013-1/+21
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-31477 Change-Id: Iac2d13b68d36c691b60685b69cd390958c35fae3 Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| * Cocoa: Simplify qt_mac_cgimage_to_nsimage codeGabriel de Dietrich2013-07-011-10/+1
| | | | | | | | | | | | | | | | Since 10.6, NSImage has a sensible contructor for that. Change-Id: Ie753135ebb37630c1a70c395689bf85d4a4a01de Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| * Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-06-281-1/+5
| |\ | | | | | | | | | Change-Id: I53112e20a65b7d706755b4a22622979f3b91a2c2
| | * Mac OSX: get the correct key code when the control key is pressedShawn Rutledge2013-06-261-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The control key results in modifiers having Qt::MetaModifier, and then the correct character is found in charactersIgnoringModifiers. The rest of the time, [nsevent characters] seems to be correct. If we use charactersIgnoringModifiers too much of the time, then the keycode will be wrong in some cases even though typing is still possible. Task-number: QTBUG-29005 Task-number: QTBUG-31811 Task-number: QTBUG-31977 Change-Id: Ib23b89f03bc9a61fe6d177320fa603c05649e979 Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
| * | Cocoa: Don't update the menubar when popups are shownGabriel de Dietrich2013-06-271-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-31532 Change-Id: I86084cb96bd1dd253b3e2e4413c06de053b95b3b Reviewed-by: Romain Perier <romain.perier@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | | Cocoa: Remove references to CMProfileRef and related APIsGabriel de Dietrich2013-07-102-33/+3
| | | | | | | | | | | | | | | | | | | | | | | | Deprecated since 10.6. Change-Id: If1398c6cce0f199f9546d17695d47803f4a6fcba Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* | | Cocoa color dialog: Make sure hide() exits the modal sessionGabriel de Dietrich2013-07-101-1/+8
| | | | | | | | | | | | | | | Change-Id: I708011f3a8ce507e6ade98bf99ad0f5d7b160751 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>