The code was added in 2005, ifdefed out already, and never used.
Change-Id: Ic5d070dd031665a4429739278851b50646694bf9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
QMacStyle polishes QMdiSubWindows to have autoFillBackground set to
false. If the QMdiSubWindow's widget also doesn't fill the background
(like QLabel), then nobody fills the window in a tabbed QMdiArea, and
the other subwindows show through.
This change makes sure that all pixels are painted in that situations,
using the styled frame.
Fixes: QTBUG-76214
Change-Id: Iae025d15d36a8bc0d0c5838ac43c9d54944bcc83
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
QSslSocket (OpenSSL backend) does not use mutex/locks during
a handshake, so we re-enable previously skipped tests.
This reverts commit 8c87a1402c.
Change-Id: I994b085f016f0eb18b3ba439a7041ea08cd3577b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This is to support rare setups involving an X11 server with multiple
independent displays ("zaphod heads" on which the DISPLAY env var
is different), possibly with multiple outputs forming a virtual desktop
on each display.
QMenu::popup() has been assuming that it should show on the screen where
the mouse cursor is. That's good most of the time; but with multiple
independent screens, QGuiApplication::screenAt(pos) cannot tell us which
screen to use (it's ambiguous), but rather will choose the first screen
that _could_ contain that position (as documented). In the example in
QTBUG-76162, the QMenu has been constructed with a QDesktopScreenWidget
as its parent specifically for the purpose of telling it which screen to
pop up on; so we need to respect that. But QWidgetPrivate::init() sets
the QObject::parent() to null (because the widget isn't actually shown
as a child of the QDesktopScreenWidget), and QWidgetPrivate::create_sys()
sets initialScreenIndex back to -1 to provide freedom to change the
screen later; so QMenu has to remember the screen index for itself.
QMenuBarPrivate::popupAction() searches the siblings of the screen on
which the menubar is claiming to be (rather than all screens on all
displays), to find the screen containing the point at the middle of the
bottom edge of the clicked menubar item. It then sets initialScreenIndex
so that QMenu::popup() will respect it rather than trying to decide for
itself.
Fixes: QTBUG-76162
Change-Id: I7a8f8e7aa2e9cf5340d446dc12726369ebe2589a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
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>
Converting an out-of-range FP to integer is UB. See comment in
qnumeric_p.h.
Change-Id: Ief874765cd7b43798de3fffd15a9bfe2c5fbbc01
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This is the worst fix ever, adding one more qWait. The test has been
updated in the 5.13 branch, so there a different fix will be needed. For
now this is in line with the rest of the code.
This test is currently one of the worst offenders when it comes to flaky
tests.
Task-number: QTBUG-64639
Change-Id: Ia1e71cc948997408b9658839013c9ad098111033
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
When our QSslSocketBackendPrivate (OpenSSL backend) was developed,
the ancient versions of OpenSSL did not have an API needed to pass
an application-specific data into verification callback. Thus the
developers resorted to the use of global variables (a list with errors)
and locks. Some of our auto-tests use QNAM and in-process server.
Whenever the client (essentially qhttpthreadeddelegate) and the server
live in different threads, any use of 'https' is dead-lock prone,
which recent events demonstrated and which were previously observed
but not understood properly (rare occasions, not always easy to
reproduce). Now we fix this for good by removing locking.
There are two places (in 5.12) where these locks are needed:
1. Before calling SSL_connect/SSL_accept (handshake) - here
we reuse the same trick we do in PSK callback ('SSL' has
an external data set, and it's 'this', meaning an object
of type QSslSocketBackendPrivate).
2. The static member function 'verify', here we do not have
'SSL', but we have our temporary 'X509_STORE', to which
we can directly attach an external data - a pointer to
a vector to collect verification errors.
Note, this change assumes that OpenSSL Qt is build/linked
against is at least of version 1.0.1 - we set external data
on SSL unconditionally (no version checks).
Fixes: QTBUG-76157
Change-Id: I05c98e77dfd5fb0c2c260fb6c463732facf53ffc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
We read the data into the iterator from the system, but then recreate
the QStorageInfo object based on the rootPath, and then stat, discarding
the data in the iterator.
We can overwrite the data with the information in the iterator, which
partially fixes the issue. Volume information that can only be retrieved
by stat'ing the root path, such as size information, will only be
correct for one of the entries.
Change-Id: Ie98590876d6a5f525af009f4ff5d595cbc308b3f
Fixes: QTBUG-63209
Reviewed-by: Andrius Štikonas <andrius@stikonas.eu>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Normal sources are built using $(CXX), which is defined in the makefile,
but can be overridden. We should do the same lazy evaluation of the
compiler for headers.
Change-Id: Ic548786bd18ed8fb7eb0b58a527615ab19000323
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
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>
With Web Engine, QQuickWidget or similar, the code can hit on the offscreen
window, when its handle is null. Add a check.
Amends 3af7b27917.
Fixes: QTBUG-76440
Change-Id: I123633d18386efd3dbfb22aad6072e4f0877a62e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
On Linux this role is needed to make desktop notifications work.
There is no equivalent for Windows, iOS or macOS. On these platforms the
role will have no effect.
Fixes: QTBUG-76333
Change-Id: I4ef3b3321f7a0e2c09c1ce432a668428d14c52b7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
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>
Since e9e16c7464 running webengine application you can get
warning "Attribute Qt::AA_ShareOpenGLContexts must be set before
QCoreApplication is created."
WebEngine set shared open gl context on qt_call_pre_routines, so
when QCoreApplicationPrivate init() runs.
Fixes: QTBUG-76391
Change-Id: I5fc146ed70054b0c1597fe06615cea2d7a8969d8
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
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>
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>
QTBUG-66380 introduced a behavior change drawing a checkable menu item
with an icon. After this path the checkmark and icon was drawn.
Revert this regression so the stylesheet style matches the behavior of
all other styles. A checkable item should have two different icons
(QIcon::On and QIcon::Off).
Fixes: QTBUG-74655
Task-number: QTBUG-66380
Change-Id: I32ac2f397087a1c3d5d07400372109703c00c1ba
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
If the QMAKE_CXXFLAGS already had -ffat-lto-objects, the *= wouldn't add
it it again, after our "-flto -fno-fat-lto-objects", which meant the
last one would stand.
Change-Id: Ic9cfa6256b5045caa6e6fffd15a7f6cda7aaa837
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
We need one scale() function for each type: the scale factor can be
inverted by the caller for the fromNative case. Add a generic
templated implementation which will handle simple types. Add add
specialization functions for compound types that don't have
operator*(), as well as for position types (e.g. QPoint) which account
for the origin.
There's no need for fromNativePixels() and toNativePixels() overloads
for each type; replace with generic implementations which call
scale(). Do the same thing for fromNativeLocalPosition().
Some user code is calling fromNative()/toNative() directly, so leave a
definition of those functions around for now. Also leave a couple of
one-off scaling functions which do not fit the pattern.
Also fix “narrowing conversion scaleFactor to int” warning for the
QMargins scale function.
Change-Id: Ia67accbb670a80dc1747c2e264b97aab75b1251b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
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>
If this callback is not set then OpenSSL will call the callback
used for <= TLS 1.2 unconditionally when connecting. If using PSK it
will call it again later once the preshared key is needed.
We don't currently handle the TLSv1.3 PSK, but we definitely should.
But for now we can work around it - when psk_use_session_callback is
called we simply change the PSK callback to a dummy function whose only
purpose is to restore the old callback.
This is mostly done to keep behavior the same as it is now for users
(and to keep our tests running).
Later we can add a new signal and handle this new feature properly.
Task-number: QTBUG-67463
Change-Id: I4aca4ae73ec4be7c4f82a85e8864de103f35a834
Reviewed-by: Simo Fält <simo.falt@qt.io>
In this threaded setup the server can sometimes have the data before it
calls "waitForReadyRead", what happens then is that we fail the wait and
as a result the test fails overall.
Let's check if we actually got some data after all and then continue if
we did. Since both the client and the server currently wait the same
amount of time (2s) the max timeout for the client was increased by
0.5s so it has some time to notice that the server got the message.
Change-Id: Ib5915958853413047aa5a7574712585bcae28f79
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit e79b1dcdf5)
Reviewed-by: Simo Fält <simo.falt@qt.io>
We use global object to store errors found by q_X509Callback.
Thus, we also use a lock/mutex. It would appear all tests
involving in-process server and QNAM are prone to intermittent
failures on our Windows VMs - it's always about timeouts due
to the client socket (QNAM) locking and the server socket blocking
main thread while trying to acquire the same lock.
The real fix is to get rid of global variable/locking, we'll
have it later (quite a change and requires a lot of accuracy).
Task-number: QTBUG-76247
Change-Id: Iffc90d9e16783f17f62e836e01c35f22681bdd39
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 91ab70d17f)
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
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>
[ChangeLog][Third-Party Code] Updated bundled SQLite to version 3.28.0
Change-Id: I3561ec3bcf80fe6062ccab27f1008dfda66e1187
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
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>
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>
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>
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>
The code for generating round line joins is optimized with a shortcut
for the inner, normally invisible joins. For certain joins of a
tightly turning bezier, this optimization would lead to visible
painting error. Fix by avoiding the optimization if the next control
point is so close as to allow such tight turns.
As a driveby, make the angle > 90 test cheaper, since absolute
precision is not required in the optimization choice.
Fixes: QTBUG-75008
Change-Id: I293e0776003310dc36fa7f43fbcd9c25f1f8fa5d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
More aggressively skip processing empty spans.
Tested with the qpainter benchmark on armv7; yields
small but measurable improvement.
Change-Id: Ie0ed0f824a0be7bcc2de3a9aa98ebccb0e8accae
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
@3x is in use on iOS already, so extend the handling in QImageReader
to all single-digit factors, like QIcon does.
Fixes: QTBUG-76273
Change-Id: Ic9442731c0549dbe8f797e1ddb1a09d8447e8441
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Fix test for systems that do not resolve their hostname to localhost.
Not using name resolution also makes the test more robust.
Change-Id: I558b9a975b9021536709db87fbf6a3b314f7ca79
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Set name for pthread instead of "name too long" for easier tracking.
Change-Id: Iab22cbeac01277e4dc1325399c7892de2e5bd551
Reviewed-by: Timo Aarnipuro <timo.aarnipuro@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>