Commit Graph

37556 Commits

Author SHA1 Message Date
Christian Ehrlicher
c18a91b0dc QTableWidget: fix cellChanged signal emitted by takeItem()
QTableWidget::takeItem() emitted cellChanged with row and column set to
-1. The internal functions searched for item after it was reset to
nullptr and therefore it was not found.
Since the modified cell is known because it's passed to the takeItem
function, the correct row/column can be retrieved from there.

Task-number: QTBUG-70478
Change-Id: I5ff5991c49f3200efe95fde4c7d0d28e19be7ebf
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-10-19 12:19:20 +00:00
Edward Welbourne
c14103be50 Update dbus header and document its provenance
There's been one minor change in a struct and some minor re-ordering
of other things within their files (reflected here to simplify future
checks); and qt_attribution.json didn't document enough details to
ensure reliable review.

Task-number: QTBUG-70011
Change-Id: Iccff9cfd899e58cb42837c4628acacd7877c5b01
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2018-10-19 12:15:51 +00:00
Simon Hausmann
b98b49ba00 Fix re-running of cmake when a qrc file changes
Commit 2af1277631 renamed out_depends to
_out_depends inside qt5_add_resources but the old (empty) variable was
used with add_custom_command.

Change-Id: I8005674992b4538bd82375a4f1f70484bc0f0ae5
Reviewed-by: André Klitzing <aklitzing@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-10-19 11:30:16 +00:00
Mikhail Svetkin
ef567c3b67 qedidparser: Fix a condition typo
'\040' is 32 and '\176' is 126.
The condition is always false "if (buffer[i] < '\040' || buffer[i] > '\176')"

Task-number: QTBUG-71156
Change-Id: Ic3d6eae5b8ddb56742315af7e78b58bea2393d7a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-10-19 11:00:10 +00:00
Timur Pocheptsov
5760545ebb QCocoaMenuItem: ignore font hints
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>
2018-10-19 10:54:29 +00:00
Morten Johan Sørvig
b88eaa255a macOS: Use correct text background color
Commit 582d221b29 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>
2018-10-18 20:31:24 +00:00
Morten Johan Sørvig
94a829689e wasm: disable thread configure option
This removes the need for “-no-feature thread”.

Thread support will be added at later point in time,
see QTBUG-64625.

Change-Id: I4d1dedd527aa83d6033bf108f5f34e759517b954
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-10-18 20:31:08 +00:00
Morten Johan Sørvig
34633627ba wasm: force static builds
This removes the need for specifying "-static" on the
configure line.

Shared builds are on the roadmap (QTBUG-63925), but
not currently supported.

Change-Id: I7f72ac702bc77304abfa6a962cb1139c25fb5e35
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-10-18 20:30:53 +00:00
Andre de la Rocha
83d56811ec Windows QPA: Fix Drag&Drop from touchscreen/pen
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>
2018-10-18 12:38:37 +00:00
Kirill Burtsev
57b09b903e Fix QString latin1 conversion and comparison for -optimize-size build
Change-Id: I5f0ae946151e9733cbe21cb24387636ba68bc177
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-10-18 17:37:14 +00:00
Gatis Paeglis
96218681f2 Restore "Do not create instance of QPlatformIntegration for invalid displays"
This patch is amended version of 67cc8fea10,
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>
2018-10-18 17:06:48 +00:00
Friedemann Kleint
5ac2b9ef59 Windows QPA: Fix maximizing windows without title bar
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>
2018-10-18 06:36:03 +00:00
Friedemann Kleint
6764e7b020 Remove empty function QWidgetPrivate::registerDropSite()
Apparently it is a left-over from Qt 4.

Task-number: QTBUG-70240
Change-Id: I6b882728defef1ab78331b03e76459a7419cd386
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-10-17 19:11:20 +00:00
Friedemann Kleint
0aa27af801 Windows QPA: Add helper function to obtain DPI-dependent metrics on Windows 10
Use newly introduced SystemParametersInfoForDpi() API with some convenience
overloads.

Task-number: QTBUG-4362
Change-Id: I4c41c700007bf7cc4fd5868356e3145c136704c0
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-10-17 19:11:10 +00:00
Tor Arne Vestbø
17fc079acd doc: Update online navigation header to match http://doc.qt.io/
Change-Id: I8154abc8cf2bb5895a75c4e41ff06cb99e4fedc5
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2018-10-17 16:16:28 +00:00
Mathieu Velten
5e6bbbc1b8 xcb: use 128 as a reference DPI for small screens
This is a better version of 23b139038a
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>
2018-10-17 15:23:51 +00:00
Gatis Paeglis
b4bd5f9df3 xcb: cleanup _MOTIF_WM_HINTS handling
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, 4c41cb48d0.
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 4c41cb48d0.

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>
2018-10-17 15:21:25 +00:00
Albert Astals Cid
1625e53cc8 Update 3rdparty valgrind headers to Valgrind 3.14.0
Change-Id: I8d36f03e52ad77e89d92a9df4d3bff389bd3baf2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-17 11:26:08 +00:00
Mikhail Svetkin
4e680bee86 qreadwritelock: Fix Q_ASSERT typo
Task-number: QTBUG-71156
Change-Id: Idc249b8b499106c3683a7fd641f27d22047386fe
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-17 10:53:31 +00:00
Mikhail Svetkin
7d03b9b300 qpainterpath: Fix Q_ASSERT typo
Task-number: QTBUG-71156
Change-Id: Id1669f72a684171ad8c72badad56e72ee20ee625
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-10-17 10:53:22 +00:00
Miguel Costa
69d977b993 Fix ANGLE build failure with mingw
Added the files libEGLd_mingw32.def and libGLESv2d_mingw32.def that were
deleted by mistake in the recent ANGLE update, causing failure when
building with mingw in debug.

