summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qeventdispatcher_mac.mm
Commit message (Collapse)AuthorAgeFilesLines
* Update licenseheader text in source files for qt4.8Jyri Tahtela2011-05-131-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Cocoa: implement eventdispatcher flag excludeUserInputEventsRichard Moe Gustavsen2011-02-181-18/+42
| | | | | | | | | | | When executing modal windows, the event dispatcher would not respect the QEventLoop::ExcludeUserInputEvents. This patch implements this support. The way it now works is that we fetch events manually from NSApplication and do the dispatching ourselves in those cases. From earlier research, this patch has shown to be a bit unreliable in some cases, and might have some sideeffects. Hence the reason we avoid it if we can. But it still feels better that we try to follow the flag in those few application that wants to do this.
* Cocoa: processEvents does not always send posted eventsRichard Moe Gustavsen2011-02-171-2/+8
| | | | | | | | The event dispatcher for the cocoa port relies on the event loop source to fire for sending posted events. But when dispatching events manually (not using exec mode) this does not always trigger. This patch (discussed with brad) makes sure we always call sendPostedEvents for this case
* Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-01-171-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/webkit/imageanalyzer/imageanalyzer.h examples/webkit/imageanalyzer/mainwindow.h mkspecs/unsupported/qws/linux-x86-openkode-g++/qplatformdefs.h src/corelib/io/qfsfileengine_iterator_unix.cpp src/corelib/io/qfsfileengine_iterator_win.cpp src/corelib/kernel/qcoreapplication.cpp src/network/access/qnetworkaccessdatabackend.cpp src/plugins/bearer/connman/qconnmanservice_linux.cpp src/plugins/platforms/openvglite/qwindowsurface_vglite.h src/s60installs/bwins/QtCoreu.def src/s60installs/eabi/QtCoreu.def src/s60installs/s60installs.pro tools/assistant/tools/assistant/helpviewer_qwv.h tools/qdoc3/test/qt-html-templates.qdocconf
| * Update copyright year to 2011.Jason McDonald2011-01-101-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Cocoa: add support for QEventLoop::ExcludeUserInputEventsRichard Moe Gustavsen2011-01-061-1/+4
|/ | | | | | | | | | Seems like this was just missing when used together with the DialogExec/EventLoopExec flags. This patch avoid using cocoas own run methods for dispatching events when we want to exclude user input events, and instead do it ourselves. This patch will only fix this issue when no modal windows are showing. For modal windows, a bit more research is needed.
* Cocoa: native child filedialogs sometimes shows non-native on screenRichard Moe Gustavsen2010-12-131-1/+2
| | | | | | | | | | The reason is that we make all child dialogs of a modal dialogs non-modaly shaddowed, as documented. But we forgot to check if a window is actually visible before raising it to front. Also adding harmless auto release pool Rev-By: prasanth
* Cocoa: Demo browser can get stuck after closing modal dialogRichard Moe Gustavsen2010-08-261-0/+6
| | | | | | | | | | | | | | This turns out to be a glitch in the event dispatcher for Qt/Cocoa. The problem is that you can, in some really slim cases it must be, end up calling processEvents with the exec flag set, while the current modal dialog has been told to leave modal. In that case, we recurse into a new event dispatching loop for a session that is about to die. And that causes problems when the session actually dies. This patch makes sure that you cannon start spinning a session that is about to die, by setting the sessionCache to zero. Task-number: QTBUG-13164 Reviewed-by: Tor Arne
* Cocoa: Stacking order of modal dialogs is wrongRichard Moe Gustavsen2010-08-131-6/+6
| | | | | | | | | | | | Modal dialogs were sometimes hidden behind other normal windows on screen. The reason was that, upon going modal for a window, we actually resat the stacking level on the window in a faulty attempt to respect any stays-on-top window flags. This patch makes sure we avoid doing that, and at the same time, ensures we don't reintroduce the original bug as well. Task-number: QTBUG-12841 Reviewed-by: cduclos
* Add a new qconfig feature GESTURESTasuku Suzuki2010-06-021-0/+2
| | | | | Merge-request: 535 Reviewed-by: Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>
* Cocoa: remove hackish code that is no longer neededRichard Moe Gustavsen2010-04-071-31/+3
| | | | | | | | | After Carlos' patch (0c442405a9f85), the code in the event dispatcher that tried to restore correct window level (or actually block cocoa from setting the wrong level) can now be removed. Tested on 10.5 and 10.6. Reviewed-by: cduclos
* [Cocoa] QDialogs with WindowStayOnStopHint parentCarlos Manuel Duclos Vergara2010-04-061-1/+8
| | | | | | | | | The problem is with beginModalSession which reorders the windows and sends our window back. This patch queries the window level before calling beginModalSession and sets it after beginModalSession. Task-number: QTBUG-9392 Reviewed-by: Richard Moe Gustavsen
* Cocoa: fix eventdispatcher crash, found by macgui autotestRichard Moe Gustavsen2010-03-221-2/+6
| | | | | | | | | | In some cases, we end up deleting a widget before we get to end the modal session that might be attached to it. And that will cause a crash. This patch retains/releases the underlying NSWindow, so we always have a valid reference as long as the modal session is alive. Reviewed-by: msorvig
* Merge branch 'master' of git:qt/qtThiago Macieira2010-02-211-0/+8
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: doc/src/declarative/advtutorial1.qdoc doc/src/declarative/advtutorial2.qdoc doc/src/declarative/advtutorial3.qdoc doc/src/declarative/advtutorial4.qdoc doc/src/declarative/tutorial1.qdoc doc/src/declarative/tutorial2.qdoc doc/src/declarative/tutorial3.qdoc
| * Merge remote branch 'origin/master' into qt-master-from-4.6Thiago Macieira2010-02-181-2/+1
| |\ | | | | | | | | | | | | | | | Conflicts: src/corelib/codecs/qtextcodec.h tests/auto/gestures/tst_gestures.cpp
| * \ Merge branch '4.6' into qt-master-from-4.6Thiago Macieira2010-02-171-0/+8
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/common/symbian/symbian.conf src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp tools/assistant/tools/assistant/helpviewer.cpp
| | * | Compile fix on Mac with 10.5 sdk.Denis Dzyubenko2010-02-121-1/+1
| | | | | | | | | | | | | | | | Reviewed-by: trustme
| | * | Ignore touch and gesture events when excluding input eventsDenis Dzyubenko2010-02-121-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When asked to exclude input events when processing events in the event dispatcher we should also exclude touch and gesture events on Windows and Mac. Reviewed-by: Bradley T. Hughes
* | | | Cocoa: event dispatcher eats mouse eventsRichard Moe Gustavsen2010-02-191-39/+35
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that the event dispatcher did not flush queued user input events under some circumstances (when adding the exec-flag to processEvents). And this caused problems in the QML-editor in creator regarding focus frames. This patch makes sure that we always flush the queued user input events when calling processEvents. Task-number: QTBUG-8274 Reviewed-by: Prasanth Reviewed-by: cduclos
* | | Cocoa: Menu in menubar stays highlightedRichard Moe Gustavsen2010-02-101-2/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you use the menu bar for a window to open up another window woth no menu bar, the first menu bar stays highlighted once it is set as current again. The reason is that we remove the first menu bar before cocoa gets a chance to update it correctly. This patch implements a system for us to post a message/call to cocoa, so we delay removing the toolbar until after cocoa has finished closing it properly. NB: Rather than posting the call to a window on screen, it would have been better and safer to post it no window, and then receive the event in the event handler of NSApplication. But for the moment, we have decided not to subclass NSApplication... Rev-By:prasanth
* | Merge remote branch 'qt/4.6' into qt-master-from-4.6Qt Continuous Integration System2010-02-011-1/+0
|\ \ | |/ | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qeventdispatcher_mac.mm src/gui/kernel/qt_cocoa_helpers_mac.mm src/gui/widgets/qmenu_mac.mm tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp tools/assistant/tools/assistant/centralwidget.cpp tools/linguist/lupdate/main.cpp
| * Qt/Cocoa Event Dispatcher Problem in modal dialogsRichard Moe Gustavsen2010-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The problem is that we didn't check if the event dispatcher was interrupted before starting to wait for more events. This patch will do the interrupt test after processing modal session events, and just before starting to wait. This will fix applications that expects e.g an event loop to exit immidiatly upon a signal from a timer (without the need for the user to generate e.g. a mouse event to stop the wait). Task-number: QTBUG-7503 Reviewed-by: cduclos
* | Cocoa: implement usage of override cursorsRichard Moe Gustavsen2010-01-281-1/+1
| | | | | | | | | | | | | | This have never worked in the Cocoa port, it seems. This patch gives it a try. Reviewed-by: msorvig
* | Merge branch '4.6'Thiago Macieira2010-01-131-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | Conflicts: bin/syncqt doc/src/deployment/deployment.qdoc src/corelib/io/qfsfileengine_win.cpp src/corelib/xml/qxmlstream.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h tools/assistant/tools/assistant/centralwidget.cpp tools/linguist/lupdate/main.cpp
| * Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Cocoa: application will not quit when using dialogsRichard Moe Gustavsen2010-01-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating a single dialog in the main function, and tell it to exec, we run a modal dialog. But there is really no other window on screen to be modal for. So in that case, since this is a rather common pattern for Qt applications, we allow users to quit the application from the dock. But this action is sendt as an apple event. And and that point in time, cocoa has the the apple event handler, and refuses to close down the application because it detects a modal window. Our solution is to install/overwrite the apple event handler for kAEQuit _after_ cocoa has finished its own installation. But in order to do this, we need to wait until [NSApplication run] has started, otherwise it will not take effect. And that is what this patch essentially does.
* | Carbon: compile fixRichard Moe Gustavsen2010-01-041-1/+1
| | | | | | | | Oops. Broke build on carbon.
* | Cocoa: app menu does now show before doing qApp::exec()Richard Moe Gustavsen2010-01-041-14/+26
| | | | | | | | | | | | | | | | The reason is that we need to start [NSApplication run] before the menus get properly initialized. This patch will make the event dispatcher run nsapp once before spinning a modal session, if needed Task-number: QTBUG-6627
* | Cocoa: event dispatcher drops events on the floorRichard Moe Gustavsen2009-12-221-168/+229
|/ | | | | | | | | | | | | | | | | | Under some circumstances, the event dispatcher needs to stop NSApplication, let the control return back to the QEventLoop that called processEvents, which very often will just call processEvents again, which in turn will restart NSApplication. After stopping NSApplication, Cocoa seems to throw away at least some of the posted cocoa events that are still pending. This will offcourse have inpact on things like window updates etc. that never happends. This patch will be more careful about when to stop NSApplication, and delay this until the run loop has finished one more spin after interrupt has been called. The same goes for modal sessions. Introducing this delay also made it neccessary to sometimes block cocoa from updating the stacking order of the windows. Autotest: qcoreapplication, qapplication, qtimer
* Cocoa: native dialogs might hang the application on closeRichard Moe Gustavsen2009-11-231-2/+8
| | | | | | | | This patch implements the same fix as 639b9c0286f0f2d5e50121df8d4125f029074510, but when someone spins the event dispatcher manually (calling processEvents themselves). Rev-By: MortenS
* Cocoa: QColorDialog makes the application hangRichard Moe Gustavsen2009-11-121-0/+6
| | | | | | | | | | | | | | | The reason is that the color dialog is using a native dialog. And this dialog enters modality on its own, bypassing the modality mechanism in Qt. Most important, when the dialog leaves modality, it does so by calling [NSApp stopModal]. And this call stops all modal sessions in the application, including the ones owned by Qt. This patch detects when this situation occurs, and makes sure that all modal sessions gets stopped the correct way, and later rebuilt. Rev-By: MortenS
* Cocoa: QInputDialog autotest reveals event dispatcher bugRichard Moe Gustavsen2009-10-141-8/+13
| | | | | | | | | | On Cocoa, we sometimes need to block sending posted events (because we need to flush the event que now and then without touching Qt events). But we forgot to do same for timer callback. So this patch makes sure that we dont send the timer event immidiatly if we are just flushing the event que. Rev-By: brad
* Carbon: QApplication auto test shows bug in event dispatcherRichard Moe Gustavsen2009-10-131-1/+1
| | | | | | | | | | | | | | The reason for the bug is that we call _quit_ on the eventloop just _after_ posting the deffered delete event (from inside deleteLater function, ref the test where it fails, tst_qapplication.cpp:1242). And the point is, even if the loop level tells us that we _can_ delete the object in this case, the 'quit' tells us that we should not process _any_ events (until we get a call to processEvents again). So this patch makes sure that we don't call sendPostedEvents from the eventDispatcher if it is interruped. Rev-By: brad
* The firstTimeObserver is not released if the event loop is never runBenjamin Poulain2009-09-211-8/+10
| | | | | | | Previously, the firstTimeObserver was released by the event loop. This do not work if the event loop is never run. This commit amend b0016ea9a6b225757e3ee06b50e8f7d05463ddf7.
* On Mac, the posted events are processed on the first time in the loopBenjamin Poulain2009-09-211-2/+31
| | | | | | | | | | | | | | | | On Mac OS X, we use a custom source for posted events. The first time the event loop is entered, the custom source is added to the native event dispatcher but the events are not processed. In Qt, we expect those events to be processed. To work around the problem, a new observer is added to the event loop. This observer is only triggered the first time the event loop is entered. When the observer is triggered, the posted events are sent. Task-number: QTBUG-4521 Reviewed-by: Richard Moe Gustavsen Reviewed-by: João Abecasis
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* Merge branch '4.5' into 4.6Thiago Macieira2009-08-311-13/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: demos/boxes/glshaders.cpp demos/boxes/vector.h demos/embedded/fluidlauncher/pictureflow.cpp demos/embedded/fluidlauncher/pictureflow.h doc/src/desktop-integration.qdoc doc/src/distributingqt.qdoc doc/src/examples-overview.qdoc doc/src/examples.qdoc doc/src/frameworks-technologies/dbus-adaptors.qdoc doc/src/geometry.qdoc doc/src/groups.qdoc doc/src/objecttrees.qdoc doc/src/platform-notes.qdoc doc/src/plugins-howto.qdoc doc/src/qt3support.qdoc doc/src/qtdbus.qdoc doc/src/qtdesigner.qdoc doc/src/qtgui.qdoc doc/src/qtmain.qdoc doc/src/qtopengl.qdoc doc/src/qtsvg.qdoc doc/src/qtuiloader.qdoc doc/src/qundo.qdoc doc/src/richtext.qdoc doc/src/topics.qdoc src/corelib/tools/qdumper.cpp src/gui/embedded/qkbdpc101_qws.cpp src/gui/embedded/qkbdsl5000_qws.cpp src/gui/embedded/qkbdusb_qws.cpp src/gui/embedded/qkbdvr41xx_qws.cpp src/gui/embedded/qkbdyopy_qws.cpp src/gui/embedded/qmousebus_qws.cpp src/gui/embedded/qmousevr41xx_qws.cpp src/gui/embedded/qmouseyopy_qws.cpp src/gui/painting/qpaintengine_d3d.cpp src/gui/painting/qwindowsurface_d3d.cpp src/opengl/gl2paintengineex/glgc_shader_source.h src/opengl/gl2paintengineex/qglpexshadermanager.cpp src/opengl/gl2paintengineex/qglpexshadermanager_p.h src/opengl/gl2paintengineex/qglshader.cpp src/opengl/gl2paintengineex/qglshader_p.h src/opengl/util/fragmentprograms_p.h src/plugins/kbddrivers/linuxis/linuxiskbdhandler.cpp src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp src/script/parser/qscript.g src/script/qscriptarray_p.h src/script/qscriptasm_p.h src/script/qscriptbuffer_p.h src/script/qscriptclass.cpp src/script/qscriptclassdata_p.h src/script/qscriptcompiler.cpp src/script/qscriptcompiler_p.h src/script/qscriptcontext.cpp src/script/qscriptcontext_p.cpp src/script/qscriptcontext_p.h src/script/qscriptcontextfwd_p.h src/script/qscriptecmaarray.cpp src/script/qscriptecmaarray_p.h src/script/qscriptecmaboolean.cpp src/script/qscriptecmacore.cpp src/script/qscriptecmadate.cpp src/script/qscriptecmadate_p.h src/script/qscriptecmaerror.cpp src/script/qscriptecmaerror_p.h src/script/qscriptecmafunction.cpp src/script/qscriptecmafunction_p.h src/script/qscriptecmaglobal.cpp src/script/qscriptecmaglobal_p.h src/script/qscriptecmamath.cpp src/script/qscriptecmamath_p.h src/script/qscriptecmanumber.cpp src/script/qscriptecmanumber_p.h src/script/qscriptecmaobject.cpp src/script/qscriptecmaobject_p.h src/script/qscriptecmaregexp.cpp src/script/qscriptecmaregexp_p.h src/script/qscriptecmastring.cpp src/script/qscriptecmastring_p.h src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptengine_p.h src/script/qscriptenginefwd_p.h src/script/qscriptextenumeration.cpp src/script/qscriptextenumeration_p.h src/script/qscriptextqobject.cpp src/script/qscriptextqobject_p.h src/script/qscriptextvariant.cpp src/script/qscriptfunction.cpp src/script/qscriptfunction_p.h src/script/qscriptgc_p.h src/script/qscriptmember_p.h src/script/qscriptobject_p.h src/script/qscriptprettypretty.cpp src/script/qscriptprettypretty_p.h src/script/qscriptvalue.cpp src/script/qscriptvalueimpl.cpp src/script/qscriptvalueimpl_p.h src/script/qscriptvalueimplfwd_p.h src/script/qscriptvalueiteratorimpl.cpp src/script/qscriptxmlgenerator.cpp src/script/qscriptxmlgenerator_p.h tests/auto/linguist/lupdate/testdata/recursivescan/project.ui tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp tools/linguist/shared/cpp.cpp
| * Update tech preview license header.Jason McDonald2009-08-311-13/+13
| | | | | | | | Reviewed-by: Trust Me
| * Update license headers.Jason McDonald2009-08-111-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Added support for gestures on Mac OS X CarbonRichard Moe Gustavsen2009-08-181-1/+1
| |
* | Cocoa: Fix several issues with the event dispatcherRichard Moe Gustavsen2009-08-141-148/+277
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Autotest: qcoreapplication, qapplication, qtimer qwidget_window, qwidget Issue 1: stacking order of modal windows was not working correctly. With this patch, we remove the need for rebuilding modal sessions all the time, and when we do, we rebuild them all in the correct order. Issue 2: When running the event processor manually (that is, just calling processEvents in a loop), we sometimes spendt 100% cpu if a window was pending to become modal. The reason was that we need to keep reposting the QCocoaRequestModal event until we could block the calling thread (that is, one of the exec flags was given to processEvents). With this patch, the need for posting QCocoaRequestModal is completly removed in favor of an 'interrupt' approach instead. Issue 3: If using Qt as a plugin, or just add widget to a native cocoa application, it would often lead to closing down the application. The reason is that the event dispatcher needs to restart [NSApp run] now and then. But this approach fails if Qt was not the code that started [NSApp run] in the first place. This patch removes the need to restart NSApp in this situation, at the cost of modal windows not beeing modal if Qt is not spinning the event dispatcher. Normal QDialog::exec etc will always work.
* | Update contact URL in license headers.Jason McDonald2009-08-121-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Remove all the last vestiges of QuickDraw in Qt/Mac.Norwegian Rock Cat2009-07-241-10/+0
|/ | | | | | | Panther was the last reason for having this around. We don't touch this code anywhere else in Qt. As a result it's orphaned and can be safely removed. It truly is the end of an era, but it's definitely worth celebrating. Quartz4Life!
* Fix crash when native socket notifiers would send a notification after being ↵Norwegian Rock Cat2009-07-201-4/+8
| | | | | | | | | | | | | | | | disabled. Spend a lot of time looking at this and at the CoreFoundation source code and it seems that we really do get a notification even after the notifier is disabled. I suspect there's a race condition between when we disable the socket notifier, but the kernel flags it as needing a read, then CoreFoundation just sends the notification without checking if the CFSocket has been disabled. No further notifications come of course. Since this breaks the invariant that was set in the assert, I'm replacing it with an if check. Task-number: 258198 Reviewed-by: Bradley T. Hughes
* Update license headers as requested by the marketing department.Jason McDonald2009-06-161-2/+2
| | | | Reviewed-by: Trust Me
* Long live Qt 4.5!Lars Knoll2009-03-231-0/+926