summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidgetwindow.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Clear qt_tablet_target in ~QWidgetWindow.Friedemann Kleint2013-10-181-0/+6
| | | | | | | Task-number: QTBUG-34007 Change-Id: If67563e5d9c4040256b58521773736e14db6fbaf Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Implement native gestures on OS X.Morten Johan Sørvig2013-10-171-0/+27
| | | | | | | | | | | | | | | Add QWindowSystemInterface::GestureEvent and QNativeGestureEvent to QtGui. These events are copies of Qt4's QNativeGestureEvent, where it was an implementation detail of QGestureManager. Add gesture message handlers to QNSView and bring back the Mac gesture recognizers for QGestureManager. Task-number: QTBUG-28126 Change-Id: I1304e09e776fa7c44d133d54ca8b895ca2f544c5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-141-2/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix ignoring closeEvents on OSX for QtQuick.Daiwei Li2013-08-031-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The QCloseEvent's accepted state should not be inverted for the QWindowSystemInterfacePrivate::CloseEvent. To make Widgets work with this change, pass whether the close was accepted from close_helper to the QCloseEvent generated by QGuiApplication. Task-number: QTBUG-28965 Change-Id: If384b0355776b93df02dff2ab78b5647903200e7 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Josh Faust <jfaust@suitabletech.com>
* | Introduce QWheelEvent::Phase (Begin, Changed, Ended)J-P Nurmi2013-08-081-1/+1
|/ | | | | | | | | | | | | | Some platforms (read: OS X) send wheel events without delta to indicate that scrolling is about to start or has ended. Currently, Qt simply ignores wheel events that have no delta. This change introduces a new QWheelEvent attribute that specifies the phase, and makes it possible to receive the special wheel events in started/ended phases. These events are required for implementing correctly behaving transient scrollbars. Change-Id: Ib8ce0d9ce9be63b2ad60aa7b0aaa1f12ef6cad09 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Widgets: Set qt_button_down for each press.Friedemann Kleint2013-06-241-1/+1
| | | | | | | | | Do not rely on release events. Task-number: QTBUG-31333 Change-Id: I09a056fed8892715c04ca78a42ae191e5a9a3b42 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* QWidgetWindow: Prioritize keyboard grabber over popup for key events.Friedemann Kleint2013-05-131-4/+2
| | | | | | | | | | Fix the inline editor of the QMenuBar in Qt Designer not working due to the key events being sent to the QMenu which is open at that time. Task-number: QTBUG-31059 Change-Id: Ic96bc119d0d2566d8f8d6ee62858445a70a447b7 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* QWidgetWindow: don't accept touch events while in popup modeRichard Moe Gustavsen2013-05-071-0/+4
| | | | | | | | | | | | | | | | | | | | QWidgetWindow will always redirect mouse events to the active popup (if any). The same logic is not implemented for touch events, which means that touch events are always delivered to the widget under the finger. It is therefore possible to interact with widgets that are modally shaddowed by the popup. It is also not possible to close popups without touching them directly. This patch will ignore touch events when a popup is active, and as such, force a synthesised mouse event to be sent instead. Implementing proper touch support also for popups is out of scope for widgets. Change-Id: I023c09c3e1fd4e5495df990c11419c69ecafb8f9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Widgets: Propagate 'accepted'-state of touch begin events.Friedemann Kleint2013-04-121-3/+5
| | | | | | | Task-number: QTBUG-29946 Change-Id: Ia9ac54251f52b6ae4b3d667e49b96441def72a57 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Fix license headers stating QtGui for QtWidgets files.Jake Petroules2013-03-191-1/+1
| | | | | Change-Id: I0ca49e3e1f9f603f0b0f7f3553e854b871efe303 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Implement XEmbed protocolAlberto Mardegan2013-03-061-0/+40
| | | | | | | | | | | | | | | | | | | Add a static QWindow::fromWinId(WId id) constructor which can be used to create a QWindow object representing windows created by other processes. Then, QWindow::setParent() can be used to embed a window into a foreign window socket and QWindow::setTransientParent() to stick the current window on top of a foreign window. The changes in the QtWidgets module ensure that the focus chain (TAB navigation) correctly works when a QtWidgets-based window is embedded into another application. As far as the platform implementation is concerned, this commit only implements the embedding functionality in the XCB plugin. So, this is roughly equivalent to the Qt4 QX11EmbedWidget functionality. Change-Id: Iff8f7b9ee974d33fb30f36056f7838b433a413c7 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Activate window before replay mouse press eventjian liang2013-02-201-0/+6
| | | | | | | | | | Activate the window of the widget under mouse pointer before replay mouse press event. Change-Id: I9e699374accf108aa49b2a3c73d5e76631100dfd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* replay mouse press event after a popup widget has been closedJian Liang2013-02-121-0/+15
| | | | | | | | | | | | | | If a popup widget(e.g. a popup menu) has been closed due to a mouse press event, the mouse press event will be consumed by the popup widget and the widget under the mouse pointer can't receive the event. This will lead to confusing behavior such as a push button under the mouse pointer is not been push down. This patch replay the mouse press event if a popup widget has been closed. Change-Id: Id493583dfea9e64ab2964e28d559122c43bbc2a6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Fix focus handling of native child widgets in xcb.Gunnar Sletta2013-01-241-1/+17
| | | | | Change-Id: If4d596195624011142bff6853849a23064e478df Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Minimized, maximized and fullscreen are mutually exclusive.Shawn Rutledge2013-01-111-0/+2
| | | | | | | | | | Only if minimized does QWidgetWindow need to remember the previous state. Maybe it's OK to restore from fullscreen to maximized though. Task-number: QTBUG-29030 Change-Id: I1e2724c8811366c9536a3e372ce281e8d473a4ac Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Fix keyboard grab in QWidgetWindow.Friedemann Kleint2012-11-261-0/+2
| | | | | | | Task-number: QTBUG-28070 Change-Id: I6f55a2dd906ee896071137a5d47fb97c9a571b5f Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
* Accept subsequent drag moves in QWidgetWindow if enter was accepted.Friedemann Kleint2012-11-161-0/+4
| | | | | | | | Add handling similar to QGuiApplicationPrivate::processDrag. Task-number: QTBUG-28008 Change-Id: I516531da242471cdfbb59418d0052b25f799f373 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Send enter to the child at the position of the QEnterEvent.Friedemann Kleint2012-11-141-2/+4
| | | | | | | | | | | | | This was apparently done so in each of the widget_<platform>.cpp in Qt 4.8. This then causes the cursor to be updated in dispatchEnterLeave() on Windows and Linux. Task-number: QTBUG-27871 Task-number: QTBUG-27585 Task-number: QTBUG-26424 Change-Id: Idf14cd96ccb36f7c2607853ed8b0024c36a5413c Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
* Add a QEnterEvent containing the mouse position.Friedemann Kleint2012-11-101-2/+4
| | | | | | | | | | | | | Enter handling requires knowledge of the mouse position. Extend the enter handling of QWindowSystemInterface to receive the position (implemented for Windows, XCB and Mac), passing it on to QEnterEvent. Dispatch QEnterEvent from widgets code. Change-Id: I49c07d2b1f46310c877017dd55d4cd7d636bdbce Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Do not call QWidget::show/hideEvent twiceOliver Wolff2012-11-081-0/+6
| | | | | | | | | | | | | | | | | | | | | While handling events for Widgets and Windows in QWidgetWindow::event makes sense for other events, it causes QWidget::show/hideEvent to be called twice when handled like "the rest". Having that as one case here seems to be the cleanest solution. Removing the call to showEvent from QWidgetPrivate::show_helper (as proposed in the bug report) causes autotests to fail and thus is not a viable option. Additionally the expected result for the task221221 test for QDoubleSpinBox was reverted to the Qt4 value as Qt4 behaviour was restored. Task-number: QTBUG-27199 Task-number: QTBUG-26424 Task-number: QTBUG-22565 Change-Id: I0ac42b09b1a7618de042d27aa5dd1b3d9f30f552 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* Fix inconsistent leave/enter events for main window when popup is openMiikka Heikkinen2012-11-061-1/+5
| | | | | | | | | | | | | Changed the platform leave event handling logic in QWidgetWindow to match platform leave event handling logic in Qt4, where last mouse receiver is used as leave target only if last mouse receiver wasn't a native window itself. In that case it is assumed to get leave event of its own when relevant. Task-number: QTBUG-27639 Change-Id: Id6edcd29754a15c959f18ab38b20d66e5d446510 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Send leave to most recently entered window when modal dialog is shown.Miikka Heikkinen2012-10-301-0/+1
| | | | | | | | | | | | | | | If a modal dialog was shown as a response to button click, the button retained its hover highlight, because it didn't get leave event. Fixed by tracking the most recently entered window and sending a leave to it when modal dialog is shown that blocks it. Also modified tst_QGuiApplication::modalWindow() autotest to check for enters and leaves. Task-number: QTBUG-27644 Change-Id: I387647e18a762a39d523e3df31221b9583a39f9d Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Fix enter/leave event generation between native widgets when grabbing.Miikka Heikkinen2012-10-261-3/+8
| | | | | | | | | | | Removed enter/leave event generation when moving between between related windows in QWidgetWindow (i.e. native widgets) while some widget was explicitly grabbing the mouse input. This makes enter/leave event generation identical to non-native widgets. Task-number: QTBUG-27551 Change-Id: I4996007bd7922e073a2957ad267a6373e8f3fecc Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Add ContextMenu event to QWindowSystemInterfaceMiikka Heikkinen2012-10-251-1/+34
| | | | | | | | | | | | | Context menu key wasn't working, as QPA had no handling for it. Added ContextMenu event to QWindowSystemInterface and proper handling to QGuiApplication and QWidgetWindow. Also provide Windows implementation. Task-number: QTBUG-27648 Change-Id: I7ce71ec4b5cdcc7be758e67f9faf6d863f7b19be Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Fix excess enter/leave event generation for native widgetsMiikka Heikkinen2012-10-191-2/+25
| | | | | | | | | | | | | | | | | | | | | | Native widgets have a native window each, so QPA plugin sends enter and leave events for associated QWindow whenever mouse cursor moves from one widget to another. QWidgetWindow had no context to interpret these events as moves from one widget to another, since they were sent separately. This resulted in leaves and enters for each widget in parent chain, when only the bottom child should have gotten them. Fixed by peeking into window system message queue when handling leave in QWidgetWindow and retrieving the entered window from queued enter event. Also provided a convenience function that QPA plugin can use to ensure both leave and enter events are in the event queue when moving from one QWindow to another. Task-number: QTBUG-27550 Change-Id: I74fec0ac90f6848495c2392c5f7e41624ad8aea2 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Fix drag and drop with native widgetsjian liang2012-09-271-4/+4
| | | | | | | | | | | | | | | Task-number: QTBUG-27336 Don't check 'widget != m_widget' in QWidgetWindow::handleDragEnterMoveEvent() since the current window's parent widget may be the actual drop target. I replace it with a check '!widget->isWindow()' to prevent we pass through a top level window. I also change 'widget->mapFrom(m_widget, event->pos())' to 'widget->mapFromGlobal(m_widget->mapToGlobal(event->pos()))' since m_widget may not be widget's parent. Change-Id: Ia4f10f85ccdf1e27223ddc51afabd98b5d16f2fb Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Fix build with QT_NO_WHEELEVENT.Sérgio Martins2012-09-101-0/+6
| | | | | Change-Id: I80c64183677a5f518e2c637f4c1ff4004e3010c0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix updating of drag icons.Friedemann Kleint2012-08-311-52/+63
| | | | | | | | | | | | Try to find a target widget that accepts drops; ignore the event if none can be found. Split the handleDrag*() functions to reduce indentation. Add an autotest. Task-number: QTBUG-22987 Change-Id: I516ac5f0c002caaf83c52ac16f821246e565230f Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Do not call markDirty() for hidden widgets.Samuel Rødal2012-08-061-1/+1
| | | | | | | | | | Fixed crash when resizing a scroll area with a native viewport (typically a QGLWidget) causes the scroll bars to get hidden, while there are still expose events in the queue for the scroll bar widget. Task-number: QTBUG-26746 Change-Id: Ia77c8eb32a6730670333120af3f9a772c64807f1 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* fix fullscreen state in QWidgetWindow::handleWindowStateChangedEventJoerg Bornemann2012-07-091-2/+0
| | | | | | | | | A widget can be Qt::WindowMaximized and Qt::WindowFullScreen at the same time. See tst_qwidget::windowState. Task-number: QTBUG-26420 Change-Id: I89d6edb857f41cda911152244cf23d36dfd1cdce Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove _qpa from cpp filenamesGirish Ramakrishnan2012-07-031-0/+592
36547f4eff44361f7a6acd0cff107c0e47561f93 removed the _qpa from .h files and promised to remove it from .cpp files at a later date. Change-Id: I24a5c3796f6b07dd9a1931b699f3212d315edb12 Reviewed-by: Andrew Stanley-Jones <andrew.stanley-jones@nokia.com>