summaryrefslogtreecommitdiffstats
path: root/src/plugins
Commit message (Collapse)AuthorAgeFilesLines
* macOS: Don't require setting all three color buffer sizes in QSurfaceFormatTor Arne Vestbø2019-08-021-2/+9
| | | | | | Change-Id: Iaa6eb4d64f549a31aa5c53145e8b37facec4ea78 Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Improve screen positioning during window creationTor Arne Vestbø2019-08-011-12/+21
| | | | | | | | | | | | | | | Allow AppKit to resolve screen for NSWindow lazily in the case where the position is outside any known screen. And explicitly set the style mask if detecting the corner case of positioning a window in the unavailable space on a rotated screen. In testing the effect of creating the window with a borderless style mask and then updating the mask did not seem to have any visual consequences, but we try to limit this mode just in case by only enabling it in the corner cases we detect. Change-Id: I4b7fcc6755a1ad5ff2683bec79d80a78226edae0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Don't assume NSWindows will be created on the screen we requestTor Arne Vestbø2019-08-011-7/+14
| | | | | | | | | | | The user may have assigned the application to start up on a specific display, in which case the window's screen is nil after creation, and the resulting screen will be delivered as a normal screen change once the window is ordered on screen. Fixes: QTBUG-77154 Change-Id: Idade6d833e31654db239243f2430166b5d86eca2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix hit testing in non-client area of fixed-size windows, don't show resize ↵Volker Hilsheimer2019-07-311-6/+5
| | | | | | | | | | | | | | | | cursors The m_windowState member is never updated regarding active state; isActive is instead reimplemented to query the window manager, so use that. To extend the area where the user can move the window over the entire titlebar of fixed-height windows, just test whether the mouse position is within the titlebar. Change-Id: I6b87aacd0bdab511cfd4959df1114af5c6013852 Fixes: QTBUG-77220 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* macOS: Respect QSurfaceFormat color space when creating NSWindowTor Arne Vestbø2019-07-291-0/+3
| | | | | | Task-number: QTBUG-47660 Change-Id: I90a2956bfaa52c361a3eba32f0ea19c0eca8c277 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QWinRTFileEngine: Handle QIODevice::Truncate when opening filesOliver Wolff2019-07-291-1/+14
| | | | | | | Fixes: QTBUG-77095 Change-Id: I45b38fab779518c49b22077c493d8640572d40d9 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* QWinRTFileEngine: Implement setSizeOliver Wolff2019-07-292-0/+24
| | | | | | | Fixes: QTBUG-77132 Change-Id: Ic0410297a2215f1b7b656966cbe84b925706532f Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* macOS: Respect color space set on NSWindow when flushing backingstoreTor Arne Vestbø2019-07-262-13/+28
| | | | | | | | | | | | | | | | | | | | | | | By default Qt tries to avoid potentially costly color matching by not assigning an sRGB color space to our backingstore, even if that's what we in practice fill it with. We used to do this by assigning the display's color space, which effectively opts out of color matching, similar to the old behavior of the device RGB color space (which nowadays implies sRGB). By picking up the color space from the NSWindow instead, we allow the user to override the color space to trigger color matching, for example by explicitly setting it to NSColorSpace.sRGBColorSpace. NSWindow will fall back to the screen's color space if the window doesn't have one set. Task-number: QTBUG-47660 Change-Id: Iac8177e85e86fe9044a41eb2c93fbf26bb83c248 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QMacStyle - another slider fixTimur Pocheptsov2019-07-261-1/+1
| | | | | | | | | | | | As a follow-up to fixed resize handling: the trick Gabriel wanted to use to enforce a specific look on a slider's bar, never actually worked due to misplaced statement which essentially is cancelling the 'magic' before the bar is drawn. Now it's fixed: bar is centered (between the rows of tickmarks above and below) + it's had a nice blue filling back! Change-Id: I3021c2b86e4c25981eeee015e32baa24ccebc3bd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QMacStyle: workaround NSSliderCell's cached/stale geometryTimur Pocheptsov2019-07-251-0/+35
| | | | | | | | | | | | It's a bit cheesy solution, but works as I've noticed first on QSlider's with a ticks direction 'both'. Works because we were already using numberOfTickMarks property to trigger a special behavior for HIG non-compliant widgets. Works for our case too - we trigger a geometry update. Fixes: QTBUG-76811 Change-Id: I2cbf00d42d98e78519b281d138a2f74227ef5449 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* winrt: Remove QWinrtScreen::pixelDensity so that the default of 1.0 is usedOliver Wolff2019-07-242-7/+0
| | | | | | | | | | | | Winrt does device independent scaling by default so that overwriting pixelDensity for QWinrtScreen will break the use case of setting Qt::AA_EnableHighDpiScaling. That mode is basically always active on winrt. Task-number: QTBUG-76363 Change-Id: Ib522201850d17757be4a80aa819c3f1245ca7147 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* macOS: Properly unpolish font and paletteTor Arne Vestbø2019-07-201-6/+5
| | | | | | | | | Explicitly setting the application font and palette will actually persist the current state of the application font and palette to the widget, and it will stop reacting to system style changes. Change-Id: Ib856fe86cd3edb618b7ee5819d6c6c892c61fd1d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Modernize and clarify transient parent window level inheritanceTor Arne Vestbø2019-07-191-7/+29
| | | | | | Task-number: QTBUG-71480 Change-Id: Ia026427844a674f6b36804571a897dc6f16364fa Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Add QCocoaWindowManager for dealing with window levelsTor Arne Vestbø2019-07-194-19/+173
| | | | | | | | | Moves and improves the logic for lowering splash screens to a dedicated window manager, which will learn more tricks in patches to come. Change-Id: I8b8fd1dd78fdaf6f106a59c84d2a59254f3539c3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: activate correct object when using multiple QSystemTrayIconsVolker Hilsheimer2019-07-181-3/+8
| | | | | | | | | | | | | | | | | | Since we need to set the delegate on the defaultUserNotificationCenter, which is a gobal object, we have to update the delegate when we show the message. Otherwise, the last delegate created and set will receive the notification, and the last QSystemTrayIcon created will emit the activated signal. Before clearing the delegate upon destruction, make sure that it's the right item first. Also updating coding style in the respective parts of the code, and plugging a memory leak. Change-Id: Ife62ae0776a5a610a6fd735b2959b807c3a410c7 Fixes: QTBUG-77003 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Use correct virtual screen when resolving GL surface formatTor Arne Vestbø2019-07-171-1/+22
| | | | | Change-Id: I8288db85c8e99bf9fccfcfbca7f9e3594d00fa48 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Use lambdas instead of Obj-C categories for GL helper functionsTor Arne Vestbø2019-07-171-26/+20
| | | | | | | | Allows us to reference captured variables and keeps the function local to where it's used. Change-Id: I609892888720202021862d26a74ceb50e232f356 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Move QCocoaGLContext initialization into dedicated methodTor Arne Vestbø2019-07-173-7/+15
| | | | | Change-Id: I9dc2c400c3d26e9fcfaac04b61c1503229f59dba Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Windows QPA: Fix emitting of QScreen's changed signalsFriedemann Kleint2019-07-161-13/+18
| | | | | | | | | | | | When changing the primary screen, the various changed signals of QScreen were out of order. Most notably, the wrong DPI value was emitted since QGuiApplicationPrivate::processScreenGeometryChange() checks and emits DPI and orientation as well. Rearrange the code to assign new the values and emit DPI first. Task-number: QTBUG-76902 Change-Id: If4037108391c36ab3a8bfcb9b2989d5bea41202f Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Fix warnings as errors on macOS with new Xcode 10.2.1Alexandru Croitor2019-07-121-4/+4
| | | | | | | | | A switch statement was comparing enum values of a different enum. Change-Id: I578f79b15b1007afaa64cd3a2a80d6a75d3bed77 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* macOS: show QSystemTrayIcon message icons in notification popupsVolker Hilsheimer2019-07-111-1/+6
| | | | | | | | | | | | | | | The icon provided was ignored, even though NSUserNotification provides the option to specify a contentImage. The message popping up will show that image on the right side of the notification; it will not repace the application icon on the left side. [ChangeLog][Widgets][QSystemTrayIcon] On macOS, show the icon passed into showMessage in the notification popup Change-Id: I8ecda7f893006e74a4f35f37ddc07063ebfe4e83 Fixes: QTBUG-76916 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Windows QPA: Fix handling of mouse messages synthesized by the OSAndré de la Rocha2019-07-112-4/+8
| | | | | | | | | | | The old handler only marked mouse events associated with mouse messages synthesized by the OS with Qt::MouseEventSynthesizedBySystem when these messages resulted from touch screen, not tablet input. Quick seems to depend on this behavior. Fixes: QTBUG-76617 Change-Id: Ib863d73ae9325f9a19d8a175817fef4e82f7df0b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* xcb: fix thread synchronization issue in QXcbEventQueue::waitForNewEvents()Gatis Paeglis2019-07-081-2/+7
| | | | | | | | | | | | | | | | | | | | | This patch amends 730cbad8824bcfcb7ab60371a6563cfb6dd5658d The issue was that the event reader thread (QXcbEventQueue::run()) can enqueue events sometime between GUI thread has last time peeked at the queue and before it has called waitForNewEvents() and hence started waiting for more events (via QWaitCondition). This scenario is even mentioned in the QWaitCondition documentation: "[..] if some of the threads are still in do_something() when the key is pressed, they won't be woken up (since they're not waiting on the condition variable) and so the task will not be performed for that key press. [..]" And if there are no more events on the X11 connection, the waitForNewEvents() in QXcbClipboard::waitForClipboardEvent() would timeout. Fixes: QTBUG-75319 Change-Id: I8990a2a0c00571dfc334fb57d616dee999042885 Reviewed-by: Igor Kushnir <igorkuo@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Windows QPA: Fix blinking dot on Windows 7/8/8.1Andre de la Rocha2019-07-041-1/+8
| | | | | | | | | | | | | | | | A blinking white dot could appear on dark backgrounds on Windows 7/8/8.1. It was caused by a workaround added to trigger the on-screen keyboard on the Microsoft Surface. This change effectively restricts that workaround to Windows 10, where the blinking dot was not an issue. And anyway, impact over the Surface functionality should be minimal, as all models produced since 2015 only support Windows 10 (and it's unknown if the workaround was ever necessary for early models running Windows 8.1). Fixes: QTBUG-74492 Change-Id: Ic9b9c0f71f23b75212054c56a29796cf0efa109a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Windows QPA: Fix Wheel event coordinatesAndre de la Rocha2019-07-031-1/+1
| | | | | | | | | | In some cases, the wheel event coordinates would be incorrect, as the local coordinates were being determined relative to one window and the event being sent to another window, possibly incorrect. Fixes: QTBUG-75820 Change-Id: I4c3c4c6c4688bd9232d67ce4052d24365f6aea3a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QAndroidInputContext: Generate a QInputMethodEvent in reset()Vova Mshanetskiy2019-06-281-0/+1
| | | | | | | | | | | | | Although QPlatformInputContext::reset() documentation says that reset() should not send any QInputMethodEvents, implementations on Windows, macOS and iOS do send a QInputMethodEvent which clears preedit text in their reimplementations of reset(). Text editing controls depend on that and may not clear preedit text if such event is not sent. Change-Id: I75ab73946cb06e93e5fc5e98e0cc503a7de5c2e0 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* QAndroidInputContext: Do not stop composing when user taps the cursorVova Mshanetskiy2019-06-281-1/+19
| | | | | | | | | | | | | | | There is no need to tell the editor to stop composing if user taps so close to the cursor position that the cursor will not move anyway. If we do stop composing in such case, then since there will be no cursor position change notification, we will never start composing again (before the cursor is actually moved), and the current composing region will remain being displayed as normal text instead of being displayed as composing text. Change-Id: I4ebe6442e1ba8c365d6754c1a8487235d177c732 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* QAndroidInputContext: Consider preedit text in getCursorCapsMode()Vova Mshanetskiy2019-06-281-2/+7
| | | | | | | | | | Fixes auto-capitalization in AnySoftKeyboard. It was typing the whole first word in a sentence in upper case. Change-Id: I605a1aee39d432a3474c0bf706445d354562285f Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* macOS: lower the splash screen when a modal dialog blocks itVolker Hilsheimer2019-06-261-0/+19
| | | | | | | | | | | | | | This fixes the usability issue of a modal dialog showing up behind a splash screen, not visible to the user, but blocking user input and the application startup sequence until discarded. [ChangeLog][QtWidgets][QSlashScreen] On macOS, lower the splash screen when a modal dialog is shown to make sure the user sees the dialog. Change-Id: Ibae768f76909d930cb25dcf5cee31edc5f15c29a Fixes: QTBUG-49576 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Android: Use Android button layout for the DialogButtonBoxLayout hintAndy Shaw2019-06-181-0/+2
| | | | | | | | Fixes: QTBUG-70045 Change-Id: I9c51e9a769f510a6f14f6e9d78583caf3df15031 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* NSMenuItem/NSMenu - set the submenu properlyTimur Pocheptsov2019-06-214-0/+24
| | | | | | | | | | | | | | | | | | ... in case the submenu is set from a slot, attached to the aboutToShow() signal. Normally, with a 'statically' pre-populated menu, we set 'submenu' property on a menu item from 'updateItem' callback in our menu delegate. After that, AppKit calls our delegate's willOpen call back and this is where we emit 'aboutToShow'. Unfortunately, if an application tries to create a nested menu 'dynamically' at this point, it never becomes 'submenu' of the item, since 'updateItem' was already handled at this point. We catch this case in QCocoaMenuItem and call setAttachedItem if needed. Fixes: QTBUG-76060 Change-Id: I676bf1d8529b9ddbfc90e4dff422b39668b7a5fa Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use Xft DPI as basis for HiDPI scalingAllan Sandfeld Jensen2019-06-192-5/+16
| | | | | | | | | | | | | GNOME indicates DPI modes by setting high DPI values in Xft.DPI, so we need to use the forced DPI setting instead of the real DPI, as basis for QPA pixel density. Change-Id: I6f25636383b16b89a3d5fe4c904afd079fe001aa Fixes: QTBUG-74836 Task-number: QTBUG-65424 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* macOS: Don't capture local Q_D in QMacStyleTor Arne Vestbø2019-06-191-1/+2
| | | | | Change-Id: I01f14295e7e383b583931fc22e3d43151f7918b0 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* macOS: Make QMacStyle::standardPalette() reflect the platform themeTor Arne Vestbø2019-06-191-5/+6
| | | | | | | | | | | | This palette isn't usually used, and the platform theme's palette is preferred, but if a client asks for the standard palette (e.g. as used in the styles example) we should try to report a palette that gives the system look. Change-Id: Ie5e58c890c13c716a9e9b5093b954a737e550dee Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: prevent duplicate backing store scalingMorten Johan Sørvig2019-06-191-2/+3
| | | | | | | | | | | | | | m_requestedSize is already scaled by the QtGui scale factor (e.g. as set by QT_SCALE_FACTOR). Multiplying by QWindow::devicePixelRatio() then applies this factor again. Use QPlatformWindow::devicePixelRatio() instead, which returns the platform scale factor. Change-Id: I133e99d84f4718215fda9ef0cf81a113b51db2c7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Invalidate window shadow after QNSWindowBackingStore resizeTor Arne Vestbø2019-06-183-10/+30
| | | | | | | | | | | The window shadow rendered by AppKit is based on the shape/content of the NSWindow surface. If the backingstore is partially transparent, we need to invalidate the window shadow after each resize (and subsequent flush) of the backingstore. Change-Id: I451370af5a8c0c25faea26beb3faa2483a33a5cf Fixes: QTBUG-74560 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Windows: Use UUIDs instead of function pointer to mangle window classesTim Blechmann2019-06-181-2/+3
| | | | | | | | | | | Instead of using the address of a function pointer, we name-mangle window classes by using an UUID. This fixes a real-world problem with multiple Qt instances where for some reasons the window function appears to be mapped to the same address. Change-Id: Id27e8d7aa17a4db9c14559224395f49d3ecd8d78 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* iOS Accessibility: implement accessibilityElements and check indexingFrederik Gladhorn2019-05-211-0/+8
| | | | | | Fixes: QTBUG-70683 Change-Id: I122c67a5cee22363de5c8e45dc1c83e7760162fb Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Cocoa: always send queued user input eventsMorten Johan Sørvig2019-03-212-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | User input events will be queued if processEvents() is called with the ExcludeUserInputEvents flag. User code then expect that the queued events will be sent when the corresponding exec() call returns. We were sending queued user input event at the beginning of processEvents(). However, the cocoa event dispatcher also has a mode where it makes a blocking call to [NSApp run], in which case processEvents() never returns during event processing. This means we don’t get to call the queued-event-sending code. Factor out the queued-event-sending code to a new sendQueuedUserInputEvents() function. Call it from postedEventsSourceCallback() to make sure the queue is emptied after the ExcludeUserInputEvents processEvents() call is done. Task-number: QTBUG-69687 Change-Id: I4ff554ef4d39a69356736c33a650886b56bfdb4c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix crash when app is going to shutdown but conf manager is requestedVal Doroshchuk2019-06-121-6/+7
| | | | | | | | | | If the app is finished and going to shutdown, qNetworkConfigurationManagerPrivate() returns nullptr. Change-Id: I01915021d8698802b3a1d0dee43203cd3d4aba74 Task-number: QTBUG-76090 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QAndroidInputContext: Improve compatibility with virtual keyboardsVova Mshanetskiy2019-06-052-202/+430
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit improves QAndroidInputContext's conformance to Android's InputConnection interface and/or consistency of it's behavior with Android's native EditText control. * Composing region is now completely independent from cursor and selection, as required by InputConnection documentation. Also, Qt will now never clear composing region (i.e. call finishComposingText()) without receiving a command to do so from the keyboard. This is important for the following reasons: - Some keyboards misbehave if we change composing region without receiving a command from them. Notably, Samsung Keyboard does (QTBUG-68822). - Due to asynchronous nature of interaction between QAndroidInputContext and the keyboard, when user drags cursor handle quickly, the keyboard may call setComposingRegion() to mark a word, which is no longer under the cursor. This was causing text corruption (QTBUG-43156, QTBUG-59958). Also SwiftKey makes such calls when user presses Enter key (QTBUG-57819). - For similar reasons selecting a word with a double-tap could cause text corruption. The keyboard may call setComposingRegion() in response to the first tap after the second tap has been processed and the word has already been already selected. This is achieved by keeping track of start and end of composing region independently from the editor. Whenever possible (i.e. when there is no selection and the cursor is inside composing region), the composing text is represented as preedit text inside editor. And whenever that is imposible, the editor is told to commit, but QAndroidInputContext keeps information about composing region internally to be able to correctly interract with the keyboard. * deleteSurroundingText() has been re-written to work correctly when there are selection and/or composing region. Some keyboards (e.g Ginger Keyboard) do call deleteSurroundingText() when there is non-empty composing region. * All operations are now performed inside a batch edit (i.e. QAndroidInputContext now calls beginBatchEdit() and endBatchEdit() on itself) to ensure that an intermediate state is never reported to the keyboard, whenever an operation requires more than one QInputMethodEvent. BatchEditLock helper class was added to call begin/endBatchEdit() in RAII style. m_blockUpdateSelection has been removed because m_batchEditNestingLevel is now used instead of it. * Selection start and end positions are now reported to the keyboard so that start <= end. Some keyboards can not handle start > end. * getTextBefore/AfterCursor() now exclude selected text from their return values. While Android docs say "text before/after cursor", what they really mean is "text before/after selection" because "the cursor and the selection are one and the same thing". Some keyboards (e.g. Gboard) were behaving incorrectly when selected text was being returned. * getExtractedText() now tries to obtain and return the whole text from the editor. This is to fix compatibility with some buggy keyboards (e.g. Samsung Keyboard, Minuum) that ignore startOffset field and assume that selectionStart and selectionEnd are absolute values. Then they issue commands with wrong indexes in some cases. Fixes: QTBUG-43156 Fixes: QTBUG-59958 Fixes: QTBUG-57819 Fixes: QTBUG-68822 Change-Id: I7e71f3bcfbb2c32248d653a4197293db03579a79 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* QAndroidInputContext: Don't allow clearing selection by dragging handlesVova Mshanetskiy2019-06-051-39/+27
| | | | | | | | | Android's native text editing controls do not allow user to clear selection by dragging selection handles. Qt apps should behave in the same way. Change-Id: I9a7c3a2aafa484eed8ff2bbd46dd48c705195291 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* QAndroidInputContext: Fix unneeded preedit commits when dragging handlesVova Mshanetskiy2019-06-051-11/+52
| | | | | | | | | | | | | | | | | | | If the cursor handle was dragged by only a few pixels, position of the cursor did not actually change, but finishComposingText() was called anyway. So the keyboard was thinking that nothing changed and a word is still being composed, but the app was thinking that there is no preedit string. This was resulting in invalid handling of following key presses. This commit essentially inlines QPlatformInputContext::setSelectionOnFocusObject() into QAndroidInputContext::handleLocationChanged(). This allows us to call finishComposingText() and to send a QInputMethodEvent only when position of the cursur actually changes. This also allows us to add a QInputMethodEvent::Cursor attribute into the event for consistency with QAndroidInputContext::longPress(). Change-Id: I2fc82f138f717991f34024cdf521236845dc0adf Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Track swap interval in QXcbWindowErik Kurzinger2019-06-133-4/+7
| | | | | | | | | | | | | | | | | | As per GLX_EXT_swap_control, the GLX swap interval is specified on a per-drawable basis. However, QGLXContext only tracks it per-context using the m_swapInterval member. If a new drawable is made current to a context, it is still necessary to call glXSwapIntervalEXT to change the swap interval, even if it has been previously called for the same context with a different drawable. However, currently, QGLXContext::makeCurrent doesn't do this if its m_swapInterval field matches the new swap interval. This change removes m_swapInterval from QGLXContext, instead tracking it in QXcbWindow. This still avoids unnecessary calls to glXSwapIntervalEXT, while ensuring the swap interval is always set for new window drawables. Change-Id: Idc34101476c6af618059f6f3d8925dee743994a3 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Windows: Call ReleaseDC for the private's displayContextAndy Shaw2019-04-101-0/+2
| | | | | Change-Id: Ib5ee1bbe9037ceb13562eadb754c2a5f095b7f87 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* macOS: Introduce QMacKeyValueObserver and use in theme and styleTor Arne Vestbø2019-06-074-98/+19
| | | | | | Change-Id: I2d21c883628933543ae5a66b694ff7503119bc4a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Fix QMouseEvent::buttonMikhail Svetkin2019-05-281-3/+2
| | | | | | | | | | cocoaButton2QtButton(NSEvent *event) did not handle NSEventTypeLeftMouseDragged, NSEventTypeRightMouseDragged, NSEventTypeOtherMouseDragged. Task-number: QTBUG-74763 Change-Id: I9f48230599f16400b49edbff392f712eb1fff782 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Use QMacNotificationObserver over manual notification handlingTor Arne Vestbø2019-05-293-20/+17
| | | | | | | | | This also fixes a bug where we were implicitly capturing this inside the block, which meant that we would crash if the theme was recreated. The capture is now tied to the lifetime of QCocoaTheme. Change-Id: I37df8e6c0b33bf41e76d66be3cf29576041a7546 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* macOS: Fix reported mouse event buttonsMikhail Svetkin2019-06-031-4/+3
| | | | | | | | | | | | Use m_buttons instead of currentlyPressedMouseButtons. The latter returns the state of devices combined with synthesized events at the moment, independent of which events have been delivered via the event stream, so this method is not suitable for tracking. Task-number: QTBUG-74057 Task-number: QTBUG-74121 Change-Id: Iabf99ada6c3d25a995c9ddf895059b70833a9051 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* macOS: Enable VK_MVK_macos_surface on the instanceLaszlo Agocs2019-05-301-1/+1
| | | | | | | | | | | | | | Reports say some systems get "Failed to find vkCreateMacOSSurfaceMVK" even though MoltenVK and the corresponding extensionare there. While not reproducable on single GPU Intel systems, it could be that not enabling the extension on the Vulkan instance is causing this. Not opting in to the extension is incorrect in theory anyway. So fix it in cocoa as well, similarly to how other platform plugins do this already. Task-number: QTBUG-76117 Change-Id: I75220f3582a700ce0037003086123d3d38524648 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Mike Krus <mike.krus@kdab.com>