summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Don't defer platform backingstore creation if we already have a platform windowTor Arne Vestbø2019-08-241-0/+5
| | | | | | | | | | | | The creation was made lazy in 18f415e46d592f, for those platforms (macOS) that need a platform window to successfully create a platform backingstore. But we don't need to delay creation if we actually have a platform window at the time of constructing the QBackingStore. Change-Id: I6367736ddca82900dec2751a85a8bc35cc742bb5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Choose appropriate NSWindow depth based on surface formatTor Arne Vestbø2019-08-242-15/+31
| | | | | | Change-Id: I67e63412096ca11a8f056f5755525311756906ef Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Use qsizetype for qt_memfill functionsThiago Macieira2019-08-248-29/+32
| | | | | | | | | Just in case the image is larger than 2 GB (512 megapixels). Change-Id: I343f2beed55440a7ac0bfffd15636cbc68dfa13d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 1e2bf51d3e5d891db3c1383e6567d1c77dfc8973) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QGuiApplication: drop mutex before emitting fontChanged()Marc Mutz2019-08-231-2/+5
| | | | | | | | | | | | | | Emitting a signal executes an unknowable amount of code. We shouldn't hold a mutex while doing so. E.g., if the signal emission causes another call to QGuiApplication::setFont(), the old code would deadlock, since applicationFontMutex is not recursive. Fix by taking a copy of the application font under mutex protection, then dropping the lock for the emission of the signal. Change-Id: Ib2569b3a08af6ef5f38459a19f74cb0db27b7772 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix build with -no-feature-printer on macOSAndré Klitzing2019-08-223-17/+24
| | | | | | Fixes: QTBUG-62675 Change-Id: I3bfcd6d78c3124769ff8662941472333c795fdbe Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Avoid double QCache lookup in QOpenGLProgramBinaryCacheLaszlo Agocs2019-08-221-3/+1
| | | | | Change-Id: I4384a15f0b89e1f6d7f59bff1816fc2e6fc6adfe Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* macOS: Invalidate backingstore and trigger expose on color space changesTor Arne Vestbø2019-08-224-0/+39
| | | | | | | Fixes: QTBUG-77749 Change-Id: I677a71152e4a218c08d8863d4f886d158a79e809 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Don't ask for a NSWindow background unless we need oneTor Arne Vestbø2019-08-222-15/+2
| | | | | | | | | | | | | This allow halfway transparent windows, even with a border, which is a bit of a weird use-case, but matches what we do on other platforms. We don't need the explicit call to NSDrawWindowBackground in the QNSWindowBackingStore implementation, as the NSThemeFrame will draw this background on our behalf. Fixes: QTBUG-77637 Change-Id: I012d845fa957c40aa713adaecbb1601a848e3534 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Point out that dynamically modified meta objects are not threadsafeVolker Hilsheimer2019-08-211-0/+7
| | | | | | | | | | Given that this is an exception, it doesn't invalidate the general thread-safety of static meta objects, and putting a locking mechanism into Qt for this would be complete over- (and performance-)kill. Task-number: QTBUG-70915 Change-Id: I4a538b977f5c2e8173cb236023e5d9ca34add5b5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* iOS: Fix NSUInteger vs NSInteger comparison warningTor Arne Vestbø2019-08-201-1/+1
| | | | | Change-Id: I700132084c208f4ce63e0fc0516ebc3df7881ab0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix qErrnoWarning() printing no error in some conditionsThiago Macieira2019-08-191-1/+3
| | | | | | | | | | | | Because it allocates memory, it may call system functions that set errno or Win32's GetLastError(). [ChangeLog][QtCore] Fixed a bug that made qErrnoWarning() say there was no error when generating the error message. Fixes: QTBUG-77322 Change-Id: Ife213d861bb14c1787e1fffd15b811a4f83cf3e7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* macOS: Bail out early in case a popup is closed by a mouseDownTimur Pocheptsov2019-08-191-1/+3
| | | | | | | | | | | | | It can happen that AppKit calls -mouseDown: on a popup's view, but we consider the click to be outside of popup's area (happens on the 1-pixel edge of a 'geometry', QRect::contains() returns false). If we send close event to essentially 'self', m_platformWindow is becoming nullptr. So we bail out early, no further processing is needed. Fixes: QTBUG-77348 Change-Id: I224943e6bcf4ae052412ef7dc7b23a94f999aa19 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Simplify QBezier::addPolygon() implementationEirik Aavitsland2019-08-191-18/+14
| | | | | | | | | | | Makes the code a little cleaner, avoiding an issue caused by UB and/or optimization bug in msvc2019. Fixes: QTBUG-77119 Fixes: QTBUG-77230 Change-Id: I9bc8f427a90e6fe32b3c26301bbb703a3c4ad846 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Guard with a mutex in QOpenGLProgramBinaryCache where neededLaszlo Agocs2019-08-172-0/+4
| | | | | | | | | | | While there is likely no example of it in Qt itself, applications can use QOpenGLShaderProgram instances on different threads. These instances have nothing to do with each other but they do share a global cache object. This becomes problematic without proper synchronization. Change-Id: I80faf73f34af7e67349eee916bb3f216e22c07fd Fixes: QTBUG-77469 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* DBus: fix deadlock when destroying QDBusServerMårten Nordheim2019-08-161-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | Observed infrequently in the QDBus tests, it would deadlock when destroying QDBusServer at the same time as qDBusNewConnection was being executed as they were locking the same locks, but in opposite order. QDBusServer locks d->lock, then QDBusConnectionManager::instance()->mutex. While qDBusNewConnection locks QDBusConnectionManager::instance()->mutex, then serverConnection->lock (and serverConnection here is QDBusServer's d-pointer). QOrderedMutexLocker cannot be used in this situation because it operates on QMutex*, which d->lock (QReadWriteLock) is not. Change the code to lock QDBusConnectionManager's mutex before d->lock and then unlock the QMutexLocker where it would previously destruct. If QDBusConnectionManager has already been destroyed then we pass a nullptr to the QMutexLocker which is fine and will not do anything. Fixes: QTBUG-74635 Change-Id: I7f02d7759da67377996ef042c81b0969ccb8aadb Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix macOS build with -no-feature-accessibilityAndré Klitzing2019-08-161-5/+9
| | | | | Change-Id: Id16b102feb7b57efcf1a36385a009774cb023f41 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* SSL: ALPN: Don't include empty, too long or truncated namesMårten Nordheim2019-08-162-20/+31
| | | | | | | | | | | | | As is said in RFC7301 in section 3.1 [1]: Protocols are named by IANA-registered, opaque, non-empty byte strings [...]. Empty strings MUST NOT be included and byte strings MUST NOT be truncated. [1]: https://tools.ietf.org/html/rfc7301#section-3.1 Change-Id: I2c41fa99984a53cc58803e5a264d06edac964cc6 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix typo in description of feature datestringEdward Welbourne2019-08-151-1/+1
| | | | | | Change-Id: I858512af94b5160a0008789ca972cd57307cc9e2 Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qbc.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* eglfs/kms: Re-enable drm/gbm format overrides in the config fileLaszlo Agocs2019-08-153-14/+36
| | | | | | | | | | | | Follow up to 091a386eaf91ad8932332a8aefc2df793de59f6c Defaulting to querying from the egl config is fine, but dropping support for the "format" key in the output list in the json config file is not ideal. Task-number: QTBUG-76748 Change-Id: I25dc99369d118c300cdef25b464426f6be85453b Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* QTextureFileReader: backport ASTC supportEirik Aavitsland2019-08-155-1/+260
| | | | | | | | | | Add support for astc format files as an experimental feature. To enable, configure with "-feature-texture_format_astc_experimental" (Backported from commit 5a4db421bd94acd12a4ac1f77031996b95f85dbf) Change-Id: I9a2f7b1fa20ba344b79637bafb50ff2bd0596747 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QSysInfo: Use the Apple IOKit API to get the machine's UUIDThiago Macieira2019-08-141-8/+12
| | | | | | | | | Turns out that kern.uuid is not as unique as we thought. Googling for mine finds other instances of the same being used. Fixes: QTBUG-75371 Change-Id: I95ecabe2f50e450c991afffd159850cc975ec0da Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add the detection of MSVC 2019 for QLibraryInfoFriedemann Kleint2019-08-141-1/+3
| | | | | Change-Id: Ie3ea1cdae60bf0d7dd89a0ab84146c8370559a29 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Avoid querying unknown RESET_NOTIFICATION_STRATEGY value on GL < 4.0Laszlo Agocs2019-08-142-9/+14
| | | | | | Fixes: QTBUG-55759 Change-Id: Ie2758859a6862a214691a5011761bf549a31a93e Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Include buildAbi() in the shader cache directory nameLaszlo Agocs2019-08-141-1/+2
| | | | | | Task-number: QTBUG-64697 Change-Id: I8b81bce94c50464105a9a43086b06b841e4b8551 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* glx: Do not flood with warnings when reducing during config lookupLaszlo Agocs2019-08-141-1/+3
| | | | | | | | | | | With things like sample count reducing a format (16 -> 8 -> 4 -> ...) and trying again is perfectly fine. There is no need to show warnings in this case. Even some of our own examples in qtdeclarative do a setSamples(16) which is rarely supported. These all show warnings since 8ec98fc2dc40237730f99af099dffe2920ef5bcc. Avoid this. Change-Id: Ice83d5720b02e92f77cfd63918c98ad222513b6a Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Limit curve stroking threshold to reasonable rangeEirik Aavitsland2019-08-141-1/+1
| | | | | | | | | | | | | Avoid unreasonable threshold values for extremely wide pens, since that can lead to a very high processing cost. The rare usecases where this would make a noticeable difference will necessarily also be using scaling, and so is anyway depending on setting a suitable curve threshold manually. Fixes: QTBUG-77241 Change-Id: I27cea7d566d144389bb430739fde4f6033c4a28c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Make our connection-level window half of a possible maximumTimur Pocheptsov2019-08-141-2/+4
| | | | | | | | | | | | | | Some servers seem to be unable to properly calculate our window size from a delta we send via WINDOW_UPDATE frame immediately after our client preface and the SETTINGS frame. The remote replies with a GOAWAY frame blaming flow control error. Guessing what's this magic number they use seems to be not feasible, we now use a half of what we had before. Fixes: QTBUG-77308 Change-Id: I41dacfd25a395a27003f330d01b6d8d60b8f407c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Bound the scope of QTRY_LOOP_IMPL()'s local variableEdward Welbourne2019-08-131-1/+1
| | | | | | | | | | | | | | QTRY_IMPL() exercises QTRY_LOOP_IMPL() twice, once directly, the second time via QTRY_TIMEOUT_DEBUG_IMPL(); and QTRY_LOOP_IMPL() deliberately doesn't bound its scope (e.g. with the canonical do{...}while(0) trick) so that the latter can access its local variable. Unfortunately, this means the local's declaration in the second use of QTRY_LOOP_IMPL() shadows the first. So enclose the first in braces to bound the scope. Fixes: QTBUG-77297 Change-Id: I849bfe0b8abfb517ed3e783abf86c602163db137 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QWizard: Account for missing background image on macOS 10.14+Morten Johan Sørvig2019-08-112-1/+4
| | | | | | | | | | | We were loading “Background.png” from the KeyboardSetupAssistant app bundle. As of macOS 10.14 that image is no longer there. Adjust auto tests and document the behavior. Change-Id: Icb4dd73b3fa88927e87bb86db2bc9f7b4a8094f7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Don’t show hidden windows while z-orderingMorten Johan Sørvig2019-08-111-1/+2
| | | | | | | | | | | Calling [NSWindow orderBack] will make the window visible again, and will e.g. bring back closed menus on application modality changes. Fixes: QTBUG-77281 Change-Id: I2f89b852ea9f8ab34c709cec96d93fe305984fb9 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add nullptr guard to QHighDScaling::scaleAndOrigin(QPlatformScreen *)Morten Johan Sørvig2019-08-111-0/+2
| | | | | | | | | Commit b6ded193 added an unconditional dereference of the platformScreen pointer, for calls where nativePostion is non-nullptr. Change-Id: I4a6fbbd0337f91d4fcb76c17b4dc60e1b9ad10ed Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix integer overflow in QCryptographicHash's SHA-3 supportThiago Macieira2019-08-101-4/+4
| | | | | | | | | | | | | | | Because 256 MB * 8 = 2 Gbit, but length*8 is a signed integer overflow, hence UB. Can't really autotest this. Not all systems where we're going to test can allocate 256 MB of RAM. [ChangeLog][QtCore][QCryptographicHash] Fixed a bug that caused the SHA-3 and Keccak algorithms to crash if passed 256 MB of data or more. Fixes: QTBUG-77362 Change-Id: Iec9c051acd73484c8d94fffd15b91f4b1450f5d7 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix sign change warningSimon Hausmann2019-08-091-2/+2
| | | | | | | | | The conversion from int to uint is deliberate here, so let's cast and avoid a warning for users compiling with warnings enabled. Change-Id: I7136d6161ace735be49f8d987338f6d401a5c78a Fixes: QTBUG-77245 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QBitArray: fix fromBits() and actually test itThiago Macieira2019-08-081-5/+7
| | | | | | | | | | | | | | | When I initially added it, it was ony for QCborValue, but I never added the tests. Turns out there were two bugs: [ChangeLog][QtCore][QBitArray] Fixed two bugs that caused QBitArrays created using fromBits() not to compare equal to the equivalent QBitArray created using other methods if the size was zero or not a multiple of 4. If the size modulus 8 was 5, 6, or 7, the data was actually incorrect. Fixes: QTBUG-77285 Change-Id: Ife213d861bb14c1787e1fffd15b70573d162042c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QCocoaMenuLoader: get rid of lastAppSpecificItemTimur Pocheptsov2019-08-081-21/+27
| | | | | | | | | | Look it up when needed instead. Also, simplify our ownership logic - do not retain/autorelease that is already owned by a menu (via its itemArray). Fixes: QTBUG-76523 Change-Id: I60a2ed0d192396baf99eec7b37fa5cc10e5db626 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Refactor lockedAlphaMapForGlyphLars Knoll2019-08-085-91/+53
| | | | | | | | | | | | | | | Simply return a Glyph pointer and not a QImage to avoid allocating and deleting lots of d pointers for QImage when drawing text. Saves one new/delete pair per glyph drawn and speeds up text drawing by 10% for relatively large glyphs (probably more for smaller ones). The qtext::paintLayoutToPixmap() benchmark shows a 16% improvement in performance with this change. Renamed the method to glyphData(). Change-Id: I7a353de521e4f4321c770fb1ac6043d33f6f332c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* macOS: Fix tab button rendering issueJason Haslam2019-08-081-0/+1
| | | | | | | | | | | This fixes rendering artifacts for the specific case of the first unselected vertical (west) tab button in a tab bar. The popup button gets drawn at the beginning of the tab bar instead of translated to the actual location of the tab. Fixes: QTBUG-76385 Change-Id: I17112c56eabacf34e470314d4cc6b263ba632ec1 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Add attribution for AGLFNEskil Abrahamsen Blomfeldt2019-08-082-0/+43
| | | | | | | | We were missing attribution for the AGLFN tables. Task-number: QTBUG-70968 Change-Id: Ib84cbd25c9f7c49611761c9eba16624de5b77dd2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix crash in QTextDocument::clearUndoRedoStacks()Eskil Abrahamsen Blomfeldt2019-08-081-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | When calling QTextDocument::clearUndoRedoStacks() with UndoStack, there were two bugs: The first was that we were retrieving the item at "undoState" and deleting this. This is actually the upper limit of the for loop. If the stack does not contain any redos, then it would be == undoStack.size() and we would assert. If there were redos, then we would delete the item at undoState multiple times (actually undoState times). In addition, when the loop exited, we first removed the dangling pointers using remove() and then there was a weird resize() to the new size minus the old undoState. This would either assert because we tried to resize to a negative number, or it would arbitrarily remove items from the stack. [ChangeLog][QtGui][Text] Fixed a crash bug in QTextDocument::clearUndoRedoStacks(QTextDocument::UndoStack). Task-number: QTBUG-69546 Change-Id: I8a93e828ec27970763a2756071fa0b01678d2dcd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Android: Fix QMenu on 64 bitEskil Abrahamsen Blomfeldt2019-08-085-12/+88
| | | | | | | | | | | | | | | | | | | | | The platform menu tags in Qt are actually the pointers, so they are 64-bit values when the build is 64 bit. Since menu IDs in Android are 32-bit ints, we cannot cast back and forth like we do. To fix this, we add a separate hash of menu IDs to allow mapping between Java and C++. For easier book-keeping, we add the hashes to the menu bar and menu classes, so that we can easily recycle old menu IDs when they are no longer in use. Note that overriding the tag on the menus by calling setTag() will not work, since Qt Widgets will later override it again by setting it back to the menu's pointer. [ChangeLog][Android] Fixed an issue where menus would not work on 64 bit builds. Task-number: QTBUG-76036 Change-Id: Icaa1d235d4166331669139251656ea0159e85195 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* eglfs: Fix raster windowsLaszlo Agocs2019-08-078-12/+15
| | | | | | | | | | | | | | | | | | | | | | | | Also sanitize the initial WebAssembly hack. Both eglfs and wasm lack the concept of true raster windows. A QWindow with RasterSurface is rendered with OpenGL no matter what. The two platforms took two different approaches to work around the rest of the machinery: - wasm disabled the QOpenGLContext warning for non-OpenGL QWindows, - eglfs forced the QWindow surfaceType to OpenGLSurface whenever it was originally set to RasterSurface. Now, the latter breaks since c4e9eabc309a275efc222f4127f31ba4677259b7, leaving all raster window applications failing on eglfs, because flush in the backingstore is now checking the surface type and disallows OpenGLSurface windows. (just like how QOpenGLContext disallows RasterSurface windows) To solve all this correctly, introduce a new platform capability, OpenGLOnRasterSurface, and remove the special handling in the platform plugins. Change-Id: I7785dfb1c955577bbdccdc14ebaaac5babdec57c Fixes: QTBUG-77100 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Don't rely on QWidget::internalWinId in QWidgetBackingStoreTor Arne Vestbø2019-08-071-9/+15
| | | | | | | | | | | | | | | | | | QWidget does not handle QWindow and QPlatformWindow being destroyed behind its back, and the QWidget state for internalWinId and the Qt::WA_WState_Created attribute can easily get out of sync with reality. To avoid QWidgetBackingStore mistakenly thinking that a widget does not have a platform window it can operate on we use the QWindow and QPlatformWindow handles directly, instead of relying on the winId. This is a stop gap until we can teach QWidget to deal with dynamic changes to its underlying window handles. Change-Id: Ib09bea2ad62c42e9667a20ca6b5faf0f957288da Fixes: QTBUG-74559 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QMutexPool: fix memory order of atomic operationsMarc Mutz2019-08-052-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | The array of QAtomicPointer<QMutex> can be initialized using relaxed stores of nullptr, since nullptr is the whole data. But once we store an actual QMutex pointer in the array, we need to publish the indirect data thus created. We did this, with testAndSetRelease(); what was missing was a corresponding acquire fence on load, without which there is no happens-before relationship between the writes performed by the QMutex ctor and the reads performed by a subsequent mutex.lock(), say, on the same data. Fix by adding acquire fences to all loads. That includes the dtor, since mutexes may have been created in different threads, and never been imported into this_thread before the dtor is running. As a drive-by, return a new'ed QMutex that was successfully installed directly to the caller, without again going through a load-acquire. Fixes: QTBUG-59164 Change-Id: Ia25d205b1127c8c4de0979cef997d1a88123c5c3 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 65b8f59e045bb41fef99b1a44f462115de65064a) (cherry picked from commit da38f0d691d9d7eacfac5fbcbd47b887bd59bd39)
* Fix race condition on qt_create_tls() on WindowsThiago Macieira2019-08-051-0/+2
| | | | | | | | | | | | | | | | | If this function is called by multiple threads, more than one could reach the mutex locking and call TlsAlloc(), but only the last one would save the data. The others would be leaked and, worse, be used by those other threads. [ChangeLog][QtCore][QObject] Fixed a resource leak caused by a race condition if multiple QObjects were created at the same time, for the first time in an application, from multiple threads (implies threads not started with QThread). Fixes: QTBUG-77238 Change-Id: Ife213d861bb14c1787e1fffd15b63a5818bcc807 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* macOS: Don't require setting all three color buffer sizes in QSurfaceFormatTor Arne Vestbø2019-08-022-14/+9
| | | | | | Change-Id: Iaa6eb4d64f549a31aa5c53145e8b37facec4ea78 Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix QPainter's ColorDodge and ColorBurn composition modesPavel Artsishevsky2019-08-021-6/+18
| | | | | | | | | | | Added checking corner cases (more specific formulas) in color_dodge_op()/color_dodge_op_rgb64() and color_burn_op()/color_burn_op_rgb64() to produce correct results for any input. Task-number: QTBUG-77231 Change-Id: I274f80b356bd4236a9176a84a95604c2eb01787a Reviewed-by: Konstantin Tokarev <annulen@yandex.ru> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* macOS: Add system detection and version defines for macOS Catalina (10.15)Tor Arne Vestbø2019-08-013-4/+19
| | | | | | Change-Id: I127efe752ebb70825f1b31f0d64c4293d1c71820 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@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>
* qlalr: fix compilation with C++20Marc Mutz2019-08-011-2/+8
| | | | | | | | | std::not1 is deprecated in C++17, removed in C++20. Use its replacement, std::not_fn. Change-Id: I37d4929c81c2a5befeb44f954ae77b23960d2ff0 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>