summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindow.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Made window orientation API more flexible.Samuel Rødal2012-01-241-23/+79
| | | | | | | | | | | | | | | Previously we only had QWindow::setOrientation() which was a hint about the orientation the window's contents were rendered in. However, it's necessary to separate between the orientation corresponding to the window buffer layout and orientation of the contents. A game for example might typically want to use a landscape buffer even on a portrait device. Thus, we replace QWindow::orientation() with QWindow::reportContentOrientationChange() and QWindow::requestWindowOrientation(). Change-Id: I1f07362192daf36c45519cb05b43ac352f1945b5 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make it possible to compile with -no-opengl.Andreas Holzammer2012-01-241-0/+2
| | | | | | | | | | | | | This takes out the dependency to the header files of OpenGl. The ifdef QT_NO_OPENGL in the opengl headers are needed, as qmake adds depends in the makefiles for all GUI headers. Task-number: QTBUG-23207 Change-Id: If31448ee35fd8c39194c7cb7d62273fbc6def883 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Docs: Fix typo in the QWindow class documentationAnselmo L. S. Melo2012-01-201-1/+1
| | | | | | | | It was 'windw' instead of 'window' Change-Id: I3a7b361a22e4ea09ee1fb3d9b551c1a88d401ff1 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Added application flags to translate between touch and mouse events.Samuel Rødal2012-01-131-34/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current way we do it of having the platform or touch plugin send both mouse and touch events is not ideal. There's no good way to write an application that works sanely both on a touch-only device and on a desktop except by restricting yourself to only handling mouse events. If you try to handle touch events you don't get any events at all on desktop, and if you try to handle both, you end up getting duplicate events on touch devices. Instead, we should get rid of the code in the plugins that automatically sends mouse events translated from touch events. This change enables that by making the behaviour fully configurable in QtGui. Two new application attributes are added to explicitly say whether unhandled touch events should be sent as synthesized mouse events and vice versa, and no duplicates are automatically sent as the current situation. Synthesized mouse events are enabled by default. We also get rid of the QTouchEvent::TouchPoint::Primary flag, which was only used to signal that the windowing system automatically generated mouse events for that touch point. Now we only generate mouse events from the first touch point in the list. Change-Id: I8e20f3480407ca8c31b42de0a4d2b319e1346b65 Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com> Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@nokia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Make show() default to sane sizing behaviour based on the platform.Samuel Rødal2012-01-121-4/+18
| | | | | | | | | | | | | | | | Traditionally it's been hard to write a Qt app that behaves sanely across embedded and desktop platforms, i.e. defaults to fullscreen on embedded and non-fullscreen on desktop. For Qt 5 we can fix this by making the behaviour of the default QWindow::show() be customizable by the platform plugin. If the application developer wants to override this behaviour he can still use the explicit showFullScreen(), showNormal() etc functions. Change-Id: I26a907b404058e345d841c818daefbb57a26d3fd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add touchEvent() virtual to QWindow.Laszlo Agocs2011-12-121-0/+9
| | | | | | | | | | | Unlike keyPressEvent(), mousePressEvent(), etc. the touch events had no equivalent so one had to fall back to reimplementing event() or using an event filter. This is now corrected by introducing touchEvent(). Touch events are finally becoming a first-class citizen in Qt 5. Change-Id: Ia2044030154fd5b1b5384f08a3cb1749b798435f Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Added minimal class docs for QWindow to make it visible.Gunnar Sletta2011-12-021-0/+20
| | | | | Change-Id: Ibed2279ba5454547fb4060005e805a11221b3732 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Added screenChanged() signal and handle screen destruction in QWindow.Samuel Rødal2011-11-291-2/+24
| | | | | | | | It can be useful to get a signal when the QScreen changes, for example when having bindings to QScreen properties in QML. Change-Id: I919dd12c656485b28b393aec5eedac4c01593afc Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Add some properties to QWindowAlan Alpert2011-11-221-0/+18
| | | | | | | | x,y,width,height,visible and orientation Includes slot setters and notify signals for maximal QML compatibility. Change-Id: I124399093c00f8ad1485d4fbae816dfbe3027eff Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Get rid of unused inputMethodEvent functionJoona Petrell2011-11-211-4/+0
| | | | | | | | | In Qt5 input method events are meant to be sent directly to QInputPanel::inputItem() instead of the focused QWindow. Change-Id: Idc8fe458973f066b578f6374ca33ce6f950bf9cf Reviewed-by: Pekka Vuorela <pekka.ta.vuorela@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Adding a "helper assert" for when you can create QWindowJørgen Lind2011-11-151-0/+5
| | | | | | | | maybe if your trying to instansiate a QWindow before the QApplication has been instansiated. Change-Id: I68ed4ad1dbdfedc242a7cb27c1381d50a3d3dfa4 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* QWindow: Re-create platform window only if screen actually changes.Friedemann Kleint2011-10-221-6/+10
| | | | | Change-Id: I3b7dd8b1307aa3cc9357dca861ea407644c5a2e9 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Add virtual QWindow::focusObject() methodLars Knoll2011-10-221-0/+9
| | | | | | | | | | The method allows to retrieve the object that currently has the input focus inside the Window. This is e.g. required to correctly determine the context for keyboard shortcuts. Change-Id: I9e05ef62717973bac275ce34cc70fb86aa2d1e5b Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Added Orientation API to QScreen and QWindow.Samuel Rødal2011-10-071-0/+35
| | | | | | | | | | | | QScreen now has a primary and current orientation, and a QWindow can set its orientation as well. The current screen orientation is just a hint to the application. Change-Id: I4635982cfac2d16634d4edd5c6ab78e9d0ac55a4 Reviewed-on: http://codereview.qt-project.org/5988 Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com> Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Added QWindow::isActive() and focus in / out events.Samuel Rødal2011-10-051-5/+67
| | | | | | | | | | | Renamed QGuiApplication::activeWindow() to QGuiApplication::focusWindow(), implemented QWindow::isActive() as a style hint, and added focus in / out events. Change-Id: I71866e76c5a817def3e17bcc20a4fc32081a0e7a Reviewed-on: http://codereview.qt-project.org/5811 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Implement showFullScreen, showNormal, and showMaximized/Minimized in QWindow.Alexis Menard2011-10-041-4/+9
| | | | | | | | | | The implementation was just missing to call the proper APIs. Merge-request: 65 Change-Id: I52f7825360bf55d37762421562484af684bf2dc8 Reviewed-on: http://codereview.qt-project.org/5986 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Added QWindow::requestedFormat()Gunnar Sletta2011-10-031-0/+15
| | | | | | | Change-Id: I9e69ddd8ceefeda87216fb3d2507c40bc7220cf5 Reviewed-on: http://codereview.qt-project.org/5846 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Refactor accessibility for Qt5Jan-Arve Saether2011-09-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | * Moved most stuff to gui\accessible * Moved widget-specific stuff to widgets\accessible * Moved platform-specific code to either the bridge plugin (this was already the case) or to the platform plugin. * Added several classes and functions. These have not yet gone through an API review. The plan is to do that in a later commit. Classes: - QPlatformAccessibility - QWindowsAccessibility Functions: - QWindow *QAccessibleInterface::window(); - QPlatformAccessibility *QPlatformIntegration::accessibility() * The bridge code can now either be a plugin or integrated into the platform plugin * Mac accessibility is left out for now. Unix "should still work" (tm). These platforms should be fixed soon. Change-Id: Ib49ffa73b647ee0af90864544c2769440157f562 Reviewed-on: http://codereview.qt-project.org/5330 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com> Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Implemented QWidget's move() vs setGeometry() distinction in QWindow.Samuel Rødal2011-09-231-0/+60
| | | | | | | | | | | | | | QWidget's move() sets the position of the window including the window frame, unlike setGeometry(). There was no equivalent for this in QWindow, so several QWidget auto-tests were failing. Now we add setFramePos() to achieve the same purpose in QWindow. This fixes tst_QWidget::windowState(), which uses move(). Change-Id: I9a3e558bd615a8f0234cc3dd94fbb2bf5ecbc148 Reviewed-on: http://codereview.qt-project.org/5405 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fixed geometry issues.Samuel Rødal2011-09-231-0/+8
| | | | | | | | | | | We need to compare against the window's currently known geometry to know when to send resize and move events. Also make sure at least one resize event is sent, instead of sending one before each expose. Change-Id: Id7ebe4c1c0e723af9198c668a0c736d64efdbf3e Reviewed-on: http://codereview.qt-project.org/5364 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Return the correct geometryLars Knoll2011-09-211-0/+2
| | | | | | | | | | | | | When the platform window is created, it is the authorative source for geometry information. It would however be better if we could completely avoid duplicated places for the geometry data. Change-Id: Id90b24b9c40acb57f3d11b8b927292c06bac335e Reviewed-on: http://codereview.qt-project.org/5258 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Say hello to QWindow::accessibleRoot()Jan-Arve Saether2011-09-191-0/+9
| | | | | | | Change-Id: I1efa71f01f8af46c9addf2aae21e4b6fc086ad2e Reviewed-on: http://codereview.qt-project.org/5087 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Fix stale license headers from refactor branchJason McDonald2011-09-151-17/+17
| | | | | | Change-Id: I38cd941202641f50bf632af35165a944d03a20e3 Reviewed-on: http://codereview.qt-project.org/4848 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix try #2 at QSurface missing a virtual destructorJani Uusi-Rantala2011-09-061-0/+4
| | | | | | | | | | All virtual base classes with accessible destructor should declare the destructor as virtual too. Change-Id: I2b07c7e824612af072d7802095d958dca8cc34c8 Reviewed-on: http://codereview.qt.nokia.com/4274 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Copy core GL functionality to QtGui with QGL -> QOpenGL naming.Samuel Rødal2011-08-291-2/+2
| | | | | | Change-Id: Ibc989afa4a30dd184d41d1a1cd89f97196e48855 Reviewed-on: http://codereview.qt.nokia.com/3710 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* QWindow::mapToGlobal/mapFromGlobal and move()Gunnar Sletta2011-08-291-0/+35
| | | | | | | Change-Id: If1909b9ce468a8708cb25d5a2fbe8ebd90bd958a Reviewed-on: http://codereview.qt.nokia.com/3702 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Preliminary change to get resizeEvents for QWindow::resize() callsGunnar Sletta2011-08-241-1/+2
| | | | | | | Change-Id: I43e1d7fb98f1b20939dba8cdccffa4dcb99a7369 Reviewed-on: http://codereview.qt.nokia.com/3453 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Fixed empty if statement in QWindow.cppOlli Werwolff2011-08-221-1/+1
| | | | | | | Change-Id: Ib324eb30da1e16f01b9655ed293244fb50b621b8 Reviewed-on: http://codereview.qt.nokia.com/3289 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Implement "quit on last window closed" logic for QWindowGunnar Sletta2011-08-111-2/+30
| | | | | | | Change-Id: Ide33578ad60796f3e267b09be76cda87eaf873d0 Reviewed-on: http://codereview.qt.nokia.com/2827 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Made QWindow::setVisible() send show and hide events.Samuel Rødal2011-08-101-2/+19
| | | | | | | Change-Id: Ideae15f7bd6801d7afe2354627c0893b0b6a32ca Reviewed-on: http://codereview.qt.nokia.com/2741 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Added some convenience to QWindowGunnar Sletta2011-08-051-0/+13
| | | | | | | Change-Id: I367f5e3f586661322184cfa5f7653814569cb6e3 Reviewed-on: http://codereview.qt.nokia.com/2611 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* QWindow: Do not call setters for window state, type etc in creation.Friedemann Kleint2011-07-261-7/+0
| | | | | | | | | | | | | | Remove the need to do housekeeping and comparison of window types, etc in the platform window setters. They can safely assume the flags have really changed and something (potentially recreating the window) has to be done. createPlatformWindow() must then query all parameters from QWindow and apply them. Change-Id: I497060ba46a955cad1fa3cbb5eb91438a420b80e Reviewed-on: http://codereview.qt.nokia.com/2198 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Added workable QScreen API on top of QPlatformScreen.Samuel Rødal2011-07-251-1/+33
| | | | | | | | | | | | | | | | | | | | | QPlatformIntegration::screens() no longer has to be implemented, implementations should call QPlatformIntegration::screenAdded() for each screen instead. This is for being able to support adding screens at run-time later on, by connecting it to a signal in QGuiApplication. The QGuiGLContext API has changed a bit, by not sending in all the parameters in the constructor but instead having a create() function. The createPlatformGLContext() factory in QPlatformIntegration takes a QGuiGLContext * instead of a QSurfaceFormat and a share context, similar to how the window and backing store factory functions work. The XCB plugin has experimental support for connecting to multiple X displays simultaneously, creating one or more QScreen for each. Change-Id: I248a22a4fd3481280710110272c04a30a8021e8f Reviewed-on: http://codereview.qt.nokia.com/2103 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Reintroduce QWindow::SurfaceTypeMorten Sorvig2011-06-221-0/+12
| | | | | | | On Cocoa it makes sense to distinguish between the two window types. Reviewed-by: Samuel
* Made QExposeEvent public and added exposeEvent() in QWindow.Samuel Rødal2011-06-221-0/+8
| | | | This is needed for applications that use QBackingStore directly.
* OpenGL API refactor.Samuel Rødal2011-06-211-27/+11
| | | | | | Rename QGuiGLFormat to QSurfaceFormat, and make QWindow sub-class of QSurface and QPlatformWindow sub-class of QPlatformSurface, instead of having QPlatformGLSurface accessor in QWindow.
* Rename QWindowSurface -> QBackingStore and split into platform / public.Samuel Rødal2011-06-211-10/+0
| | | | Also get rid of GL window surface and related classes.
* Make glx wayland backends working.Laszlo Agocs2011-06-201-0/+1
|
* Added frameMargins() API and support in XCB plugin.Samuel Rødal2011-06-101-0/+8
|
* QWindowContext / QWindowFormat refactor.Samuel Rødal2011-06-101-19/+13
| | | | | | | | | | | | | To enable having a single GL context used for multiple drawables we need to de-couple the context class a bit more from the window class in the plugin API. Now contexts are created stand-alone based on a GL format and a share context, and when calling makeCurrent() a desired surface is specified. This maps well to GLX, EGL, Cocoa, AGL, and WGL, which all support this use case. QWindowContext is renamed to QGuiGLContext, and QWindowFormat is renamed to QGuiGLFormat. We have the ability to introduce a pbuffer or similar other offscreen GL drawable abstraction in the future.
* Made tst_QWidget::updateWhileMinimized() pass.Samuel Rødal2011-06-061-0/+8
| | | | | | | | | | This requires adding a couple of window system interface events, namely Map, Unmap, and Expose. When a widget is minimized on X11 it is unmapped, and thus update requests should not be delivered. Instead the event will delivered when the widget is mapped, which causes an Expose event to be sent. The Unmap and Expose event thus need to be handled in QWidgetWindow, and Map is also added for the purpose of API symmetry (and for future needs).
* Add support for mouse and keyboard grab.Laszlo Agocs2011-06-031-0/+16
| | | | Reviewed-by: Samuel Rødal
* Fix isTopLevel() in QWindow.Laszlo Agocs2011-05-311-1/+1
| | | | | | | | This also makes modal hints set properly for dialogs so the additional checks during active window change are not needed anymore. Reviewed-by: Samuel Rødal
* Added QWindow::setTransientParent().Samuel Rødal2011-05-231-4/+19
| | | | | Make the transient parent relationship explicit instead of having it encoded through the window flags.
* Remove superfluous setter / getter for QWindowFormat in QWindow.Samuel Rødal2011-05-231-11/+0
|
* Add QGuiApp::topLevelAt and fix visibility flagLars Knoll2011-05-221-2/+8
| | | | | | | Add and remove windows to the list of top level windows. Correctly set the visibility flag for windows and implement a QGuiApplication::topLevelAt() method that uses the QPlatformScreen.
* Added QGuiApplication::activeWindow().Samuel Rødal2011-05-201-0/+3
|
* Better setWindowFlags() support in XCB window.Samuel Rødal2011-05-191-3/+0
| | | | | We need to re-create the native window in setParent, as used to be done in QWidgetPrivate::setParent_sys in qwidget_x11.cpp.