summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
Commit message (Collapse)AuthorAgeFilesLines
* WinRT QPA: Fix mapping of static text accessibility roleAndre de la Rocha2018-08-171-1/+1
| | | | | | | | QAccessible::StaticText should be mapped to AutomationControlType_Text instead of AutomationControlType_Edit. Change-Id: If8c840f0dea553c1a750225586778a7d24cf424a Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* xcb: replace tiny helper function with an inline codeGatis Paeglis2018-08-171-8/+3
| | | | | | | | Having these 2 lines in a function does not add much value and requires scrolling that could be avoided. Change-Id: Ife814be6478521cd64b0048d1b6ee447afea55de Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* xcb: avoid unnecessary InternAtom requestsGatis Paeglis2018-08-175-12/+18
| | | | | | | | | | | | | QXcbConnection::internAtom() creates the atom if it does not exist. The lifetime of an atom is not tied to the interning client. Atoms remain defined until server reset (lost connection, restart). So create the atom once via QXcbConnection::initializeAllAtoms(), and later fetch the atom value from local array, instead of repeating InternAtom requests. Change-Id: I3cae21895febad6e5daf8c32e72612202baaad64 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Modernize the "thread" featureUlf Hermann2018-08-171-3/+3
| | | | | | | | | | Add it to configure.json and replace all occurrences of QT_NO_THREAD with QT_CONFIG(thread). Add conditions for other features that depend on thread support. Remove conditions where we can use the QMutex and QThreadStorage stubs. Change-Id: I284e5d794fda9a4c6f4a1ab29e55aa686272a0eb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.11' into dev" into ↵Liang Qi2018-08-163-59/+109
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-08-163-59/+109
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qconfig-bootstrapped.h src/plugins/platforms/xcb/qxcbbackingstore.cpp Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Change-Id: I4af138ffb2f5306373244523768209e8873b2798
| | * Silence warning about comparing signed and unsignedShawn Rutledge2018-08-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | qxcbimage.cpp:72:26: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] Task-number: QTBUG-69923 Change-Id: Icdb4ce8cb7ce5b48d7ee3839166eb1c7c9520c78 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * VNC plugin: explicitly cast int to uint16_t before calling htonsShawn Rutledge2018-08-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise there is a -Werror=narrowing error on big-endian architectures (where htons does nothing). Task-number: QTBUG-68390 Change-Id: Idb204a81aaedb9f4fde1d5fae406da36c7a1953e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry-picked from b206d1c8082a9e01ad3755d311a4cf683ec35161)
| | * xcb: make sure we have a valid m_qimage in backing storeGatis Paeglis2018-08-131-50/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch amends a62f1d03560937a306c7586669a46cd9575e9464. If the initial backing store resize request is called with QSize(0, 0), we end up with QXcbBackingStoreImage holding a default contructed QImage / m_qimage. This happens because of the logic in QXcbBackingStoreImage::create(), where if we detect that the requested segmentSize == 0, we do not allocate any memory, and thus don't create a valid image in m_qimage. On subsequent call to QXcbBackingStore::resize() we would only check if QXcbBackingStoreImage object has been created, but not if it is in a valid state. This obviously would cause problems. This patch re-factors the logic to handle better resize to QSize(0, 0). And make the code cleaner by: - merging ::create and ::resize as semantically it is always resize(). - dropping unnecessary argument passing. Task-number: QTBUG-69581 Change-Id: Ied337beb449dea8259fcf6b7d29f0a5bd553019d Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| | * macOS: Force light theme on macOS 10.14+Gabriel de Dietrich2018-08-091-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until we can properly fix QPalette and QMacStyle, we should disable dark appearance in Qt applications. Disable by setting NSApp.appearance to Aqua, unless dark mode support has been requested via Info.plist or environment variable. Read the NSRequiresAquaSystemAppearance Info.plist key, don’t set NSApp.appearance if its value is false. Also check the QT_MAC_REQUIRES_AQUA_SYSTEM_APPEARANCE environment variable and apply similar logic. You then enable dark mode support by setting: QT_MAC_REQUIRES_AQUA_SYSTEM_APPEARANCE=0 which is slightly awkward, but matches Info.plist behavior. Task-number: QTBUG-68891 Change-Id: I86dc6cf3dee951d46c953396c57d2c31f2e4afcc Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | xcb: cleanup QXcbConnection::handleXcbEvent()Gatis Paeglis2018-08-168-206/+189
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | - the usage of 'handled' variable was a mess. - remove "generic" from API names. The naming was probably influenced too much from underlying C API (xcb_generic_event_t): - handleGenericEvent() -> handleNativeEvent() to be consistent with QWindow::nativeEvent(). - dropped unnecessary 'long *result' from signature. It is useful only on MS Windows. - genericEventFilterType() -> nativeEventType(), it *is* an event type, not a filter type. - XCB_CLIENT_MESSAGE was not passed to QWindow::nativeEvent(), which is done via HANDLE_PLATFORM_WINDOW_EVENT. - minor: added some 'auto's where it makes sense and improved some variable names. Change-Id: Id1c9896054e2dbd9a79bacd88394149c8cf2cdea Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | xcb: Add missing X11/XCB keysyms Undo, Redo, Find, CancelMikhail Svetkin2018-08-161-0/+7
| | | | | | | | | | | | | | | | It was added 558dd7f58735716d7d1f61fb5323d807b178f0c7 It was missed after 128a6eec065dfe683e6d776183d63908ca02e8fb Change-Id: I99f5c42ea45227bef08092e22d656e2d7d3cf60f Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | xcb: rewrite auto-repeat key detection logicGatis Paeglis2018-08-163-92/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's unclear what the original code was doing. It relied on 'm_release' which could never be 'false' (ref. QTBUG-69679). It was subtracting event times and comparing with arbitrary '10'. On X11 auto-repeat keys can be detected by checking time and keycode of the current release event and the next event in the queue. If an event is an auto-repeat, then next event in the queue will be a key press with matching time and keycode. Verified that auto-repeat was unreliable in Qt 4 as well. With this patch auto-repeat works as expected. Added support for Xlib's XPeekEvent in our XCB implementation QXcbConnection::checkEvent(): "The XPeekEvent() function returns the first event from the event queue, but it does not remove the event from the queue." Sneaking in one variable renaming: "string" -> "text", to match the QKeyEvent::text(). Task-number: QTBUG-57335 Task-number: QTBUG-69679 Change-Id: I0a23f138287f57eaaecf1a009bd939e7e0e23269 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | xcb: remove unused xcb_icccm.h include from qxcbclipboard.cppGatis Paeglis2018-08-161-4/+0
| | | | | | | | | | Change-Id: I7afe3bece5f143f6040cf1009d6345c1fe430367 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | xcb: remove a redundant call to xcb_change_window_attributes()Gatis Paeglis2018-08-161-2/+0
| | | | | | | | | | | | | | | | | | Few lines above we use the same attributes to create the window. If attributes don't change, there is not need to call xcb_change_window_attributes() Change-Id: I1335b8be866bdd9911d7911c87f09091bf77e955 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | xcb: remove redudant timeout arg from QXcbClipboard::waitForClipboardEventGatis Paeglis2018-08-162-6/+6
| | | | | | | | | | | | | | | | ... clipboard_timeout is QXcbClipboard class member, accessible directly from QXcbClipboard::waitForClipboardEvent(). Change-Id: Ibc241d1da4baedc0eaf84063251a1359b1cf4162 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | xcb: Use functors in QXcbConnection::checkEvent()Gatis Paeglis2018-08-168-178/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... to check for buffered events. This makes the code less verbose and easier to read. Changed the filter signature to pass an event type in addition to the actual event, for the convenience of API user. And do not pass worthless nullptr-s to the filter. The only reason why KeyChecker from qxcbkeyboard.cpp was not converted to lambda expression is that the code looks suspicious - KeyChecker::m_release default value is 'true' and I don't see where it would ever be assigned 'false' (ref. QTBUG-69679) and the code is known to be buggy (ref. QTBUG-57335). Those issues are out-of-scope for this patch. Change-Id: If2fdd60fbb93eb983f3c9ad616aaf04834fede9f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
* | Revert "macOS: Don't call [NSOpenGLContext update] for every frame"Liang Qi2018-08-155-99/+76
| | | | | | | | | | | | | | | | | | | | This reverts commit 823acb069d92b68b36f1b2bb59575bb0595275b4. It caused some test failures in qtdeclarative and etc. Task-number: QTBUG-69891 Change-Id: I2e4038a46de254834e6389c63f6dad0c2e523b8e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Windows QPA: Do not double delete the QTouchDeviceJan Arve Sæther2018-08-142-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This caused a crash on destruction because as soon as you construct a QTouchDevice it will register itself to a list of devices. On application exit the function cleanupDevicesList() in qtouchdevice.cpp would go through all registered QTouchDevices and destroy them. Therefore, there is no need to delete the QTouchDevice from QWindowsPointerHandler. This was a regression that was caused by 20d6dac63c25d227ed5315801e3e853ee78ec248 Change-Id: I58fb50016c047c3843a3f9677f2c2ef824223d43 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
* | drop usages of Q_COMPILER_CLASS_ENUMGatis Paeglis2018-08-143-13/+1
| | | | | | | | | | | | | | It is not relevant anymore. C++11 is a hard requirement for a while already. Change-Id: Idb8fbdcd13398cc85fba583f40c2b5c4dc7c4943 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Cocoa: Update palette after accent color or appearance changesGabriel de Dietrich2018-08-092-21/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This updates the UI after the accent color or NSApp's effective appearance have changed. For the accent color, we listen to NSSystemColorsDidChangeNotification. For the effective appearance changes, we do KVO on NSApp.effectiveAppearance. Both changes will trigger rebuilding the system palettes followed by a ThemeChangeEvent in the window system interface layer. Task-number: QTBUG-68891 Change-Id: Iab1ec874e05f1f6d54cd60217c273e0f8ffbf49e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Make QEventDispatcherCoreFoundaton work on secondary threadsMorten Johan Sørvig2018-08-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were using CFRunLoopGetMain() everywhere. Get the correct run loop using CFRunLoopGetCurrent() during initialization, and store it. Event dispatcher initialization must now be delayed until after the constructor has run, since event dispatchers may be created on the main thread and then moved to the target thread. Initialize on first call to processEvents() where the current thread will be the correct thread. Use the stored m_runLoop instead of CFRunLoopGetMain(). This is required for wakeUp() and interrupt() which may be called from another thread. Change-Id: I6fffcfd4394899c4a12f241c42781979aaf99d5e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.11' into dev" into ↵Liang Qi2018-08-082-6/+24
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-08-082-6/+24
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qcocoabackingstore.mm src/plugins/platforms/cocoa/qcocoascreen.mm Change-Id: Iac965aea4867059dbf7bc401b71e8e8b5b259afb
| | * macOS: Don't blend the backingstore unless the window has a backgroundTor Arne Vestbø2018-08-071-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there's no background, we should copy the backingstore, so that the backingstore is not blended with the result of the previous flush. The unified toolbar case is covered by the window having a textured background. Task-number: QTBUG-69773 Change-Id: I2f4eed9f44a60ebe7495ce68cf5a54d3d2424b0c Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | * macOS: Update window geometries after screen properties changeTor Arne Vestbø2018-08-071-0/+14
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-69794 Task-number: QTBUG-68140 Change-Id: I4d33bc2136478d779cc4ae8170c3421d9a7557cc Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | | Windows QPA: fix transientParentHwndMauro Persano2018-08-081-11/+1
|/ / | | | | | | | | | | | | | | | | | | QWindowsWindow::updateTransientParent retrieves the handle of the topmost owner window, not that of the immediate owner window (which corresponds to the handle of transient parent window). Task-number: QTBUG-69620 Change-Id: I1433098e8e93832d97508ee1782f88ccc000ee3a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | macOS: Don't call [NSOpenGLContext update] for every frameTor Arne Vestbø2018-08-075-76/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling update has a cost, and should only be done when the drawable object changes size or location. Instead of calling update each time makeCurrent is called, we listen for the appropriate notifications, limiting the number of update calls significantly. The code has also been refactored to get rid of the m_activeWindow member, as the active window can be tracked through the context's drawable object property. There is also no need to clear the drawable when a window is hidden, so the hook into QCocoaWindow can be removed. The QPlatformNativeInterface hook is internal and can safely be removed. Task-number: QTBUG-63572 Change-Id: I70e3267f47882e151144bd36a50abe906164429a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.11' into dev" into ↵Liang Qi2018-08-0710-142/+57
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-08-0710-142/+57
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/corelib/doc/src/objectmodel/signalsandslots.qdoc src/plugins/platforms/cocoa/qcocoamenuloader.mm src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp tests/auto/gui/image/qimage/tst_qimage.cpp Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Change-Id: I9bd24ee9b00d4f26c8f344ce3970aa6e93935ff5
| | * Windows QPA: Fix UIA-to-MSAA accessibility bridgeAndre de la Rocha2018-08-062-16/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to MS sample code, MSAA requests should be replied with UI Automation providers to enable the use the UIA-to-MSAA bridge, in order to support MSAA-only clients. Also changing the mapping of QAccessible::Client from UIA_CustomControlTypeId to UIA_GroupControlTypeId, as it seems more appropriate and avoids an incorrect mapping to a push button type in the UIA-to-MSAA conversion. Change-Id: I5149d250da2d1bd7b14b44ca46e856a81c9be045 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * Windows: Implement Qt::WindowStaysOnBottomHintFriedemann Kleint2018-08-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set the Z-order to HWND_BOTTOM in that case. Add a doc note stating that it only works for frameless or full screen windows. Task-number: QTBUG-53717 Change-Id: I7abf219a88aac715c51d27d925504da9e91b56f1 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| | * QCocoaMenuLoader - ensure that ensureAppMenuInMenu indeed, ensuresGabriel de Dietrich2018-08-011-18/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic seems to be incorrect (or the naming is misleading): it only adds 'appMenu' if it was found in the previous 'mainMenu', failing otherwise. Consider the following example: while (true){ QApplication app(a,b); MainWindow w; w.show(); app.exec(); } It's quite a contrived but apparently allowed API use (OP claims they have to switch languages in their app). The main window and the app are destroyed, so is the menu bar. Then a new main window is created, with a new menu bar. Now the current [NSApp mainMenu] (the one set after we deleted the previous) does not have 'appMenu' anymore (we removed it when initializing the first menu bar). So as a result we have app menu missing and add new menus/items to a wrong menus/at wrong index. Change-Id: I64fce766d6c12ebf7ae12bb94af41c8c1de3d78b Task-number: QTBUG-69496 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | * xcb: partly revert 3bc0f1724ae49c2fd7e6d7bcb650350d20d12246Gatis Paeglis2018-08-014-101/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After trying to fix (work around) system resize/move issues in various ways from within the platform plugin, it has been concluded that it is a bug at widget layer and should be fixed there instead: QTBUG-69716. This patch reverts parts of 3bc0f1724a and disables system move / resize on XCB plugin. Meaning, QSizeGrip will use its own implementation for resizing a window. Task-number: QTBUG-68501 Task-number: QTBUG-69628 Change-Id: Ib4744a93fb3e3c20f690a8f43713103856cb7d1a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | * Windows QPA: Fix override cursor being cleared when crossing window bordersFriedemann Kleint2018-07-313-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Override cursors can be modified externally when for example crossing window borders. Add helper function to enforce the cursor again to QWindowsWindow::applyCursor() which is called for enter events. Task-number: QTBUG-69637 Change-Id: Ibea4da9f2aac81377002b626daae64b1102f6c2b Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Add logging for QPlatformBackingStore::composeAndFlushTor Arne Vestbø2018-08-075-17/+7
| | | | | | | | | | | | | | | Change-Id: I96778296480d2aaad5e01ed15353106bc90d4d2b Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | macOS: Add missing braces in QCocoaIntegration::updateScreens()Tor Arne Vestbø2018-08-071-1/+2
|/ / | | | | | | | | | | Change-Id: I0f5009c8ba8f2f1853a968d9853dc45e8cbc2b5f Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Pass parameters by const-referenceJesus Fernandez2018-08-061-2/+6
| | | | | | | | | | | | Coverity-Id: 178810 Change-Id: I996955543c32907a54bf095bf52f242dbb7d5400 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Windows QPA: Fix clang-tidy-warnings about class definitionsFriedemann Kleint2018-08-0627-66/+66
| | | | | | | | | | | | | | | | | | | | - Use ' = default' for trivial constructors/destructors - Remove unneeded destructors - replace virtual by override or add override where applicable - Add Q_DISABLE_COPY Change-Id: Ic7a61579dbc845769beada4fc79bb5dd310e5e52 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Windows QPA: Fix some clang-tidy-warningsFriedemann Kleint2018-08-0615-69/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replace index-based loops by range-based for - Change else if to if after return/break/continue or simplify - Fix indentation - Do not check for non-null before invoking delete on pointer - Use isEmpty() instead size() to check for empty containers - Remove C-style casts - Use raw string literal - Do not repeat type in return, use {} instead - Reference local variables by const ref where applicable Change-Id: I5cc4b4026a10bddb561ba1ba8ec137e0d4119f94 Reviewed-by: Miguel Costa <miguel.costa@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | winrt: Fix QWinRTCursor::posOliver Wolff2018-08-061-5/+14
| | | | | | | | | | | | | | | | | | | | On winrt top level windows are always considered fullscreen and the core window's bounds are considered the bounds of QScreen. Thus When checking the mouse cursor's position the window bounds have to be taken into consideration. Change-Id: I39f24399bbaeade58d547abc770d4b3094174160 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | winrt: Add mouse event loggingOliver Wolff2018-08-061-1/+51
| | | | | | | | | | | | Change-Id: I4b2e0cd19969cf44a2de65bd0e52a32fc8e535b0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | winrt: Implement QPlatformCursor::setPosOliver Wolff2018-08-064-0/+109
| | | | | | | | | | | | | | | | | | | | | | | | Additionally to setting the cursor position we have to make sure that enter and leave events are triggered. As WinRT at the moment only supports maximized/fullscreen native top level widgets, an enter or leave event has to be triggered, every time the cursor enters or leaves the core window. Same as is done on Windows desktop an enter event is immediately followed by a move event even for emulated mouse events. Change-Id: I4b9a7b07f8e24b7887619f96979a064d933788aa Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | macOS: Don't make QCocoaGLContext current unless we have a drawableTor Arne Vestbø2018-08-041-3/+5
| | | | | | | | | | Change-Id: I12ac982aa977c69af936f503369c91bac88492a9 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | macOS: Modernize and clean up QCocoaGLContext::updateSurfaceFormat()Tor Arne Vestbø2018-08-041-97/+76
| | | | | | | | | | | | | | | | | | | | The updateFormatFromContext function that read GL state has been merged into updateSurfaceFormat(), we're using AppKit classes and functions instead of Core GL, and the logic has been simplified by using attribute/parameter helpers. Change-Id: Iec6717f457a0b4dbc8e34c3e15fcbcc42895b23e Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | macOS: Add note about high-resolution workaround in QCocoaGLContext::makeCurrentTor Arne Vestbø2018-08-041-0/+2
| | | | | | | | | | Change-Id: I0b82ef95c1a058586e8005665e1e2cab3f975833 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | macOS: Simplify and clean up QCocoaGLContext constructorTor Arne Vestbø2018-08-043-34/+36
| | | | | | | | | | Change-Id: Ie16256282784926506355012a735511b98118614 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | macOS: Clean up and rename QCocoaGLContext::pixelFormatForSurfaceFormat()Tor Arne Vestbø2018-08-042-24/+27
| | | | | | | | | | Change-Id: I1a439d8cec950cb23c977eedfcc1b8810c6cd1c5 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | macOS: Disambiguate use of native handles in QCocoaGLContextTor Arne Vestbø2018-08-034-16/+10
| | | | | | | | | | | | | | | | | | We only need the QVariant native handle when creating the context, so there's no need for a getter, and we then rename the NSOpenGLContext getter to match e.g. QCocoaScreen::nativeScreen(). Change-Id: I041e0eff39af9c8836d8ecd560ea07e92dc63e03 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | macOS: Remove GL defines from QCocoaGLContextTor Arne Vestbø2018-08-031-20/+0
| | | | | | | | | | | | | | They should be available in all SDKs we build against and support. Change-Id: I799492e0b21a877717fb3a8391bcbad0f8581628 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>