Fixes: QTBUG-71189
Change-Id: I0bf446c3f2d189afb806bbfed2fdc1a3f70750c1
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-10-17 10:34:17 +00:00
Gatis Paeglis
67c3c0f240 xcb: qxcbconnection_screens
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>
2018-10-17 10:02:51 +00:00
Gatis Paeglis
d67214302f xcb: qxcbconnection_basic
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>
2018-10-17 10:02:45 +00:00
Allan Sandfeld Jensen
5fe2ed48d6 Fix scrollbar updates in QPlaintTextEdit on block-visibility changes
Trigger documentSizeChanged when block visibility changes, since block
count remains constant in this case.

Task-number: QTBUG-69310
Change-Id: I5ec7a4f9008f26ea8602356bcbaefbda293e54a3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-10-17 09:21:26 +00:00
Allan Sandfeld Jensen
0ead3b7142 Move arthurwidget based examples to new QOpenGL classes
Several of the examples were not even working besides using deprecated
classes.

Change-Id: I352e0629d490593edcc5868d2ec5a8ff222eaeab
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-10-17 09:16:01 +00:00
Allan Sandfeld Jensen
16ebc78ef3 Fix odd test in tst_qflags
This test triggered a compiler warning for good reason, it made no
sense, trying to change it to what it was probably meant to be.

Change-Id: I01a848272b42dae2aaa58a4f5bed998644d864da
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-10-17 09:15:22 +00:00
Gatis Paeglis
76c762558a 3rdparty/xkbcommon: update bundled version 0.4.1 -> 0.8.2
0.8.2 + subsequent commits up to 31f1f355700870c6615399fbfa7934934b3a9a57.
There were couple commits after 0.8.2. Mostly minor stuff, with 2 exceptions:
fix off-by-one error in xkb_file_type_to_string() and undefined behavior in src/x11/keymap.c

We currently don't use any of the features added in later releases of
libxkbcommon, therefore the minimal required version in src/gui/configure.json
remains the same.

[ChangeLog][Third-Party Code] updated bundled libxkbcommon 0.4.1 -> 0.8.2 (up to 31f1f355700870c6615399fbfa7934934b3a9a57)

Task-number: QTBUG-71109
Change-Id: Ia03c3dc31c5f39e78dcb5915a45e82797b065ccb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-10-17 08:49:53 +00:00
Anton Kudryavtsev
aa633ff276 QMetaEnum: fix UB
Check ptr before usage.

Change-Id: Iac757a2e260b237d837318932cc0b5896c6e04c2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-17 08:48:13 +00:00
Anton Kudryavtsev
7bf4ebfb26 Create empty list only if it's needed in QMetaMethod::parameterNames
Change-Id: I2d370dff0c4939f27709db0ebf2b15a15eb14877
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-17 08:48:03 +00:00
Liang Qi
ccf26f6a88 Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	src/plugins/platformthemes/platformthemes.pro
	src/printsupport/kernel/qplatformprintdevice.cpp

Change-Id: Iac01729ad954bb1c7af5867d982eb243b2139ee6
2018-10-17 10:35:28 +02:00
Anton Kudryavtsev
8ff1ae89bf QWindowsContext: proper check resolved function
Change-Id: I9a223dc2efa2205dc3ae8d300cf06b12e06ed0f9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-10-16 11:34:48 +00:00
Tor Arne Vestbø
25b8af0747 Clarify behavior of QAbstractEventDispatcher::processEvents
The function, although implemented differently in each event dispatcher,
is not supposed to process newly posted events, only the events that
were queued at the time of the call.

This is tested by tst_QEventDispatcher::processEventsOnlySendsQueuedEvents,
which is not blacklisted on any platforms, so we know it's the behavior
in practice.

Change-Id: If9a874eeeb8ebcebe88ed119b065ae12fc545129
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-10-16 11:27:17 +00:00
Tor Arne Vestbø
3d8846b4b9 doc: Update online CSS
Copied from the CSS served by http://doc.qt.io/

