summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qcocoaview_mac.mm
Commit message (Collapse)AuthorAgeFilesLines
* Cocoa: qwidget autotest fails on setToolTipRichard Moe Gustavsen2010-04-141-7/+8
| | | | | | | | | | | | | | The reason turns out to be that we: 1. Half-way fake mouse events from QCursor::setPos 2. Don't fake mouse move upon mouse enter unless traking is on The test failed when mouse trackin was on, so that we ended up faking the same mouse move event twize (in QCursor::setPos and mouseEnter). We now do a different implementation for setPos on cocoa (so that native events will be generated), and always fake a mouse move event from mouse enter to make tooltips (and other event filters) work Reviewed-by: MortenS
* Cocoa: send mouse move event upon a mouse enterRichard Moe Gustavsen2010-04-071-10/+20
| | | | | | | | | | On all platforms, we always send a mouse move event when the mouse enters a widget (if mouse tracking is on, that is). Then macnativeevents auto test revealed that we did not do this for the cocoa port. This patch will fix this. Reviewed-by: cduclos Reviewed-by: prasanth
* Add experimental support for StaticContents in Mac OS X.Fabien Freling2010-03-251-1/+18
| | | | Reviewed-by: Morten Sorvig
* Fixed qmdiarea autotest regression on CocoaDenis Dzyubenko2010-03-181-1/+2
| | | | | | | | This is an addition to 4256bd2141fef53f9e69a51b966bd85f67a6cf54 - when Cocoa asks as to become first responder we should only tell Qt about it if we are embedded into Cocoa app and there is no Qt widget being focused. Reviewed-by: Prasanth
* Remove unwanted code in f8d5f2594a9b268b9eeecf95b24b23fc940c71cePrasanth Ullattil2010-03-171-3/+1
| | | | Reviewed-by: Trust Me
* Fixed focus handling when Qt is embedded into Cocoa app.Denis Dzyubenko2010-03-171-3/+17
| | | | | | | When a Qt widget gets focus we should call setFocus() on it to make sure the focus chain is properly set. Reviewed-by: Prasanth
* Do not deliver the same key event multiple times in Cocoa.Denis Dzyubenko2010-03-171-4/+16
| | | | | | | | | | | When QCocoaView receives a keyDown or keyUp event, we translate it to QKeyEvent and deliver it to qt widgets, propagating if necessary. However if none of Qt widgets accepted the event we should propagate it back to cocoa - to get a beep from it, or for example if Qt widget is embedded into a native widget. Task-number: related to QTBUG-6444 Task-number: QTCREATORBUG-698 Reviewed-by: Richard Moe Gustavsen
* Cocoa: minisplitter has only 1px wide grab areaCarlos Manuel Duclos Vergara2010-03-171-2/+5
| | | | | | | | | The problem was that in Cocoa we were ignoring the WA_MouseNoMask attribute, therefore the mask was being applied to the mouse movements. This in turn caused the cursor not to change accordingly. Task-number: QTCREATORBUG-361 Reviewed-by: Prasanth
* Mac: scroll speed does not match native applicationsRichard Moe Gustavsen2010-03-111-6/+7
| | | | | | | | | | | | | | It turns out that we limit wheel scrolling on mac to an upper limit per event to one page. This behaviour is a bit strange in the first place, and on mac, it is just wrong. Besides, even when this limitation is removed, we still scroll a bit slower that native. The 'problem' is to come up with a good conversion from pixel scrolling to line based scrolling (Qt does not really have an API for pixel scrolling). But we up the speed a bit to make it perform more similar to xcode. Rev-by: msorvig
* Fix focus behavior bug on Mac OS X.Fabien Freling2010-03-031-1/+4
| | | | With the Full Access Keyboard enabled, the focus could sometimes be stolen by the window.
* Implement alien widgets on Mac/Cocoa.Morten Johan Sørvig2010-03-021-0/+25
| | | | | | | | | | | | | | | | | | This commit makes alien widgets opt in on a per-widget basis on Mac, set the Qt::WA_NativeWindow flag when creating the widget to enable. Setting this flag on widgets that have native child or sibling NSViews is not supported. The main use case for alien widgets on Mac is to improve performance for applications that have complex user interfaces. Qt can handle thousands of widgets per window, while Cocoa is designed to use a smaller number of NSViews in combination with NSCells and custom control implementations. This commit moves us in the direction of having a few main NSViews with "leaf" qwidgets implemented as a custom control.
* Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-02-251-3/+49
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (35 commits) Doc: Added a config file for creating Simplified Chinese docs directly. Doc: add a few lines about bearer managment to "What's New" page. Fix the SIMD implementations of QString::toLatin1() Update of the QScriptValue autotest suite. New data set for QScriptValue autotest generator. Autotest: make tst_qchar run out-of-source too Autotest: add a test for roundtrips through toLatin1/fromLatin1 Implement toLatin1_helper with Neon QRegExp::pos() should return -1 for empty/non-matching captures Revert "qdoc: Finished "Inherited by" list for QML elements." Revert "qdoc: List new QML elements in \sincelist for What's New page." Add the Unicode normalisation properties. Autotest: add a test for QDBusPendingCallWatcher use in threads Doc: placeholders for new feature highlights. doc: mark as reimplemented. Update of the QScriptValue autotest suite. New autotests cases for QScriptValue autotests generator. QScriptValue autotest generator templates change. Fix license template. QScriptValue::isQMetaObject crash fix. ...
| * Prevent stale QWidget pointers in QCocoaViewMorten Johan Sørvig2010-02-231-3/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | QCocoaView has two "back" pointers ot its owning QWidget and the corresponding QWidgetPrivate. The lifetime of the QCocoaView might be longer and that of the QWidget if Cocoa itself holds references to it. In addition accessing a QWidget that is being destroyed is not safe. Set both pack pointers to NULL in ~QWidget. This prevents following stale pointers in the QCocoaView callbacks. This also means that we'll see the NULL pointers, add gurads for that.
* | Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-02-231-2/+3
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (33 commits) Skip complex FBO tests if combined depth-stencil isn't supported Make tst_QGL::glWidgetRendering use same test as FBO autotest Updated WebKit from /home/jturcott/dev/webkit to qtwebkit-4.7-merged ( 9303f6d67fb964b71ed3e7361367c3ccfaba5e0a ) Updated WebKit from /home/jturcott/dev/webkit to qtwebkit-4.7-merged ( 5381ceeb37d97365cfb2f037650dbb4e495bca4e ) Adjust the mkdist-webkit script before the importation of WebKit. Make mediaservices use existing GStreamer qmake vars Detect GStreamer even when we're not building phonon Fix build on systems without XVideo headers Make the XVideo configure test actually pass if XV is present Add a configure test for XVideo support Fixed cosmetic glitch in QTabBar label's rendering improve sql support for mingw64 improve 64 bit support on windows Made the qDrawPixmaps() API public (with modifications). Fix GL viewports under -graphicssystem raster. QSortFilterProxyModel: Sorting occured unnecessarily when the dynamicSortFilter is turned off Fix test with gcc 4.0 where QT_USE_FAST_CONCATENATION cannot be enabled. Fix build with wingw Imporve win64 support for mingw Compile ...
| * Fix GL viewports under -graphicssystem raster.Gunnar Sletta2010-02-231-2/+3
| | | | | | | | | | | | GL widgets and native controls have paintonscreen set and bypasses backingstore. They can thus not rely on the windowsurface flushing but must be repainted via normal means
* | Cocoa: Fix build with namespaceRichard Moe Gustavsen2010-02-221-1/+1
|/ | | | Reviewed-by: MortenS
* Compile.Morten Johan Sørvig2010-02-181-0/+1
| | | | NSInteger is int/long on 32/64 bit.
* Mac: QSystemTrayIcon::DoubleClick and midmouse not workingRichard Moe Gustavsen2010-02-171-15/+0
| | | | | | | | On Mac, we never emit the activation signal of the tray icon with other reasons than triggered. The reason; it was never implemented. This patch connect the dots. Task-number: QTBUG-5770
* Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-02-131-1/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (28 commits) Optimized QLocale to access system locale on demand. Fix QRegion under Mac OS X. update according to Thiago's comments. Changes: add functionality for dbus auto start to qt Add license header to this file readdir64 is not available on HP-UX Fix bug in QDirPrivate::setPath, affecting QDir::cd, cdUp and setPath qdoc3: Completed handling of the new \pagekeywords command. Wrong cursor shown by the parent window after setOverrideCursor(). Fixed Mac OS X compile time error by using GLint for temp. qdoc3: Added curly braces in switch statement for braindead compiler. qdoc: Added a build rule for the documentation - disabled by default. Doc: Added the qdoc manual to the repository for future maintenance. qdoc3: Fixed bug in creation of qt.pageindex. qdoc3: Added capability to create qt.pageindex. Incorrect property setter generated by dumpcpp for Microsoft Word 2007. Cocoa: Implement our own NSApplication subclass Cocoa: Menu in menubar stays highlighted qdoc: Made a temporary fix for comment highlighting. Doc: Tidied up the class layout and removed an unnecessary image. ...
| * Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1Fabien Freling2010-02-121-4/+5
| |\
| * | Fix QRegion under Mac OS X.Fabien Freling2010-02-121-1/+9
| | | | | | | | | | | | | | | Now it takes the intersection of QRects for the region to repaint instead of taking the bounding box.
* | | Merge remote branch 'origin/4.6' into qt-master-from-4.6Thiago Macieira2010-02-121-1/+4
|\ \ \ | |_|/ |/| |
| * | Fixed compilation with QT_NO_WHEELEVENTDenis Dzyubenko2010-02-101-0/+3
| | | | | | | | | | | | Reviewed-by: Prasanth
| * | Cannot drag actions in Designer on Mac OS X/Cocoa.Prasanth Ullattil2010-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMimeData sub classes reimplementing the formats() might not expose the temporary "application/x-qt-mime-type-name" mimetype used by DnD. So make sure that the NSDragPboard PasteBoard will contain this dummy mime type. Task-number: QTBUG-7981 Reviewed-by: mortens
* | | Merge remote branch 'qt/4.6' into qt-master-from-4.6Qt Continuous Integration System2010-02-091-4/+5
|\ \ \ | |/ / | | / | |/ |/| | | Conflicts: src/gui/kernel/qcocoapanel_mac.mm src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
| * Improve raster graphics system performance on Mac (second try).Morten Johan Sørvig2010-02-041-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the qmlviewer "sluggish animations and lost mouse events" issue by making sure we don't block and wait for for the screen refresh when flushing the backing store to the screen. NB: This commit fixes build issues found in f5f62c0bed. Review: msorvig Details: - Don't force repaints, flush the backingstore in response to a Cocoa paint/display events only. - Flush once per window. - Get the CGContext from the window (don't create a new one) - Don't call CGContextiFlush on the context.
| * Carbon: crash problem in QWidgetPrivate::hide_sys, v2Richard Moe Gustavsen2010-01-291-0/+2
| | | | | | | | | | | | | | | | | | See change: f842ec12706. Needed some ekstra checks for the cocoa port as well. Task-number: QTBUG-4227 Reviewed-by: Prasanth (cherry picked from commit ebf9c943b789bb4ce1e1222ed17cc37bd0b1f1fe)
* | Carbon: crash problem in QWidgetPrivate::hide_sys, v2Richard Moe Gustavsen2010-01-291-0/+2
| | | | | | | | | | | | | | | | See change: f842ec12706. Needed some ekstra checks for the cocoa port as well. Task-number: QTBUG-4227 Reviewed-by: Prasanth
* | Merge branch '4.6'Thiago Macieira2010-01-211-1/+1
|\ \ | |/ | | | | | | Conflicts: tools/assistant/lib/qhelpsearchquerywidget.cpp
| * Cocoa: Fix painting errors on QGLWidget resizing.Morten Johan Sørvig2010-01-201-1/+1
| | | | | | | | | | Enable the patch in my previous commit. (remove "if 0")
* | Merge branch '4.6'Thiago Macieira2010-01-131-1/+8
|\ \ | |/ | | | | | | | | | | | | | | | | | | 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
| * Cocoa: Fix painting errors on QGLWidget resizing.Morten Johan Sørvig2010-01-081-0/+7
| | | | | | | | | | | | | | Revby: Trond We need to update the GL context syncronously during the resize to prevent flicker. Use the existing MacGLWindowChange machinery to do that.
| * Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Merge branch '4.6'Thiago Macieira2009-12-261-4/+7
|\ \ | |/ | | | | | | | | | | Conflicts: examples/webkit/fancybrowser/main.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp tools/assistant/tools/assistant/bookmarkmanager.cpp
| * Drag and drop icon not updated correctly in Cocoa.Prasanth Ullattil2009-12-211-3/+6
| | | | | | | | | | | | | | | | | | | | QDragMoveEvent is compressed using the answer rect in QCocoaView. The result of the last sendEvent is saved, so that we dont have to generate a new event always. This saved result was not updated correctly when the event was ignored. Task-number: QTBUG-5186 Reviewed-by: Richard Moe Gustavsen
| * Fixed wheel event delivery in graphicsview.Denis Dzyubenko2009-12-161-1/+1
| | | | | | | | | | | | | | We don't need to flip the y-coordinate of window- and view-local coordinates because they are flipped already. Reviewed-by: Prasanth
* | Cocoa: scrolling viewports containing many widgets is slowRichard Moe Gustavsen2009-12-091-0/+4
| | | | | | | | | | | | | | | | | | One of the reasons is that [NSView resetCursorRects] is called for each view, also the ones not actually visible. And the function is slow. This patch does an early check, and bails out if this is the case. Reviewed-by: Prasanth
* | Fix performance issue with live resizeRichard Moe Gustavsen2009-12-071-0/+4
| | | | | | | | | | | | | | | | | | | | Calling [NSView addTrackingArea] is slow. So doing this for views that are not even visible on screen is unnecesary. This patch will greatly improve the speed for some (perhaps extreme) cases. Task-number: QT-1610 Reviewed-by: MortenS
* | Cocoa: impl. performance boost for dndRichard Moe Gustavsen2009-12-041-59/+9
|/ | | | | | | | | | | | | | It turns out that registering drag types for each NSView that can receive drop events is _really_ slow. And many widget in Qt subscribe for DnD (QTextEdit, QScrollArea, etc), so the result is an application that will spend startup time preparing for DnD. For some edge cases, we're talking several seconds! This patch removes this overhead by moving drag type registering out of NSView, and into NSWindow (that is, QCocoaWindow and QCocoaPanel). Task-number: QT-1586 Reviewed-by: Prasanth
* Ensure the button state is correct when creating a QWheelEvent on Mac.Andy Shaw2009-12-031-1/+1
| | | | | | | | | On Mac when we receive a scrollWheel event on Carbon or Cocoa then we need to use QApplication::mouseButtons() in order to ensure the QWheelEvent has the right button states set. This is because the buttons state information is not passed in the native event at all. Reviewed-by: MortenS
* Improved mouse wheel event delivery on Mac.Denis Dzyubenko2009-12-031-2/+9
| | | | | | | When a popup is open we should not deliver wheel events to widget outside of the popup - native Cocoa applications don't do that. Reviewed-by: Richard
* Improved implicit mouse grabbing on Cocoa.Denis Dzyubenko2009-12-021-6/+9
| | | | | | | | This improves 106121a74bca32a6411b9ca968ee415f8bdfbff1 which was incomplete and didn't work properly for comboboxes (or in general - when a popup window opens due to a mouse press). Reviewed-by: Prasanth
* Fixes implicit grabbing in Qt/CocoaDenis Dzyubenko2009-11-241-30/+21
| | | | | | | | When delivering mouse events in Qt/Cocoa set the implicit mouse grabber and deliver the event to it and do not try to propagate the event to the parent view. Reviewed-by: Prasanth
* Mac: Make gestures available when building Qt against SDK < 10.6Richard Moe Gustavsen2009-11-231-2/+6
| | | | | | | | | | | We build the release packages for Carbon against the 10.4 SDK. This means that the constants used for dealing with gestures are missing, and currently the implementation will be ifdeffed out. This patch defines these constants when building with an SDK < 10.6. Gestures will therefore work when running applications on 10.6. The same fix is also implemented for cocoa. Rev-By: MortenS
* Incorrect DropAction returned by QDrag::exec() on Cocoa.Prasanth Ullattil2009-11-201-1/+1
| | | | | | | | | | The action performed by the latest drag and drop operation is stored in the global DnDParams structure. The QDrag::exec() return value has to be fetcted from this global variable instead of the temporary copy on stack. Commit 0d231c32cc7670d356d486b13648cb5bd471ffef broke this. Task-number: QTBUG-6001 Reviewed-by: Denis
* Ensure that button returns 0 for mouse move eventsDean Dettman2009-10-291-4/+3
| | | | | | This was a platform regression for the cocoa platform Reviewed-by: Prasanth
* Implement support for wheel delta with finer resolution than 15 deg.Richard Moe Gustavsen2009-10-271-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | At the moment, Qt, in many places, does not really understand that a mouse wheel, or touch pad, might operate on a much higher granularity than 15 degrees (that is, a delta of 120). This is clear disadvantage on mac, since the mighty mouse, and track pad, got a resolution that is close to 1 degree. This is called pixel scrolling. This patch first and formost changes the implementation of QAbstractSlider::wheelEvent to _really_ understand what to do when delta is less than 120. Rather than accumulate delta until 120 is reached, then scroll with a value equal to: offset * step * QApplication::wheelScrollLines (default = 3), we multiply offset directly, before waiting for 120. This means that event tough offset is below 120, multiplying it with wheelScrollLines and step will very often give a value over 120, menaing we can scroll much earlier and _much more_ fined grained. This also fixes some auto tests that was ifdeffed out because of specialised mac code written inside this function from before. (NB: we still plan to introduce a new event for pixel scrolling, perhaps for Qt-4.7) Rev-By: Andreas Rev-By: denis
* Remove debug outputEskil Abrahamsen Blomfeldt2009-10-221-1/+0
| | | | | | Oops. Reviewed-by: Trust me
* Honor graphics system on Mac/Cocoa when exposing and resizing windowEskil Abrahamsen Blomfeldt2009-10-221-0/+8
| | | | | | | | | | | | | | When exposing or resizing a previously hidden window on Cocoa, we would go through the CoreGraphicsPaintEngine even when a different graphics system was set. This was because there were two different paths from the windowing system into our paint event. The one going through the virtual drawRect function in QCocoaView did not honor the graphics system. This patch makes sure the backing store is used for these types of events as well. Done with: Gunnar Reviewed-by: MortenS
* Merge commit 'origin/4.5' into origin/4.6Olivier Goffart2009-10-151-11/+11
|\ | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qcocoaview_mac.mm src/network/access/qhttpnetworkconnection.cpp src/opengl/qgl_qws.cpp src/opengl/qglpixelbuffer_egl.cpp