summaryrefslogtreecommitdiffstats
path: root/src/plugins
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.11' into 5.12.0Liang Qi2018-11-054-10/+9
|\ | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qcocoaglcontext.mm src/plugins/platforms/xcb/qxcbscreen.h Change-Id: If9b4c67288396ff7346088ce591c7a3588b51979
| * eglfs_kms: initialize m_deviceListenerSamuli Piippo2018-10-311-0/+1
| | | | | | | | | | | | | | | | | | If QT_QPA_EGLFS_HIDECURSOR was enabled, m_deviceListener was never initialized, which caused segfault in the destructor. Task-number: QTBUG-71507 Change-Id: Id8b17f5312073249cd12995317213fd746753521 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * xcb: Don't get initial screen rotationBłażej Szczygieł2018-10-292-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | "xcb_randr_get_screen_info" can be slow and in some configurations can cause short mouse cursor freezes (which will happen on Qt application startup). Initial screen rotation was used only to not handle possible redundant screen change event. Fixes: QTBUG-70760 Change-Id: I9f01325a045d2c82c4dd2fce91a18a34e54a4bcd Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * [cocoa] Disable offline renderers for dual AMD FirePro GPUMichael Brüning2018-10-231-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The AMD FirePro dual gpus on the Mac Pro have a problem with offline renderers in Chromium. Therefore, Chromium and thus Qt WebEngine disable this option via the pixel format attributes. The Qt Cocoa plugin on the other hand enables it in the recent versions, causing context creation in Qt WebEngine to fail when run on a Mac Pro with dual AMD FirePro gpus due to incompatible context options. This patch uses the environment variable QT_MAC_PRO_WEBENGINE_WORKAROUND which is set by Qt WebEngine upon application startup if the application is running on a late 2013 Mac Pro. It should typically not be set from anywhere else. [ChangeLog] Offline renderers will be disabled when the application is using Qt WebEngine and running on one of the late 2013 Mac Pro models. Fixes: QTBUG-70062 Change-Id: I0b0831efb6f4073ebd37672040aaed6370853fc0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge 5.12 into 5.12.0Oswald Buddenhagen2018-10-309-52/+75
|\ \ | | | | | | | | | Change-Id: I31f8eff4fdfe56cbb7f1450be8d351991966c6d8
| * | macOS: restore hidden popup windowsRafael Roquetto2018-10-281-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to to explicitly unhide popup windows that were previously explicitly hidden by applicationWillHide, so that their visibility will be effectively restored when the application is unhidden (otherwise the windows are gone forever even though their internal visibility is set to true). Change-Id: I4dbd209b07f769cc815851b40c41db0739ca2dc9 Task-number: QTBUG-71014 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * | wasm: use maintainTimers instead of processEvents for touch callbackLorn Potter2018-10-251-1/+1
| | | | | | | | | | | | | | | Change-Id: If39cdeedef60a47c0ba1afbab6adf1668bf5d0d6 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| * | xcb: fix unresponsive mouse clicks after VT switchGatis Paeglis2018-10-254-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch amends d67214302f269242ae3d8d2b962fd91ec42c979e. The issue was caused by mistakenly interchanging m_hasXRender <-> m_hasXRandr. Also renamed selectXRandrEvents() -> xrandrSelectEvents() to be more consistent with xi2Select*() API. And moved the xrandrSelectEvents() to QXcbConnection ctor for the same reason. Fixes: QTBUG-71305 Change-Id: I26f9bac3ae1f997f53134eb97f3569fb6d3c13fe Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * | Windows QPA: Fix 2-finger scroll not working with some touchpadsAndre de la Rocha2018-10-251-9/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems some touchpads only send legacy WM_MOUSEWHEEL/WM_MOUSEHWHEEL messages for 2-finger scrolling, instead of WM_POINTERWHEEL/ WM_POINTERHWHEEL, even after EnableMouseInPointer(TRUE), in spite of sending the expected pointer messages for normal pointer movement/taps. This change adds a workaround to handle legacy wheel messages even when in pointer mode. Task-number: QTBUG-71257 Change-Id: Ib360051147c4521751a5b91d90fa7657496777fa Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * | macOS: Fix NSOpenGLContext view association checkTor Arne Vestbø2018-10-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | The expression "m_context.view = view" always evaluates to the view, so the check was flawed. Change-Id: Icef4ba5244975ccd78a151c7d40c53b2364c6148 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | Windows/QPA: Fix receiving mouse clicks after double clicks in QQuickWidgetFriedemann Kleint2018-10-222-32/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Qt QPA does not handle native double clicks as such; change the plugin not to send them. For Ink, remove the doubleclick detection. For the old code path, map them to Press. Fixes: QTBUG-70999 Change-Id: I54b858f9e146bf325a861554d5ef74143db7d2b7 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | macOS: Treat explicitly set Qt::SubWindows as not needing a NSWindowTor Arne Vestbø2018-10-291-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to have logic that explicitly marked a QWindow as "embedded", but we now resolve this dynamically based on whether or not we have a parent window owned by Qt or not. As part of this refactoring the fix for QTBUG-63443 in ac35f9c44c got lost. We restore the behavior by treating Qt::SubWindow as a reason not to create a NSWindow for a view. This flag is set by QMenuPrivate::moveWidgetToPlatformItem already. Fixes: QTBUG-63443 Change-Id: I12bff546eefcb8f6c9ca43b1b879773d129a28f9 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | macOS: Add local auto-release pool during updating of window flagsTor Arne Vestbø2018-10-261-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prevents no-longer used QNSWindows from staying around (closed and invisible, but alive), due to being auto-released when there is no pool in place (during main(), before exec). Change-Id: I4eb63c7140290ffe6bded8a76732354c846ed579 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | macOS: Log Qt and macOS version information at startupTor Arne Vestbø2018-10-253-0/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | The SDK and deployment target versions are helpful to know when diagnosing issues. Change-Id: I85026bd9c1d706a923e8953837bd59bf9ed0266f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Fix out of bounds memory access when setting motif window hint propertiesSimon Hausmann2018-10-251-0/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit b4bd5f9df3e69da707513ba544537c80a8564fb4 removed two members from the mwm hints structure but told xcb_change_property that the structure has still five members when it had been reduced to three. This lead to xcb_change_property accessing memory out of bounds. As identified by Gatis, the safest option to avoid the access is to add the two members again. Other window managers may be expecting their presence in the window property. Change-Id: Id4f0c9536cd317c35f2c6ebd1ac9ccc6f72de6a5 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
* | wasm: fix wheel scroll logicLorn Potter2018-10-201-2/+5
| | | | | | | | | | | | | | Task-number: QTBUG-71180 Fixes: QTBUG-71180 Change-Id: If442da096b847fdf69f3b24615e99c2ca988fb79 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | QMacStyle: fix group box for macOS MojaveTimur Pocheptsov2018-10-192-7/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is based on a patch started by Gabriel. It works around the apparently noop (on macOS Mojave, light theme) -drawRect: call on NSBox, replacing it with -displayRectIgnoringOpacity:inContext:. Unfortunately, this turns out to be extremely slow with dark theme, so we have to resort to a custom version of NSBox/-drawRect: which calls its super's -drawRect: and look more or less correct. Task-number: QTBUG-69650 Change-Id: I5a614d7cd8002b378c6c3804663b6559e227f628 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | Fix a regression in qmacstyleTimur Pocheptsov2018-10-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | square/flat button had an erroneous size adjustment, resulting in a wrong highlighted area. This button is anyway nothing like a real control on macOS - they don't have 'flat' button which highlights when pressed. Anyway, now our flat button looks more like AppKit's 'square' button when pressed. Task-number: QTBUG-69533 Change-Id: I9643c1d4a25329c3f3c2148cc1821922655d9a8b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | QCocoaMenuItem: ignore font hintsTimur Pocheptsov2018-10-192-17/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Native applications do not use custom fonts in menus, so we should avoid it - our own example app 'menus' demonstrates the problem. To quote Gabriel: Although the Mac HIG don't say that you shouldn't, and there's even a API to do it (which we're obviously not using properly), the truth is that nobody does it. Simply put, it looks wrong on Mac (although it's arguable whether it looks good or bad regardless of the platform). Task-number: QTBUG-29654 Change-Id: Iffd08ad63d419164102b2e738cdf1ebda1967a05 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | macOS: Use correct text background colorMorten Johan Sørvig2018-10-181-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 582d221b29bbf introduced a regression where the default Base color is no longer white in light mode, for some use cases like querying QApplication::palette() and when using style sheets. [NSColor windowBackgroundColor] is not the correct color for QPalette:Base, [NSColor textBackgroundColor] is, except for the Disabled state which uses windowBackgroundColor to get a grayed-out look. This also changes the dark mode Base color slightly, from RGB(0.196, 0.196, 0.196) to RGB(0.118, 0.118, 0.118). Task-number: QTBUG-70966 Change-Id: I1ff494a09980ff2d04b2e2c43ee0bcc8e26ba9e7 Fixes: QTBUG-70966 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Windows QPA: Fix Drag&Drop from touchscreen/penAndre de la Rocha2018-10-183-10/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Drag&Drop functionality had stopped working with touchscreen/pen after the WM_POINTER-based input handling was added. The Drag&Drop functionality internally uses the DoDragDrop() WIN32 call which, according to Microsoft docs, is not supported for invocation inside handlers for touch/pen messages, and should be invoked in handlers for mouse messages that are synthesized by the OS afterwards. The result was that when DoDragDrop (which is a blocking function with its own event loop) was called it would hang ignoring all touch/pen messages until a mouse/touchpad message arrived. This change implements a workaround for this issue by enqueuing Qt touch/pen events that would be generated inside the pointer message handler, and that could start a Drag&Drop operation, and only producing them after the OS sends the associated mouse messages. Task-number: QTBUG-70887 Change-Id: Id45e0ecc70358ba250de9b3268856781ed21c9dd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Restore "Do not create instance of QPlatformIntegration for invalid displays"Gatis Paeglis2018-10-183-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is amended version of 67cc8fea106c35c7ca75bf476667d07b3bbf3257, which was temporary reverted to simplify integration of conflicting patches. What was amended: - Dropped the factory interface. It is sufficiently clean to check for QXcbConnection::isConnected(). Task-number: QTBUG-68859 Change-Id: I810897b3ea20e356fc4d62e6f01231fd287962dc Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Windows QPA: Fix maximizing windows without title barFriedemann Kleint2018-10-181-4/+20
| | | | | | | | | | | | | | | | | | | | Extends the code from qtbase/0d6612af65161f6e659af6985bb2c0b76accb856 to cover the case of windows without title bar, too. Fixes: QTBUG-4362 Task-number: QTBUG-8361 Change-Id: I5cff8814174069922936f3fcfbb3aef154c7a7e7 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Windows QPA: Add helper function to obtain DPI-dependent metrics on Windows 10Friedemann Kleint2018-10-173-3/+55
| | | | | | | | | | | | | | | | | | Use newly introduced SystemParametersInfoForDpi() API with some convenience overloads. Task-number: QTBUG-4362 Change-Id: I4c41c700007bf7cc4fd5868356e3145c136704c0 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | xcb: use 128 as a reference DPI for small screensMathieu Velten2018-10-171-1/+5
| | | | | | | | | | | | | | | | | | | | | | This is a better version of 23b139038a1dc9a769a358ab112453abcdd39290 which was reverted. Task-number: QTBUG-68620 Task-number: QTBUG-53022 Task-number: QTBUG-57211 Change-Id: I0b37fc261945c542bbfb30cecfe4b0a97c655e3c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | xcb: cleanup _MOTIF_WM_HINTS handlingGatis Paeglis2018-10-174-139/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing code was difficult to follow, it contained some code duplication, inconsistencies and legacy code (mwm/dtwm support). Most of this code was copied over from Qt 4 as is, with some unexplainable (accidental?) modifications. Most of Motif code was never ported over to Qt5. In addition to the properties and protocols described in ICCCM, Motif uses properties and protocols of its own. In Qt4 we had an implementation of Motif DnD protocol. This was never ported over and mentions of this support was removed on Oct 2012, 4c41cb48d0356a28190c300fd4cc5e03f824b870. Nobody has complained for all these years, so it is safe to remove the remaining leftovers. Motif style support also was removed around the same time 4c41cb48d0356a28190c300fd4cc5e03f824b870. Keeping only those Motif hints that do not have any replacement in modern window manager specifications - decorations hints. MWM_INPUT_*MODEL* in modern specs was replaced by _NET_WM_STATE_MODAL The existing code was setting _MOTIF_WM_HINTS from 2 places - from QWindow setter (::setWindowFlags) and again before mapping the window (::show). We don't need the logic from updateMotifWmHintsBeforeMap(). That function read the current value of _MOTIF_WM_HINTS and merged in few additional hints, hints that are not relevant based on all the reasons from above. Change-Id: I9cb10bcad9bfac8762e3909895c2e9de613e622c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | xcb: qxcbconnection_screensGatis Paeglis2018-10-174-382/+426
| | | | | | | | | | | | | | | | | | | | Moved all screen handling method implementations into qxcbconnection_screens, the same way we are doing with xinput2 code in qxcbconnection_xi.cpp. The goal was to reduce the size of qxcbconnection.h/cpp. Change-Id: I9bad55ca4b0874171b7313d923b13c66034c3b3e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | xcb: qxcbconnection_basicGatis Paeglis2018-10-1714-1027/+1317
| | | | | | | | | | | | | | | | | | | | | | | | A basic base class that creates a connection and initializes extensions. The goal was to reduce the size of qxcbconnection.h/cpp. Made QXcbAtom into a class that handles atom initialization and exposes the relevant APIs. Before this patch, all of that logic was inside of qxcbconnection.h/cpp. Change-Id: Ia893c3b31e2343dfbe62fe2aa6bfd0017abf46ea Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-10-1710-11/+43
|\| | | | | | | | | | | | | | | Conflicts: src/plugins/platformthemes/platformthemes.pro src/printsupport/kernel/qplatformprintdevice.cpp Change-Id: Iac01729ad954bb1c7af5867d982eb243b2139ee6
| * Modernize the "mimetype" featureLiang Qi2018-10-125-3/+9
| | | | | | | | | | | | Change-Id: I9b67c2cbc0891a38ece18d521c86fbc7344dce7a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Only use a translucent background if there is support for alphaAndy Shaw2018-10-121-2/+4
| | | | | | | | | | | | Change-Id: Ia8d9e543fac4b6e790fa38cf04c5a782d72d72df Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * Use native visual ID when creating GBM surfaces for KMSPaul Olav Tvete2018-10-123-6/+22
| | | | | | | | | | | | | | | | | | | | According to the Khronos documentation, gbm_surface_create() will give a BAD_MATCH error if the format does not match the EGL_NATIVE_VISUAL_ID. Newer drivers have started to enforce this. Change-Id: I61360b0f52965ad8057e7de8f824ffca64fea904 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
| * [macOS] Fix position of sheets when using unifiedTitleAndToolBarOnMacAlexandru Croitor2018-10-081-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modal sheets are supposed to appear below the toolbar if a toolbar exists, or below the title bar if a toolbar doesn't exist. In the unified title and toolbar mode, sheets should to appear directly below the toolbar, if the toolbar is positioned at the top of the window. Code-wise we achieve that by calling setUnifiedTitleAndToolBarOnMac on a QMainWindow, which results in adjusting the top content border of the NSWindow via [NSWindow setContentBorderThickness:forEdge], which Cocoa uses to position a modal sheet (the sheet top edge is aligned with the top edge of the content view + the Y border thickness value). The issue is that because NSWindow.titlebarAppearsTransparent is set to YES, for sheet presentation purposes, Cocoa considers the content view to begin at the position of the top left corner of the frame (where the title bar is), and thus sheets appear somewhere in the middle of the unified toolbar. To fix that we need to account for the title bar height in the border thickness value. Compute the title bar height from the window frame height - window content view height, and add it to the top border thickness value. Amends 8ac9addd946637401e4685c6e91d1a3cd5b2d768 Change-Id: Icf85c513035cc3710b438e60eb14dc04c5bbaced Fixes: QTBUG-65451 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | QWindowsContext: proper check resolved functionAnton Kudryavtsev2018-10-161-1/+1
| | | | | | | | | | Change-Id: I9a223dc2efa2205dc3ae8d300cf06b12e06ed0f9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | xcb: respect QEventLoop::ExcludeUserInputEvents in native event handlersGatis Paeglis2018-10-166-11/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a regression from Qt 4. Before this patch, we supported filtering events only at QWindowSystemInterface level, but to properly support filtering in QAbstractEventDispatcher::filterNativeEvent, we have to filter the events earlier. Now it is possible to enable/disable this feature for platforms that support native event filtering. The mapping of which events are user input events were taken from QWindowSystemInterfacePrivate::EventType. Task-number: QTBUG-69687 Change-Id: I9a5fb9f999451c47abcdc83fdcc129b5eeb55447 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | xcb: rework connection error handlingGatis Paeglis2018-10-162-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch reworks 0b1ce5db9e04b4c28713e87306fcea020c3e428b. Just by looking at the source code it was unclear why is this signal-and-slot connection necessary. It doesn't do anything on normal exit - at the time we call dtor of this class, QCoreApplication::instance() already is nullptr, which means that no further event processing happens and we never get this signal. Without digging into git history it may appear that the goal was to process the remaining events on application exit, which would be a questionable code by itself. Change-Id: I202d11584901e3b52254d8e3c347aece17844b72 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Windows QPA: Add WM_INPUT to the list of input messages for event filteringFriedemann Kleint2018-10-161-0/+1
| | | | | | | | | | | | | | | | Amends a0a22037cdacbf51a2db560ff902a5a341561b15. Task-number: QTBUG-67095 Change-Id: I32d2e78f9d9525d56c1d4477d69cf7b9d7f8e7a3 Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* | xcb: cleanup WM_HINTS handlingGatis Paeglis2018-10-151-23/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - The only place where window flag Qt::WindowDoesNotAcceptFocus changes is inside QXcbWindow::setWindowFlags and from there we call updateDoesNotAcceptFocus(). The current code was redundantly calling xcb_wm_hints_set_input in various places. - Similar as above: call xcb_wm_hints_set_normal/iconic only where it can change. This hint depends on window state, so update it only from setWindowState(). Removed unnecessary call to setTransparentForMouseEvents(), which is already called few lines above from setWindowFlags(). Change-Id: I8da919b135a4dfda0c8c1dad51d85d3e706153ab Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | xcb: utilize thread-safety of QAbstractEventDispatcher::wakeUpGatis Paeglis2018-10-153-14/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QAbstractEventDispatcher::wakeUp is a thread-safe method, using a queued connection to invoke it is wasteful. This type of connection involves allocating temporary QMetaCallEvent on a heap and locking of destination thread's post-event queue. In most use cases this is ok, and really convenient when target method is not thread-safe. But in this case the existing solution was suboptimal, especially because the events we are reading can be high frequency. The solution that we use here is lock-free. There can be only one time when it might need to wait for the lock, which is upon exiting the application. If we have entered the critical section in QXcbEventReader::run(), then the registered post routine (qAddPostRoutine) will block the QCoreApplication's dtor (this is where dispatcher is set to 0) until we exit the critical section. We also know when not to enter the critical section, in case dtor is already running. With this approach we might need to compete for the lock at most once, instead of whole application lifetime, which was the case with the existing code. Change-Id: If6737329c972347b0050d67658e28dbaa6f552e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | xcb: call processXcbEvents() on every event loop iterationGatis Paeglis2018-10-157-11/+289
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is necessary for QTBUG-69687. The original code processes the xcb event queue only when new events have arrived, but if we want to do an event filtering that buffers some events and processes them later based on set/unset flags (e.g. QEventLoop::ExcludeUserInputEvents), we need to call processXcbEvents() on every event loop iteration, not only when new events have arrived from X server. The required functionality is implemented by having custom event dispatchers, instead of using the generic ones from QtGenericUnixDispatcher:: createUnixEventDispatcher() / eventdispatcher_support-private. This also enables for further customizations, as might be necessary by QTBUG-70095. Task-number: QTBUG-69687 Change-Id: I1f8b2400d26cccf17279d57bb4b678e40c615f33 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | Doc: Move literal code block to a separate fileCristian Maureira-Fredes2018-10-152-12/+54
| | | | | | | | | | | | | | | | | | | | | | We need to override this snippet for the documentation we generate for Qt for Python, and it is easier to have it on a separate file. Task-number: PYSIDE-801 Task-number: PYSIDE-691 Change-Id: Ideb5b6af25024279f167137d3b65660bb9c96a7e Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | xcb: localize handling of Qt::AA_Compress* flagsGatis Paeglis2018-10-141-2/+4
| | | | | | | | | | | | | | Handle both of them inside the QXcbConnection::compressEvent(). Change-Id: Ibe7184ba5c5b636013145e887c817dca701345ad Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | xcb: lock-free event processingGatis Paeglis2018-10-1412-359/+589
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For details how this works refer to the documentation in the patch. The follow-up patches will switch to calling processXcbEvents() on every event loop iteration. With the existing code that would mean frequent locking of shared data (event queue). Acquiring a lock is fast, but lock contention isn't. To avoid potential problems, reimplement xcb event processing to be lock-free. Besides theoretical performance benefits, this definitally improves code readability in qxcbconnection.cpp. Thanks to Mikhail Svetkin for questioning the design of the existing code. Done-with: Mikhail Svetkin <mikhail.svetkin@qt.io> Change-Id: I935f2b6ca802580f5c80205aef7b2f9afc172d26 Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Revert "XCB: Do not create instance of QPlatformIntegration for invalid ↵Gatis Paeglis2018-10-145-73/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | displays" This reverts commit 67cc8fea106c35c7ca75bf476667d07b3bbf3257. I forgot about this patch and now it makes rebasing the local changes too time-consuming. Besides, 67cc8fea10 broke a build for -no-xcb-xlib. I will restore this patch, with adaptations to the new QXcb*Connection hierarchy. Task-number: QTBUG-68859 Change-Id: I938f32b5da22ce18f95d761f9b34e77fff923e24 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | qt_mac_createRolePalettes: fix the highlight color for ItemViewPalette roleTimur Pocheptsov2018-10-141-1/+1
| | | | | | | | | | | | | | | | | | While this requires from us calling a deprecated method, a (non-deprecated) method we were using gives a wrong color which is too bright/saturated. Task-number: QTBUG-70676 Change-Id: Icebeb53e351caa646c533595ca1a886e5eb6b5b8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | qnsview_keys - fix a typoTimur Pocheptsov2018-10-131-1/+1
| | | | | | | | | | | | | | | | | | that resulted in 'Cmd' reported as combo of Qt::Meta/Qt::Control and Qt::KeypadModifier. Task-number: QTBUG-71006 Change-Id: I3dddc56f4d404a1ceefb21d57ac120b6273456ec Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | WinRT QPA: Fix crash in QWinRTBackingStore::flush()Andre de la Rocha2018-10-121-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | QWinRTBackingStore::flush() was not considering the possibility that the supplied region may fall partially outside the bounds of the paint device. This resulted in possible accesses to invalid memory addresses, causing a crash. This bug was exposed by an update in ANGLE that was causing a crash when running tst_QTableView::bigMode with a small screen size. With this fix the function will use the intersection of the supplied region with the paint device bounds. Change-Id: I2f0f0f7f5510688bfa1459320a0c146df6be65d1 Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* | windows: Disable shader disk cache for all Intel GPUsLaszlo Agocs2018-10-121-2/+1
| | | | | | | | | | | | | | | | Follow up to dff9bb2f9b981e263d8d3d5b1ef67054297e731c Task-number: QTBUG-64697 Change-Id: I73a114dd3c75f3ed1272fa73dad378ecfdc0db09 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | xcb: remove runtime check for xcb_poll_for_queued_eventGatis Paeglis2018-10-123-56/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | xcb_poll_for_queued_event() was introduced in libxcb 1.8. The minimal required libxcb version was bumped up to 1.9 in 1f5d791708d5d256a76872f254251dac66e82cdb. Before this version bump we needed the runtime check to support older versions of libxcb. Updated connections in the event reader to use the new signal and slot syntax. Removed threadedEventHandling() method because now it is always 'true'. Change-Id: I0bce61fd478a871d35e676239ee5280c4f40be8a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-10-081-1/+0
|\| | | | | | | | | | | | | Conflicts: src/corelib/tools/qtimezoneprivate.cpp Change-Id: Icbb5999d378711ce3786a4fe0aba176a45ac702c