summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
Commit message (Collapse)AuthorAgeFilesLines
* Avoid corruption in Q(Open)GLFunctions when used on multiple threadsLaszlo Agocs2014-05-092-2/+6
| | | | | | | | | | | | | | | | | | | Using Q(Open)GLFunctions concurrently on multiple threads had some issues due to incorrect synchronization: The m_groups list in the QOpenGLMultiGroupSharedResource, in which the Q(Open)GLFunctions instance is stored, became corrupted under certain scenarios, for example in the tst_qglthreads autotest and any two threads that happen to enter an initializeOpenGLFunctions() or QOpenGLContext::functions() call concurrently. Locking in value() has been introduced in 666c25c089acf7fcc9e9a6b7665074c6286d604e to fix such issues, however using the context group's mutex is not enough: that still allows two threads using two contexts with a different context group to concurrently enter insert(). Instead, the MultiGroupSharedResource has to have its own mutex to protect its own member variables. Task-number: QTBUG-38771 Change-Id: If01c44c2084b95e487bc9146576ca180ed8044da Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2014-05-032-8/+2
|\ | | | | | | | | | | | | Manually fixed up: isES -> isOpenGLES src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp Change-Id: I57d2ef26c3d4a7b40ace09f4e8560b7686650ea5
| * Revision new signalAlan Alpert2014-05-021-1/+1
| | | | | | | | | | | | | | | | | | As it's meant for QML anyways, this allows it to coexist peacefully with existing code. Task-number: QTBUG-29806 Change-Id: Ib04993f47eb2f9f7fc49c4a5400f18f9682a7aaa Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * Remove old symbols from QOpenGLContextLaszlo Agocs2014-04-261-7/+1
| | | | | | | | | | | | Task-number: QTBUG-38564 Change-Id: I39a0482e4411cdc644ed34813626c39dacb5b6af Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Don't set the window title for a Qt::Desktop window (QDesktopWidget)Thiago Macieira2014-05-021-1/+1
| | | | | | | | | | | | | | | | | | | | The desktop doesn't belong to this application, we shouldn't be setting it (assuming it is even possible). On X, for example, it's possible to set the name and you end up with the root window having _NET_WM_NAME pointing to the last application that created a QDesktopWidget. Change-Id: Ib62d0a4d56a4d2a74afc6b33fa607867343e7aba Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* | Merge "Merge remote-tracking branch 'origin/release' into stable" into ↵Frederik Gladhorn2014-05-023-13/+19
|\ \ | | | | | | | | | refs/staging/stable
| * | Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2014-05-013-13/+19
| |\| | | | | | | | | | | | | | | | This merge adds the opengl rename. Change-Id: I84ea0b6abee9780ebb2cf3f64ab9e3fdf2acab3e
| | * Rename new QOpenGLContext APIsLaszlo Agocs2014-04-253-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | isES() becomes isOpenGLES(). The library type enums are changed DesktopGL -> LibGL and GLES2 -> LibGLES. This removes the now unnecessary version number, the confusing "desktop" term and provides better readability. The old function/values are kept until the related qtdeclarative changes are integrated. Task-number: QTBUG-38564 Change-Id: Ibb0a1209985f1ce4bb9451f9b7b093c2b68a6505 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Fix override cursor issue with QtQuick2ApplicationViewer.Kati Kankaanpaa2014-05-021-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | If the override cursor was set before QtQuick2ApplicationViewer was shown then the cursor was the default cursor and not the override cursor. The new cursor was applied only if the window was visible and the cursor has been set. Now the cursor is applied also if override cursor is set. Change-Id: I88618c719e43b2802e209bef440461c532d19f48 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Merge "Merge remote-tracking branch 'origin/release' into stable" into ↵Jani Heikkinen2014-04-252-4/+18
|\ \ | | | | | | | | | refs/staging/stable
| * | Merge remote-tracking branch 'origin/release' into stableJani Heikkinen2014-04-232-4/+18
| |\| | | | | | | | | | Change-Id: Id13b4a3803664692f32f9d57549be8a0c4a08567
| | * When a window loses focus to a popup, event has PopupFocusReasonShawn Rutledge2014-04-171-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Followup to debe31e047060d790fb32c06e514d9df476df8bf : a popup window can have focus, but a QQuickWindow needs to know why it loses focus when a menu is opened, so that for example copy/cut/paste Actions can apply to the text which did have focus before the menu opened. The event's focus reason provides enough information to deal with this situation. Task-number: QTBUG-36292 Task-number: QTBUG-36332 Change-Id: Ifae999a364a61b125a4764c9db204a167bddf0b7 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
| | * Remove internal public function from QOpenGLFunctionsLaszlo Agocs2014-04-171-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QOpenGLContext uses glGetTexLevelParameteriv on desktop OpenGL and so it got recently added to QOpenGLFunctions as part of the dynamic GL loading support. This is unnecessary since such desktop-only code can use the versioned wrappers (QOpenGLFunction_1_0 for example). In related upcoming changes in 5.4 the function is removed. This change has to be backported to 5.3 to prevent introducing this public API unnecessarily. Change-Id: I6fc331091e4e6416e430bf985afcc17a392fc2e3 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | | Remove unneeded ;Albert Astals Cid2014-04-241-1/+1
|/ / | | | | | | | | | | | | Warnings returned by pedantic Change-Id: I501621df6e9f39b18576625b321714a862dc971a Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* / QPA: Adding API to support QWidgetAction on MacGabriel de Dietrich2014-04-171-0/+5
|/ | | | | | | | | Includes the Cocoa implementation. Task-number: QTBUG-19840 Change-Id: Id33bc8053b82116cf76ed591b6df823df3aef9bc Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* OS X: Add more text editing key bindings.Morten Johan Sørvig2014-04-092-17/+25
| | | | | | | | | | | | | | | | | | | | | ctrl + K : Cut ctrl + Y : Paste ctrl + F : Cursor right ctrl + B : Cursor left ctrl + N : Cursor down ctrl + P : Cursor up ctrl + V : Cursor next page ctrl + O : Insert line separator (ctrl as in the key, not Qt::CTRL) These are low-priority (0) key sequences. Add them to the end of each StandardKey range and change the priority of an existing item to 1 where it makes sense. Task-number: QTBUG-32837 Change-Id: Id321e6c6ad4277d729b27297a1de66c4628e4201 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Correct QOpenGLContext::versionFunctions() docsLaszlo Agocs2014-04-091-4/+6
| | | | | | | | | | | The example is incorrect: no context parameter is needed. There was also no mentioning of the fact the the context must be current at the time of calling initializeOpenGLFunctions(). This is corrected too. Change-Id: If8695140096e4b4f84927579c099b0af80750703 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QGuiApplication: fix crash caused by posting fake mouse eventRichard Moe Gustavsen2014-04-071-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since Qt expects a mouse press/release event to not change mouse position in the same event, QGuiApplicationPrivate::processMouseEvent will detect if a QWindowSystemInterfacePrivate::MouseEvent tries to do this and convert it to two events; one move and one press/release. The problem is that the extra mouse event gets posted. So if delivering the first event causes a flush in the event queue (which can easily happen if e.g calling processEvents), the second event will be processed before the first returns. On iOS we see a crash with DnD as result of this, since drag data gets deleted on mouse release, and returning back to a mouse move after that will cause dangling pointers. This patch will instead of posting the event, call the event handler recursively with the faked event as argument. That way a flush will not cause the "pending" event to be delivered. Change-Id: Id9d88053b4859083fedd666584815016d67ac51b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* OSX: add several menuitem roles to support menu shortcuts in dialogsShawn Rutledge2014-04-071-1/+5
| | | | | | | | | | | | | | | | | | | | | Now menu items and key shortcuts for Cut, Copy, Paste and Select All work in the standard ways in dialogs such as the file dialog, provided that the corresponding QActions have been created and added to the menu. This depends on new roles to identify each menu item which is so broadly applicable that it should work even when a native widget has focus; but the role will be auto-detected, just as we were already doing for application menu items such as Quit, About and Preferences. When the QFileDialog is opened, it will call redirectKnownMenuItemsToFirstResponder() which will make only those "special" menu items have the standard actions and nil targets. When the dialog is dismissed, those NSMenuItems must be reverted by calling resetKnownMenuItemsToQt(), because to invoke a QAction, the NSMenuItem's action should be itemFired and the target should be the QCocoaMenuDelegate. Task-number: QTBUG-17291 Change-Id: I501375ca6fa13fac75d4b4fdcede993ec2329cc7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* QNX: Surpress manual window activation during showFullScreenFabian Bumberger2014-04-051-0/+3
| | | | | | | | | | When a window is shown, libscreen will give it keyboard focus. Requesting the activation right after the window is created (and before libscreen activated the window) causes problems on some devices e.g. Q10. Change-Id: I29f7a38990ea4259a8b0c6624f70e31d7291af00 Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
* Doc: Fix documentation warning in qstylehints.cppSergio Ahumada2014-04-041-1/+1
| | | | | | | | | | | warning: Command '\snippet (//! [6])' failed at end of file 'code/src_gui_kernel_qguiapplication.cpp' This change amends 56cd9cc2b085c1a2152831d47bb8fd9607d7500e Change-Id: I63a2f086fc582d3a9c8b60f1ef94ccb537b0d3a5 Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch> Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* purge vestiges of opengl es 1 supportOswald Buddenhagen2014-04-042-5/+1
| | | | | | | | amends 0d5170256c1. Change-Id: Ifa178d38f602bb7c66ef13334673ff47e332af5b Reviewed-by: Jørgen Lind <jorgen.lind@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Fixup QGuiApplication::sync to flush the QWSI queueJorgen Lind2014-04-041-0/+1
| | | | | Change-Id: If4cedeb886e912f622a66b2b3374d6260cffc32a Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Add a way to share context between QtQuick and QtWidgetsJocelyn Turcotte2014-04-022-0/+23
| | | | | | | | | | | | | This will replace QSGContext::setSharedOpenGLContext. To be able to allow sharing the Chromium GL context with both QWebEngineView and QQuickWebEngineView, we need some way of setting the sharing within QtWidgets and QtQuick. Since they don't depend on one another this patch allows the sharing context to be set through QtGui. Change-Id: I91b365dd06ec925b4c5a99ac82c222778781fe8e Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* If no screens, attempting to create a window results in clean exitShawn Rutledge2014-03-291-4/+7
| | | | | | | | | | | Asserting is only relevant for debug builds, and there were a couple of other places that a segfault would typically occur before the assert had a chance. Change-Id: I1abc82eb3ecfa91050117fab1525f4cbd82ff486 Task-number: QTBUG-37876 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Fix race condition in QOpenGLMultiGroupSharedResourceLiang Jian2014-03-271-0/+1
| | | | | | | | | | | | | In QOpenGLMultiGroupSharedResource::value(), the m_resources memeber of opengl context group will be checked and may be inserted a new value. This function may be called from different threads with the same opengl context group object: Think about that OpenGL context A and B are shared, they live in different thread, and in each thread we call QOpenGLContext::functions() to the context, that may cause the race I mentioned above. So I put a QMutexLocker to prevent race condition. Change-Id: I101a28f46b2af72b3094a9945880efeb3563482a Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Enhance QOffscreenSurface docs wrt the formatLaszlo Agocs2014-03-271-0/+8
| | | | | | | Prevent nasty surprises on some EGL implementations. Change-Id: I0c6c8a6c631d4dcb979afd81a150491a42aa63f8 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Fix some documentation errors.Friedemann Kleint2014-03-245-10/+10
| | | | | | | | Correct links and fix typos, remove obsolete documentation, fix some snippets, mark some classes as internal. Change-Id: I9a3266605f060783413d32740057a57a820c8929 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* QGuiApplication: send TouchCancel when touch is interrupted by popupShawn Rutledge2014-03-211-0/+12
| | | | | | | | | | | | | QQuickWindow depends on maintaining state of known touch points between events, so it needs to be notified when it will not be receiving the corresponding release event for one or more. This temporary fix needs to be reverted when we have a proper event forwarding solution. Task-number: QTBUG-37371 Change-Id: I5dc40af6feac425be8103c1586f8ebe3a6aad20d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* QPA: Fix QPlatformTheme::Palette enum value spellingGabriel de Dietrich2014-03-211-0/+1
| | | | | | | | | We keep the old value for source compatibility, but it should probably be removed at some point as the QPA API is semi-public only. Change-Id: I06e4c9ca1d8bb878411ad79ef409d60ce2d29f4a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Return false on context creation failureLaszlo Agocs2014-03-201-3/+3
| | | | | | | | | | | | | | Make QOpenGLContext::create() return false when the native context could not be initialized. This way the return value and isValid() become equivalent. Relying on on having a non-NULL platform context is not enough, many platforms will return a new instance even if the underlying platform code failed to create a native context. To ensure that a platform context is really usable, isValid() has to be checked too. Change-Id: I6b4e9fdb24347ad52fbd6edbb8d144d51e16c301 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QOpenGLContext: Use color depth information from QSurfaceFormatKurt Pattyn2014-03-191-0/+12
| | | | | | | | | | | When a new QOpenGLContext is requested, the color depth information is now also taken into account on OS X and WGL. Task-number: QTBUG-37411 Change-Id: I69d04989a20de3ace041b009fbbdc03fa02cfdf8 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Docs: Clarify QOpenGLFunctions::functions()Laszlo Agocs2014-03-151-0/+3
| | | | | | Change-Id: Ifb6fdc3de7f93a1632b396eaaa14078546cac4dd Reviewed-by: Jørgen Lind <jorgen.lind@digia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* correct send vs sent grammarDavid Fries2014-03-141-5/+5
| | | | | | | | Correct the tense of send vs sent in comments and documentation. Change-Id: I1c5ce9a7b1e49b8b0e8dcfde7d732e4c69acf73a Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Doc: correction link, example and parameter issues qtbaseNico Vertriest2014-03-102-13/+14
| | | | | | | | | | | | | Moved codecs folder to qtbase/examples Corrected quote in dropsite.qdoc Replaced snippet statement by include statement Added doc for undocumented parameters Task-number: QTBUG-34749 Change-Id: If4de95b8d39e5680fd0f63f8d2b6685a4b0a8052 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Avoid using direct OpenGL calls in gui and widgetsLaszlo Agocs2014-03-101-7/+8
| | | | | Change-Id: I5d88a2e204ca23e178a4e3044b9cb13392c3e763 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Android: Support double click eventEskil Abrahamsen Blomfeldt2014-03-103-2/+7
| | | | | | | | | | | | | | | | It's impossible to get the distance between two touch events down to 5 pixels on e.g. my Nexus 5. This patch makes it possible to tweak the distance through the platform theme, and sets the distance to 15% of an inch on Android. Also provides a way to override the default minimum of 5 pixels by using an environment variable. [ChangeLog][Android] Fixed double click events Task-number: QTBUG-36974 Change-Id: I23d94020c531747d6638b645133611614a2a0703 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Fix description of how themes are created (code comments)Fabian Bumberger2014-03-081-4/+5
| | | | | | Change-Id: I3b8ed0af5208687a9ab75e916b477f5e24b4d1e2 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* Clarify QOpenGLContext::format() docsLaszlo Agocs2014-03-071-0/+14
| | | | | | | | Avoid unrealistic expectations where applications would assume that requestedFormat() == format(). Change-Id: I12dcfda3d86ce26f1cae9771b1fe2203291864db Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Clarify QWindow::format() docsLaszlo Agocs2014-03-071-3/+11
| | | | | Change-Id: I35c5f9e7a235afc75c0051b3958875371f182b29 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Doc fixPaul Olav Tvete2014-03-061-6/+4
| | | | | | | | QOpenGLContext::destroy() is private. The recommended way to free resources temporarily is simply to delete the context. Change-Id: I0d59b55afb209d56405f3584e4645bd4718790af Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Make QOpenGLFunctions able to resolve everythingLaszlo Agocs2014-03-062-1/+12
| | | | | | | | | | | | | At least if the platform plugin's QPlatformOpenGLContext implementation supports it. This completes the QOpenGLFunction changes necessary for dynamic loading of the OpenGL implementation. Everything else is up to the platform plugin. Change-Id: I710e6fbee3005360ecf02bc6ef976e1beb513819 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Dynamic GL: Query gl handle and type via the native interfaceLaszlo Agocs2014-03-063-1/+45
| | | | | | Change-Id: I7ca5beaeb57ee2e4e9c175f53ac32371d1f6b5ed Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Don't assume a QBasicDrag will start and end over a QWindowTor Arne Vestbø2014-03-041-3/+2
| | | | | | | | | | | | A QBasicDrag is started from QBasicDrag::drag() through the drag manager, which may happen from e.g a widget. The event filter needs to look at events to more than just QWindows, otherwise the filter will miss eg. mouse release events that are sent to QWidget and not to the QWindow handle, and the drag goes on forever, causing invalid internal state when a new drag is then started. Change-Id: I5cee250e2c7552817bda0895d4c5794e12d26592 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Dynamic GL: remove exporting symbolsLaszlo Agocs2014-03-042-3/+85
| | | | | | | | | | | | | | | | | | | | | Remove the opengl proxy for now. Later it will either be moved into a separate library or replaced by a QOpenGLFunctions-based approach. This means that the -opengl dynamic configuration is not usable for the time being. The rest of the enablers remain in place. The convenience function QOpenGLFunctions::isES() is now moved to QOpenGLContext and is changed to check the renderable type. This is extremely useful since besides supporting dynamic GL it solves also the problem of GL_ARB_ES2_compatibility (i.e. it triggers the real ES path when creating an ES-compatible context with a desktop OpenGL implementation). Task-number: QTBUG-36483 Task-number: QTBUG-37172 Change-Id: I045be3fc16e9043e1528cf48e6bf0903da4fa7ca Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Fix crash in QSimpleDrag if drag wasn't started over a QWindowTor Arne Vestbø2014-03-041-2/+3
| | | | | | | | | The code in QSimpleDrag::startDrag() checks for the validity of the current window before passing it on to QWindowSystemInterface::handleDrag(), and so should QSimpleDrag::cancel(). Change-Id: I2228d86ede2a0b8379a55000a5c1d830cab44d45 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QTouchDevice Documentation grammar correction.David Fries2014-03-041-1/+1
| | | | | | Change-Id: I3b378f1c3df7210029cf82208c23b67b75c47021 Signed-off-by: David Fries <David@Fries.net> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Add source to debug output of QMouseEvent.Friedemann Kleint2014-02-281-3/+6
| | | | | Change-Id: Ibf55a2697ca0ac85624097299be92c1055dcb8aa Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* QPalette: optimize move assignment operatorMarc Mutz2014-02-281-2/+1
| | | | | | | | | | | | | Instead of assigning the various bit-fields manually, use the quint32 union field, which is already present to avoid slow bit-field operations in the member-swap function. Verifed that the generated assembly for move-assignment is significantly better than before on GCC. Change-Id: If4e0ef678bf3a496c6eb369ad3f639f5a9bc79fc Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add missing notify signal for the QWindow::title propertySimon Hausmann2014-02-272-2/+9
| | | | | | | | | | Similary to QWidget's windowTitleChanged, QWindow should also have a windowTitleChanges signal that's emitted when the title changed and declared as notify signal for the title property, so that QML bindings can be written against it. Change-Id: I6f107c6f0b43d6a959bc2ef96492e1f3e4c28bfe Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>