summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* use write_file() to create the response file with the includesOswald Buddenhagen2014-01-291-36/+11
| | | | | | | | it's much shorter and faster. Change-Id: I6a37e9ece4ac550d1887fa53523b85046d398c8c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Windows: Simplify cursor code.Friedemann Kleint2014-01-291-44/+8
| | | | | | | | | | Streamline code, remove unused arrays (Qt::PointingHandCursor is handled in other switch-clause). Task-number: QTBUG-36266 Change-Id: I533965ca4910230deefa8150d50b3ac677baaf1a Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Document Qt::NoFormatConversionAllan Sandfeld Jensen2014-01-291-2/+3
| | | | | | | | | | The Qt::ImageConversionFlag Qt::NoFormatConversion is necessary to generate QPixmaps not in ARGB32PM which can be useful when not used as a paint device. Task-number: QTBUG-36031 Change-Id: Ic2d3ccd59285dd18890f07f3205a2a219ce3aa40 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* [QNX] Implement the requestActivate functionFabian Bumberger2014-01-292-3/+52
| | | | | | | | This allows manually transferring focus from one window to another, if the application has focus. Change-Id: If73ddca6ffbb735eaf4ee9fd322d978f9366fb4c Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* Tests for semi transparent blend on opaque formatsAllan Sandfeld Jensen2014-01-291-0/+110
| | | | | | | | | This patch adds tests for the consistent handling of transparent drawing results on opaque formats that was introduced with commit 6f7d370adec3054656f36b0d2a0777a8a1df3602 Change-Id: If5d11d0f2e111ef88490a4dc20a64b0858ad5426 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Fix performance regression in mirroring QBitmapAllan Sandfeld Jensen2014-01-291-1/+2
| | | | | | | | | | The recent split of qimage.cpp meant mirror_horizonal_bitmap had to access the bitflip array using a function call. The function call was placed in the inner loop, but should have been moved out of the loop as it can not be inlined. Change-Id: Id771b2fb7e6c2bfa59670ee96a857a529da13c0b Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* QNX: Cleanup some issues in QPABernd Weimer2014-01-294-5/+9
| | | | | | | | | | | * Avoided crash, if root window is reparented * Corrected video window name * Made parent window member private again Change-Id: Icef9fad5495413e0de87c4366f25dad6c4fd5775 Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* Fix tst_QLocale::windowsDefaultLocale().Friedemann Kleint2014-01-281-16/+35
| | | | | | | | | | Adapt to Windows-version-specific changes. Task-number: QTBUG-36306 Task-number: QTBUG-33718 Change-Id: I8275423f6f79ede3c3903a646b731eba2182e83c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fixed Drag and Drop driven by touch-synthesized mouse events.Friedemann Kleint2014-01-281-5/+102
| | | | | | | | | | When dragging by touch driven by synthesized mouse events, the cursor is suppressed. Use a popup window to show the drag cursor instead. [ChangeLog][QDrag][Windows] Fixed Drag and Drop driven by touch-synthesized mouse events. Change-Id: Id8c1aab79a091c89986ee7ee62ded44a3267fd3f Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* QNX: Create the egl context according to the version in QSurfaceFormatFabian Bumberger2014-01-282-4/+4
| | | | | | | | Change-Id: Iee556d51ad1d7db2593e3996da4d90d938d13e17 Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Bernd Weimer <bweimer@blackberry.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* [QNX] Introduce proper screen error handlingFabian Bumberger2014-01-2811-261/+332
| | | | | | | | | | | | | | | | This patch adds a new function which does the error handling for libscreen calls. The patch introduces following changes: - Libscreen errors will not crash (qFatal)the application any more but rather post a warning message. -With the "flush-screen-context" option the screen_context is always flushed when a screen function is called. This enables better correlation between the time an error happens and the time it is logged. Change-Id: Ie2456e5b746dcf917d786f3b832847d2ebbe5f1e Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Roger Maclean <rmaclean@qnx.com> Reviewed-by: Bernd Weimer <bweimer@blackberry.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* Fix application font removal when using FontConfigFabian Bumberger2014-01-285-113/+163
| | | | | | | | | | | | | | | | This patch fixes an issue when a font that was added with QFontDatabase::addApplicationFont can not be removed any more. The reason for that is that QFontconfigDatabase::addApplicationFont adds the font to the FontConfig application set from where it cannot be removed any more and is picked up every time the font database is repopulated (e.g. after a call to QFontDatabase::removeApplicationFont). This also fixes the QFontDatabase autotest which unfortunately does not fail on linux, because it tries to add "FreeMono" (which in most cases is already there as a system font). So this patch removes FreeMono and adds LED_REAL as test font. Change-Id: I2fa5f4df0ad2099ac28673760ea25234c725dfc6 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* QPrintDialog manual test: Break endless loop for invalid DPI.Friedemann Kleint2014-01-281-6/+11
| | | | | Change-Id: I8684f144e27392f834f91adef17826b77de60b93 Reviewed-by: John Layt <jlayt@kde.org>
* Add translator's comments to accessible names of dock widget buttons.Friedemann Kleint2014-01-281-0/+2
| | | | | Change-Id: If18126d5b349e072d7057d4e6968d6f91c910c87 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* QWindowsCursor: Add API for determining the cursor state.Friedemann Kleint2014-01-282-0/+23
| | | | | | | Detect the 'suppressed' state new in Windows 8. Change-Id: I0faa994aa7b91869cedba36b777b1784818efcce Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Windows: Refactor QWindowsOleDropSource.Friedemann Kleint2014-01-281-45/+69
| | | | | | | | | | Introduce a struct CursorEntry for the cursor map which also contains pixmap and hotspot required for follow-up changes. Streamline code in createCursors(). Fix cacheKey checks in GiveFeedback() to trigger for non-zero keys only. Change-Id: Iafcbfd9ec9e8c6ae8bbaced21667887b10b47f23 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* qprintengine_win.cpp: Fix assert when printing with custom page sizes.Friedemann Kleint2014-01-281-1/+1
| | | | | | | | Task-number: QTBUG-36348 Change-Id: I57c8905e007ccd9cf558af03f19f2969009b32c2 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: John Layt <jlayt@kde.org>
* tst_qcolumnview: Set layout direction on widgets instead of application.Friedemann Kleint2014-01-281-9/+8
| | | | | | | | Most of the test is executed in RTL mode since it is never restored. Task-number: QTBUG-36395 Change-Id: I110966085a5a265f093fc4479eebc1f1bf0614c1 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Explicitly use libstdc++ for non-C++11 static buildsTor Arne Vestbø2014-01-282-9/+9
| | | | | | | | | | | | | | | | | | | | | | Otherwise the compiler may choose libc++ based on the deployment target, and we'll end up with broken builds due to the mismatch between the two libraries, eg: Undefined symbols for architecture x86_64: "std::ios_base::Init::Init()", referenced from: __GLOBAL__I_a in libQt5Qml.a(qv4object.o) ... "std::ios_base::Init::~Init()", referenced from: __GLOBAL__I_a in libQt5Qml.a(qv4object.o) ... "std::__throw_length_error(char const*)", referenced from: ... This problem is not iOS specific, which is why the logic is moved to the more generic mac/default_post.prf. Change-Id: I28b94e614f9167fc0db84bbf1c88dd97d5629938 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Ensure C++11 support matches between Qt and user projects for static buildsTor Arne Vestbø2014-01-281-2/+11
| | | | | | Change-Id: Id529fb7fc52d2da312bcf17612e47c74939a617f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* If DblClick, do not deliver 'duplicated' MouseButtonPressRick Stockton2014-01-278-7/+81
| | | | | | | | | | | | | | | | | | | | | | | QWidgetWIndow: In Qt4, when Qt created a MouseButtonDblClick event, Qt would consume the causing MouseButtonPress. It would send only the derived dblclick event to widget windows and their children. This change makes Qt5.3 and higher emulate Qt4 delivery of double click-related events to widget windows and their children. QML objects (e.g. mousearea) continue to receive the second MouseButtonPress. [ChangeLog][QtGui][QWidget] MouseButtonDblClick: Do not send the 2nd MouseButtonPress event to Widgets. Restore Qt4 behavior in sequence of mouse events delivered to widget windows and their children. Task-number: QTBUG-25831 Change-Id: Iff0f9c592bceacb2ca844d30f8180081e136a889 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Use a fake directory model instead of QDirModel in item view tests.Friedemann Kleint2014-01-275-82/+201
| | | | | | | | | | The tests then have a predictable, stable environment and do not depend on file system operations. Task-number: QTBUG-23697 Change-Id: Ibbd356f8bd7419ec4a3a88d2c0b5cd0830049790 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* tst_qmdisubwindow: WindowCloseButtonHint is a standard window flag, tooBastiaan Veelo2014-01-271-1/+1
| | | | | | | | Implemented that way in src/widgets/widgets/qmdisubwindow.cpp:2081. Change-Id: I82fdf0c04f1655a130c5e6a6f1e23d325d546ab3 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Fix nested template declarations for non-C++11 buildsTor Arne Vestbø2014-01-271-4/+4
| | | | | Change-Id: Ie38aae09033a47106a4a1cf2e9997f90961a4e33 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* moc: Make error message 'too many input files' more verbose.Friedemann Kleint2014-01-271-1/+1
| | | | | | | Make it easier to diagnose quoting errors in scripts. Change-Id: I17894a426faa5cdf50f5ace4ed422ab2bd202558 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Improve direct2d backing store implementationLouai Al-Khanji2014-01-2711-206/+340
| | | | | | | | | | | | | | | | | | | | | | Add a per-window swap chain to a QPlatformWindow subclass instead of tying it to the backing store. This is needed to support native widgets (as opposed to alien widgets). Change the backing store to draw to an intermediate pixmap and flush to the requested window by using the per-window swap chain. This also opens the door for faster window presentation later on by using the swap chain more intelligently. Also add a changelog entry for the direct2d plugin, which was omitted earlier. [ChangeLog][QtGui][Windows] Introduce experimental direct2d platform plugin for Windows. This plugin shares most code with the current windows plugin, but substitutes a direct2d-based paint engine for window backing stores and pixmaps. Change-Id: I5f54e7e4c1fb15b1639bd26b712fb40ac141e4ac Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Fix QArrayData checkKai Koehne2014-01-261-6/+3
| | | | | | | | | The support for QArrayData variadic arguments without C++11 for GCC has been removed in commit 69478da0f0d . Change the autotest to reflect that, too. Change-Id: I40468f5d67cb2db553fd7a7d5b604f46403ac538 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Enable adding/removing application fonts on iOSTor Arne Vestbø2014-01-252-18/+51
| | | | | | | | | | | As CTFontManagerCreateFontDescriptorsFromURL is not available on iOS < 7.0 we unfortunately need to fall back to the old behavior of only adding a single font on older iOS versions. Task-number: QTBUG-34490 Change-Id: I9c37a5cada067a4ebfaa9f04e7a30d41b8945990 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Teach CoreText font db to handle application font files with multiple fontsTor Arne Vestbø2014-01-251-67/+59
| | | | | | | | | | | | | | | | | The ATS code path already did this, by enumerating all the fonts in the resolved collection. The CoreText code path assumed that registering a font URL would only add a single font. We now use CTFontManagerRegisterFontsForURL to enumerate all fonts that were added. This functionality is not available for fonts based on a data provider. As part of implementing the patch the code was simplified to re-use logic between the different ways of resolving font descriptors from a file or byte array. Change-Id: I6eb15df939d03dc588a87e46f39bd54e56b50643 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Use shared list of application fonts in CoreText font databaseTor Arne Vestbø2014-01-252-22/+24
| | | | | | | | Instead of three separate lists depending on the font type. This makes enables sharing more code between the different implementations. Change-Id: If090d1b4a32f035b6344cbadd4c5ba66e0cb99f7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* iOS: Disable tests for all other modules than qtbaseTor Arne Vestbø2014-01-251-0/+5
| | | | | | | | | Instead of sprinkling '!ios' all around the various modules. This is a bit more fine grained than the CFG_NOBUILD_PARTS += "tests" that we had in configure. Change-Id: I6ca2e5df118dfc0bb5d7b8495a3543f51dc0fa30 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix OS X/iOS SDK macros to be usable in combined expressionsTor Arne Vestbø2014-01-251-4/+4
| | | | | | | | The macros need parentheses around them so that you can use them as #if A && B without wrapping (A) and (B). Change-Id: I8a004eb64e8cd3f4fc0370d772565c8d84eb9f7b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Don't rely on makedepend on OS XTor Arne Vestbø2014-01-251-6/+12
| | | | | | | | | | | It's not shipped as part of the default installation, but the binary in /usr/X11R6/bin/makedepend exists and will trigger a dialog that asks you to install X11. This is not needed when we can use the compiler to resolve the dependencies for us. Change-Id: I67e35a63d0f7101b7673127228df4dcefd3c1fdc Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix MSVC 64bit warnings about int64 truncation in tests.Friedemann Kleint2014-01-243-5/+5
| | | | | Change-Id: Ic98090dbc7e320df652a60fc67a5291c60f7796a Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Fix MSVC-warnings about double to float truncation.Friedemann Kleint2014-01-243-31/+31
| | | | | Change-Id: I4aef12bd8fe37dffb06fc7d0b6a330bfc42fa270 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Fix MSVC-warnings about stray */* in sources.Friedemann Kleint2014-01-242-2/+2
| | | | | Change-Id: Ifa8de548dc8df79fa2b5d884383dc120661cb45a Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Disable terminal keyboard on eglfs and linuxfbLaszlo Agocs2014-01-2410-50/+80
| | | | | | | | | | | | | | | | | | | | | Unify the behavior for eglfs, linuxfb and kms. The relevant code is now moved from kms into fbconvenience. From now on, on all three platforms, terminal keyboard input is turned off by default. This feature can be disabled by setting QT_QPA_ENABLE_TERMINAL_KEYBOARD to 1. This is similar to what the evdev-based keyboard handler did in QWS in Qt4. [ChangeLog][QtGui] The main Embedded Linux platform plugins (eglfs, linuxfb, kms) are changed to behave identically with regards to terminal keyboard input: it is turned off by default on all of these platforms. If this feature is not desired, it can be disabled by setting the environment variable QT_QPA_ENABLE_TERMINAL_KEYBOARD. Task-number: QTBUG-36394 Change-Id: I69e47ed7580464dc5e703e9a0e23891c7c8b7790 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* eglfs: Fix physical screen size regression for some hooksLaszlo Agocs2014-01-243-4/+6
| | | | | | | | | | | | On boards that provide their own custom ways of querying the screen size the resolution of widget apps became somewhat incorrect after the recent eglfs/eglconvenience refactor. This is because the physical size query helper was not able to access the screenSize() provided by the hooks, it was instead falling back to the default fb query which in turn returned the default screen size (e.g. 800x600). Change-Id: I46d487b61341d69dd9cb76d93198b1f44b64f195 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* eglfs: Upload only damaged areas into the texturesLaszlo Agocs2014-01-241-1/+0
| | | | | | | | | Uploading the pixel data for the entire window on every update is not nice. Not sure why the line in question was added, it is most likely a leftover from some debugging session. Change-Id: I161af536c42ac24b299fc674039f2318f0fb8c4f Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* eglfs: Remove unused variable on raspiLaszlo Agocs2014-01-241-6/+0
| | | | | Change-Id: I34749533e4279d151c8954f29a4fc7635e007b19 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* eglfs: Fix quad coordinatesLaszlo Agocs2014-01-241-2/+3
| | | | | | | | | Prevent artifacts on raster windows by properly mapping the coordinates to [-1,1]. Task-number: QTBUG-36370 Change-Id: I95d0d03952f597ef4ce6a950c6533a3af2df964a Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Defer HarfBuzz face loading up until it gets usedKonstantin Ritt2014-01-241-2/+6
| | | | | | | | This didn't work for a loooong time already; not it is possible to re-introduce this optimization once again. Change-Id: I35c40e68933227bda6cbc038c2d8f6709db62451 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Windows: Reconstruct MSG-structure properly.Friedemann Kleint2014-01-241-2/+14
| | | | | | | | | | | The MSG structure is supposed to contain screen coordinates of the mouse position. Use GET_X/Y_LPARAM for mouse events and transform for client coordinates. Use GetCursorPos() for other events. Task-number: QTBUG-36337 Change-Id: I3ad4de20e1a460ee58f22645a4339a2444d129ed Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix crash of tst_qaccessibilitylinux when DBus is not available.Friedemann Kleint2014-01-241-0/+3
| | | | | Change-Id: I32291e4c6a5b228b42a7ec15f1dbfe4302bd31fa Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Windows: Remove unused function QWindowsBackingStore::rasterWindow().Friedemann Kleint2014-01-242-12/+2
| | | | | | | | | | It was only used to access the QWindow which can be retrieved using QPlatformBackingStore::window(), potentially causing a crash when QWindowsBackingStore::resize() was called before the window is shown. Change-Id: I7c1bfce0f2c371d5d8847fd15fd1dc760b769a8f Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Fix rounding issueKonstantin Ritt2014-01-241-1/+1
| | | | | | | | The correct rounding that respects ForceIntegerMetrics flag is done just a few lines below. Change-Id: I8e79ebaded90753092ecd3e99eece8df4c824362 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* WinRT: Provide qmake feature for generating a package manifestAndrew Knight2014-01-2420-1/+253
| | | | | | | | | | | | | | | | | | | | | | This feature (package_manifest) generates a basic application manifest from a template provided by the mkspec or the developer. It is meant to deliver an out-of-the-box build experience without attempting to exhaustively cover all manifest options. It is meant to be a starting point which allows the developer to customize the manifest further. It also becomes the default package manifest generator for Windows Phone, replacing autogen_wmappmanifest. Common variables, such as the target executable, are populated by qmake in the newly created manifest. Default icons are also created if needed, as the build will fail without them. The input manifest can be set by assigning a file name to WINRT_MANIFEST. Additional options are documented in the .prf file. If an existing (non-generated) manifest is already in the directory, it will not be overwritten. Task-number: QTBUG-35328 Change-Id: I57576a17ff9d2b564c0828f815949cb26d276bfd Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Fix Q_ASSERT in direct2d qpa pluginLouai Al-Khanji2014-01-241-1/+1
| | | | | | | | When calling end the refcount should be greater than zero, as calls to begin/end should match. Change-Id: I49adbf6f9f1c21cb60985ba4e02574e6c0841b74 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Silence failed xcbxsettings initializationJorgen Lind2014-01-233-3/+11
| | | | | | | | also add a boolean flag indicating if xsettings is initialized and can be used Change-Id: I9dae83b8fef224171744d2b940767cbf54ce4f55 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Work around a binary incompatibility in MSVCThiago Macieira2014-01-233-2/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix in b8fe5e1bbc7f341d03d2704a6110d6e3240589bb (for bug QTBUG-27277) created two sets of begin() and end() functions for QVector. That was required because QTypedArrayData::iterator and QTypedArrayData::const_iterator have non-implicit copy constructors, which means the variants returning a strict iterator need to pass the storage pointer as an implicit first parameter. With the fix, the compiler would emit functions with two different names for each variant, which couldn't be merged. If we remove those copy constructors, the compiler might be able to generate the same code (no implicit first parameter) for both functions. Now, enter MSVC. Due to QPolygon, QVector<QPoint> and QVector<QPointF> are "extern templates". That is, the compiler is not allowed to inline anything, it must generate calls into QtCore (which we must fix for Qt 6, if we can). That means QtCore would only have one set of begin() / end() functions. If an application tried to use the other set by defining QT_STRICT_ITERATORS, you'd get a linker error for: ?begin@?$QVector@VQPoint@@@@QEAA?AViterator@?$QTypedArrayData@VQPoint@@@@V23@@Z (class QTypedArrayData<class QPoint>::iterator QGenericArray<class QPoint>::begin(class QTypedArrayData<class QPoint>::iterator)) Change-Id: I5c10a7d0a4855f4ba84056d313c6a800ecdcfe37 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>