Change-Id: Id37447e0f6de4a08a2632df862ae36f73d284814
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2018-10-16 11:27:15 +00:00
Tor Arne Vestbø
3a9776689c doc: Update online HTML header URLs
Change-Id: I2109f1a3113a724bfb6bc5a03b4c7b2d67f7e48c
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2018-10-16 11:27:15 +00:00
Friedemann Kleint
a517eb24fa uic: Ignore obsolete pixmap functions
After qtbase/550d2a0a15c9403894448ab83863e71bbac2d349,
pixmap functions are used for icons as well which can cause compile
errors for old UI files that still use them.

Task-number: QTBUG-8563
Change-Id: I61bd4b9c1bf774e071a35c5806657054a77ff4d0
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-10-16 11:25:35 +00:00
Tobias Hunger
a174b3df44 Fix wrong keyword in configure.json
'description' is used only once in all configure.json files, so
I assume that was meant to be 'purpose'.

Change-Id: I66e9d9196c27d2f2131c2d57ea03895e8f5ce754
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-10-16 11:24:09 +00:00
Laszlo Agocs
e0b1c39bed Drop cached shaders when arch is different
According to reports Intel on Windows gets confused when feeding
program binaries retrieved from x86 and x64 builds into each other.

Task-number: QTBUG-64697
Change-Id: Ia7748f532ad06942a92c6fbfc4c9d1ad16bc785a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2018-10-16 07:20:12 +00:00
Ulf Hermann
402efef57b Don't drop update requests when closing and reopening windows
Before commit 4d15f393a7 update requests
were handled by a timer on QWindow. Therefore they survived the closing
and re-opening of platform windows. Now, as the timer was moved to
QPlatformWindow, it gets reset when you close the QWindow, and any
pending update requests are lost. However, we do set the
updateRequestPending variable on QWindow when requesting an update.
Therefore, we can also restore the update timer on the platform window
when creating it.

Change-Id: I23b00f24a46706beac7d1455edd8a5623db46b22
Fixes: QTBUG-70957
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-10-16 07:09:36 +00:00
Gatis Paeglis
00ae1e6b7b xcb: respect QEventLoop::ExcludeUserInputEvents in native event handlers
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>
2018-10-16 06:57:01 +00:00
Gatis Paeglis
dd8a66daa4 xcb: rework connection error handling
This patch reworks 0b1ce5db9e.

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>
2018-10-16 06:56:47 +00:00
Ulf Hermann
c89d0f9d53 QNetworkAccessManager: defer call to _q_networkSessionStateChanged
Also, call it only if the state really changes. If we stay disconnected
the whole time, there is no point in trying to create the session over
and over.

Change-Id: Ic3a92dd0575bed1a23ae36a944cc51b9741fb64a
Fixes: QTBUG-49760
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-10-16 06:46:00 +00:00
Paul Wicking
2b1913a7cb Doc: Clarify that BC does not apply to Qt Test
Task-number: QTBUG-17531
Change-Id: I59c02f456a16a48391247fdf7010358ad013c0ac
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-10-16 06:41:31 +00:00
Andy Shaw
298c00e530 Update bundled sqlite to 3.25.2
[ChangeLog][Third-Party Code] Sqlite was updated to version 3.25.2

Change-Id: I2d74ee924745a5e1edd6fe511777965313a4b77a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-10-16 06:38:34 +00:00
Friedemann Kleint
dc3dd8c5db Windows QPA: Add WM_INPUT to the list of input messages for event filtering
Amends a0a22037cd.

Task-number: QTBUG-67095
Change-Id: I32d2e78f9d9525d56c1d4477d69cf7b9d7f8e7a3
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
2018-10-16 06:05:22 +00:00
Miguel Costa
8727bbd800 Fix build failed with ANGLE
Added eglext_angle.h and gl2ext_angle.h to the list of header files
copied to include/QtANGLE during install. These two header files were
introduced by the recent ANGLE update but were not added to the install.
This was causing build failures when including the ANGLE headers (e.g.
in qtmultimedia).

Task-number: QTBUG-71158
Change-Id: If2f1a9ecfcdf509cccf2b3671adf575cc39892d4
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-10-16 05:19:43 +00:00
Gatis Paeglis
03b1380613 xcb: cleanup WM_HINTS handling
- 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>
2018-10-15 18:33:55 +00:00
Gatis Paeglis
4aa86d38ef xcb: utilize thread-safety of QAbstractEventDispatcher::wakeUp
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>
2018-10-15 18:33:47 +00:00
Gatis Paeglis
80b1cce0cf xcb: call processXcbEvents() on every event loop iteration
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>
2018-10-15 18:33:40 +00:00
Cristian Maureira-Fredes
793a36258d Fix typo vice versa
Change-Id: I639d6f9d2019998d91b52506afa2cbd861a0dbe4
Reviewed-by: Gabriel de Dietrich (DO NOT ADD TO REVIEWS) <gabriel.dedietrich@gmail.com>
2018-10-15 10:55:31 +00:00
Cristian Maureira-Fredes
1f6bfc2207 Doc: Move literal code block to a separate file
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>
2018-10-15 10:55:18 +00:00