When a datagram is sent to a closed host/port combination, the host will
likely send back an ICMP error message. In the regular socket API, there
isn't a good way of actually receiving this error, so some Windows kernels
wired that message back up to the call to WSARecvFrom() as a synthetic
datagram. Reading this datagram results in a WSAECONNRESET error code,
which should reported to the user as a refused connection attempt.
To make the errors a bit more informative, the native error strings for
WSAECONNRESET and WSAENETRESET were also added.
Task-number: QTBUG-49301
Change-Id: If659be54ba1b39965b5f481f0c0cb9eeea0a06d2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
The system call is not present on earlier releases, and since the 9.x
series will be supported until the end of 2016, add a check for the
__FreeBSD_version macro and only enable pipe2 support if the value is
high enough.
Change-Id: I5633531cec7e95d42ff5f4b14afe772ae8d7d66d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is a follow-up to c8c4ad0 ("forkfd: Define __BSD_VISIBLE and
_NETBSD_SOURCE").
Defining those macros in forkfd.c is not enough: forkfd_qt.cpp also sets
_POSIX_C_SOURCE, and sys/cdefs.h can be included implicitly via Qt's
headers (<algorithm> ends up pulling unistd.h that leads to sys/cdefs.h
and sys/types.h with both libstdc++ and older libc++ versions). In this
case, __BSD_VISIBLE/_NETBSD_SOURCE are not defined, _POSIX_C_SOURCE is,
several type definitions are omitted and by the time we include
sys/time.h in forkfd.c the build fails. On FreeBSD < 11, the error looks
like this:
In file included from io/../../3rdparty/forkfd/forkfd.c:36,
from io/forkfd_qt.cpp:80:
/usr/include/sys/time.h:94: error: 'u_int' has not been declared
Change-Id: I01fa2f5861027d99936d3026faeee9f0db3ecabd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
pipe2's availability on BSD operating systems depends on the
__BSD_VISIBLE macro on FreeBSD and OpenBSD and _NETBSD_SOURCE on
NetBSD (DragonFly BSD appears to define it unconditionally).
Those two macros are generally set by default, except when
_POSIX_C_SOURCE is set. Since we consciously set _POSIX_C_SOURCE but
need pipe2, explicitly define the visibility macros.
This fixes the -no-pch build on FreeBSD at least.
Change-Id: Icc77f6b5d1f9a5bf7bd8048cabbb01f8f89397cc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In bind+connect scenario, rejected connection can trigger a read
notification while the socket is opened. But unlike UDP, reading from
the socket engine or emitting a readyRead() signal is not allowed for
the TCP socket in bound or connecting state.
To make a bind+connect scenario work properly, disable the read
notifications until a connection is established.
Task-number: QTBUG-50124
Change-Id: I7b3d015b0f6021fb9ff9f83560478aa5545f41f5
Reviewed-by: Richard J. Moore <rich@kde.org>
install_sys_qpa() is called for each QSystemTrayIcon::show(),
leading to spurious calls of user slots if the signal isn't
disconnected on remove_sys_qpa().
Task-number: QTBUG-48068
Change-Id: Ic830250c71fee6b584550ab5aabf54289e478fcb
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Richard Rondu <rondu.richard@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
This partially reverts commit 025d6a778c.
Change-Id: I7b964b0d598abe46137c22177fe2b5dcca5bb812
Task-number: QTBUG-49831
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Commit ed0c0070 introduced qt_subtract_from_timeout but used it
incorrectly in several places.
Change-Id: I80ea16088707929a45d5a61ec6f3370f8e63d1cd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
When the byte sequence for a BOM occurs in the middle of a utf8 stream,
it is a ZWNBSP.
When a ZWNBSP occurs in the middle of a utf8 character sequence, and the
SIMD conversion does some work (meaning: the length is at least 16
characters long), it would not recognize the fact some charactes were
already decoded. So the conversion would then strip the ZWNBSP out,
thinking it's a BOM.
The non-SIMD conversion did not have this problem: the very first
character conversion would already set the headerdone flag.
Change-Id: I39aacf607e2e068107106254021a8042d164f628
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
A few things were changed in Android 6.0
Task-number: QTBUG-49323
Change-Id: I3112d885881dce541d5c4f3a1561f6c34d75e319
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
(cherry picked from commit 361e24b79e)
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
When touchpad scroll direction is inverted, verticalIncrement and
horizontalIncrement of scrollingDevice are negative, and rawDelta
remains unfilled. It leads to pixelDelta.isNull() being true in wheel
event handler even when XI2 smooth scrolling is available on the system.
Fix that and fill rawDelta with correct values when inverted scroll
direction is used.
Change-Id: I9c0bdbad2c6b9bbed765eaa895dca300c5c70e86
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Merged in the upstream version, which obsoleted some local
patches. The remaining diff to clean 1.6.19 is archived in
the qtpatches.diff file.
Change-Id: I676df2dab2c52c7fe576de284d472d70206f0a8c
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
When increaseCost() is called then it will convert from bytes to kilobytes
so we need to specify the cache_cost to be in bytes.
Task-number: QTBUG-47812
Change-Id: I842514c9ab4d86b60b2beb6c80979156ea0de59c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
It was possible for the cache to increase too quickly since it was
relying on the timer to decrease which caused problems with FreeType.
So by checking if it will be increased to be over the limit first before
adding the new font, we can decrease it earlier in preparation.
Task-number: QTBUG-47812
Task-number: QTBUG-49535
Change-Id: Iedc042d8903949140aa8c5257a9d54cde31a51be
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Change-Id: I3485501643c60f28ef188100146ac305e3ef9073
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Without deleting m_inputDeviceManager instance it will remain
in process and causes crash when creating+destroying QGuiApplication
multiple times in process. Crash happens because m_inputDeviceManager
already exists when creating new instance of QGuiApplication and
metadata for QInputDeviceManager is not anymore valid and crash when
accessing it e.g. using connect() function.
Change-Id: I5acb1c5f6ce2ba9665fa893047210a913debe4e4
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Memory leak occurs when 'release' pointer variable is overwritten
for second use without releasing resources it is currently pointing
to. Leak occurs only in specific edge case depending on
client/server versions.
Task-number: QTBUG-49789
Change-Id: Ie5be8996ed158309f20dbb3574f956d2eb137460
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
It is filesystem dependent if flock and fcntl locks are independent or
the same underlying lock (which causes getting the second lock to fail).
A temporary file in /tmp might be on a local file system and pass
while the lock file is placed on NFS and fail with:
setNativeLocks failed: Resource temporarily unavailable
Instead check for lock conflicts per path and cache the result.
Change-Id: I39c59bb240cd99ef0a0ec271243770ffd5df8a7d
Reviewed-by: David Faure <david.faure@kdab.com>
There can be a bit of confusion here regarding what removeMappings()
will do in this case so add an explicit note to be clearer.
Task-number: QTBUG-49499
Change-Id: Iabcf5cb2653f0b747727b2c92a244e95ec1836f8
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
QConfFile::isWritable() has the extra effect that it will try and
create the path where the file should be if it does not already
exist. So this cannot be omitted as 'qmake -set' may be used in a
situation where the path does not yet exist.
Change-Id: I0113644259f78d090a0687c44cf60d400be9c859
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This was added in 5.3 in 30d199a76c.
Change-Id: I35a209fcfe417cb14605c4db19a3d2e85b67ee49
Reviewed-by: Michał Dutkiewicz
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The C++ standard says it must, but some badly-configured toolchains seem
to be lacking support.
In particular, for some 32-bit platforms without native support for
them, GCC implements 64-bit atomics via out-of-line functions in
libatomic. If that library is missing... well, then std::atomic 64-bit
doesn't work and we mustn't try to use it.
This was found when trying to compile Qt 5.6 for MIPS 32-bit:
Linking library libQt5Core.so.5.6.0
.obj/qsimd.o: In function `std::__atomic_base<unsigned long long>::load(std::memory_order) const':
/opt/poky/1.7/sysroots/mips32r2-poky-linux/usr/include/c++/4.9.1/bits/atomic_base.h:500: undefined reference to `__atomic_load_8'
.obj/qsimd.o: In function `std::__atomic_base<unsigned long long>::store(unsigned long long, std::memory_order)':
/opt/poky/1.7/sysroots/mips32r2-poky-linux/usr/include/c++/4.9.1/bits/atomic_base.h:478: undefined reference to `__atomic_store_8'
Yocto bug report: https://bugzilla.yoctoproject.org/show_bug.cgi?id=8274
Change-Id: I42e7ef1a481840699a8dffff140224d6614e5c36
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3d7586b760)
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
[ChangeLog][Platform Specific Changes][OS X] Configure with -no-rpath
will now yield Qt dynamic libraries and frameworks with an absolute
install name (based in -libdir).
OS X package managers like Homebrew install Qt in a fixed location. This
change simplifies deployment for such package managers and is consistent
with the default expectation on Apple platforms for libraries with a
fixed location to also have absolute install names.
While a relocatable installation (the default) also works in this
scenario, it requires all software that depends on Qt to be aware of
this and to embed a suitable RPATH into application binaries (which is
not automatic for non-qmake builds). This might not be true for some
select fallback search locations, but as package managers on OS X tend
not to use those, embedding an RPATH becomes practically mandatory. In a
default Homebrew installation, Qt is configured such that the frameworks
end up in /usr/local/Cellar/qt5/<version>/lib and that will be later
symlinked to /usr/local/opt/qt5/lib, both of which are not searched by
the dynamic linker by default.
Task-number: QTBUG-48958
Change-Id: I4395df98771e06a2ce8a293d11dc755bdc50757f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
The ifdef gave an impression of the code path being hit only when
texture-backed widgets are present and OpenGL-based compositing is
active. This is false. Asserting on having a context current is
wrong (as shown by autotests on the 5.6 branch).
Change-Id: I2539f0aac75b26597f49f63edcd9580428be79b7
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Set the DXGI_MWA_NO_ALT_ENTER to suppress the Alt-Enter shortcut
causing the window to become full screen.
Task-number: QTBUG-44904
Change-Id: Ia4156ddee37a8a3da6e9e3130022c63a674f4429
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Ideally all printer drivers would add beyond DMPAPER_USER for their custom
sizes. However some printer drivers add beyond DMPAPER_LAST instead so we
need to check if the value is past DMPAPER_LAST and consider those as a
custom size.
Task-number: QTBUG-47272
Change-Id: I1bcb01c08fe605cc484769b0301cfcd7b8f66157
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
The change 8c0f47cfae17a39137dec47aa0b9f3f9bedad introduced a problem
where if the widget was being reparented had a valid HWND then it would
cause the focus to change inside the already active window. Therefore we
need to limit the times it does this to the case where we know it needs to
be done which is the ActiveQt case.
Change-Id: Ia85f5136661142b25952e0ebf66f8a43d9500d58
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
SSLSetProtocolVersionMin/Max were introduced _only_ in 10.8 and
we need a workaround for 10.7 - use SSLSetProtocolVersion or SSLSetProtocolVersionEnabled.
Change-Id: I4b7ed9fda21e2c374a98fd777253280e8013ffde
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
On OS X SSLCreateContext is quite recent - it requires OS X/SDK version
>= 10.8. Since SecureTransport back-end is the default one in Qt 5.6,
make it also work on OS X 10.7.
Change-Id: I364feff9dd95772fcea926494b2d4edaffd2dde1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Neither the default nor the eglfs-specific backingstore release the OpenGL textures
that are in use when render-to-texture widgets are involved.
The result can be fatal on embedded devices that run out of GPU memory at after showing
and closing dialogs and popups a certain number of times.
Task-number: QTBUG-49363
Task-number: QTBUG-49399
Change-Id: Ia7471b037f147bcca0a4f1db5808ca348e230547
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
When we changed sending key events through QPA instead of directly to
the focus object, we only flushed from deleteBackward (06be9f026). The
reason was to avoid unnecessary flushes, as this in general can be a
source to recursion problems.
It turns out that this is also needed when sending Qt::Key_Return. The
reason is that we sometimes resign first responder when the return key
is pressed, which will also change the focus object in Qt. And without
flushing the key event first, it will be processed after the change and
therefore end up at the wrong object.
It seems like the most sensible thing is to always flush upon receiving
spontaneous key/text events from iOS, which is also how it was before.
Task-number: QTBUG-49021
Change-Id: I44885a11275dee5039ef6a8abbcbdadc092695e7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Wrap related code in QNativeSocketEngine and the tuiotouch
plugin in conditionals.
Change-Id: Ic6861b1c6a9e041fa8a50f96149f7280473a9fba
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is follow-up for QTabBar fix ea47d152b3.
In native OS X applications using mouse wheel on combo boxes have absolutely no
effect. We should bring the same behavior to Qt based OS X apps too, as users
are complaining of unexpected behavior, eg. randomly switching Qt Creator
sidebar mode when scrolling file list and moving mouse pointer little bit
above. Moreover inertial mouse behavior on OS X makes combo box usually move
several indexes, rather than single one on slight finger slide.
This also applies to iOS apps so the change affects all Apple platforms.
Task-number: QTBUG-10707
Change-Id: I6582265039198707ad8c2f54de96ee2a0b0e0b47
Reviewed-by: Adam Strzelecki <ono@java.pl>
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
When inheritedMask is 0, the font inherits just everything; in this case
`inheritedFont.resolve(baseFont)` could be replaced with `baseFont`.
Change-Id: Ic3ed8ef174493544ada32037e7bdded46eb4bd43
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
The "previous" value is always 1 when the compare-and-swap succeeded,
instead of the previous value.
Instead of fixing this, let's just remove this file a bit earlier than
the rest. All of them will be removed in Qt 5.7 anyway, so let's leave
MIPS atomics to the compiler.
Task-number: QTBUG-49168
Change-Id: Idba8c29717f34c70a58fffff14133304595165f5
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
A QAbstractSocket can be close()'d at any time, independently of its
current connection state. being closed means that we cannot use it to
read or write data, but internally it might still have some data to
send or receive, for example to an http server. We can even get a
connected() signal after close()'ing the socket.
We need to catch this condition and mark any pending data not yet
written to the socket for resending.
(cherry picked from commit 0df5d07929)
Task-number: QTBUG-48326
Change-Id: I67d9ad36f7288c9c6bef51aa6253d7b187737601
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
glslang_tab.cpp was not created in the right subdirectory.
This amends commit 69167189.
Change-Id: I031499baa53b72a1923883c58eb5ddfc2a02789a
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
After canceling the asynchronous read operation, the
notified() slot receives ERROR_OPERATION_ABORTED.
We must not handle this situation as an error.
This amends commit 5ce567c5.
Task-number: QTBUG-48336
Change-Id: Iff948ceb3ad1f805a9de8c188fbc39ed4c76ba82
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>