From 276a64e0f4f2864b953ea48ee5f96ddafc127c62 Mon Sep 17 00:00:00 2001 From: Kari Oikarinen Date: Mon, 30 Sep 2019 12:34:33 +0300 Subject: [PATCH 1/3] Remove unused member variable Change-Id: I767ece2b090f95947fce34e743eec37299e62749 Reviewed-by: Johan Helsing --- tests/auto/wayland/inputcontext/tst_inputcontext.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/auto/wayland/inputcontext/tst_inputcontext.cpp b/tests/auto/wayland/inputcontext/tst_inputcontext.cpp index b1a5a7f17f8..7c0132e35a1 100644 --- a/tests/auto/wayland/inputcontext/tst_inputcontext.cpp +++ b/tests/auto/wayland/inputcontext/tst_inputcontext.cpp @@ -58,8 +58,6 @@ private: QByteArray mComposeModule = QByteArray("QComposeInputContext"); // default input context QByteArray mIbusModule = QByteArray("QIBusPlatformInputContext"); QByteArray mWaylandModule = QByteArray("QtWaylandClient::QWaylandInputContext"); - - TextInputManager *mTextInputManager = nullptr; }; void tst_inputcontext::initTestCase() From 7ddc7a34a404dc4d68a10b2caa64666ca2276843 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 24 Sep 2019 13:31:50 +0200 Subject: [PATCH 2/3] Make qtwaylandscanner accept named arguments and add --add-include Task-number: QTBUG-78177 Change-Id: I275cd815e0fe737af94fc46580ec9756eba54451 Reviewed-by: Johan Helsing Reviewed-by: Simon Hausmann --- .../qtwaylandscanner/qtwaylandscanner.cpp | 57 ++++++++++++++----- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/src/tools/qtwaylandscanner/qtwaylandscanner.cpp b/src/tools/qtwaylandscanner/qtwaylandscanner.cpp index 9691b857f27..24977a2f234 100644 --- a/src/tools/qtwaylandscanner/qtwaylandscanner.cpp +++ b/src/tools/qtwaylandscanner/qtwaylandscanner.cpp @@ -92,7 +92,7 @@ private: }; bool isServerSide(); - bool parseOption(const char *str); + bool parseOption(const QByteArray &str); QByteArray byteArrayValue(const QXmlStreamReader &xml, const char *name); int intValue(const QXmlStreamReader &xml, const char *name, int defaultValue = 0); @@ -123,29 +123,55 @@ private: QByteArray m_scannerName; QByteArray m_headerPath; QByteArray m_prefix; + QVector m_includes; QXmlStreamReader *m_xml = nullptr; }; bool Scanner::parseArguments(int argc, char **argv) { - m_scannerName = argv[0]; + QVector args; + args.reserve(argc); + for (int i = 0; i < argc; ++i) + args << QByteArray(argv[i]); - if (argc <= 2 || !parseOption(argv[1])) + m_scannerName = args[0]; + + if (argc <= 2 || !parseOption(args[1])) return false; - m_protocolFilePath = QByteArray(argv[2]); + m_protocolFilePath = args[2]; - if (argc >= 4) - m_headerPath = QByteArray(argv[3]); - if (argc == 5) - m_prefix = QByteArray(argv[4]); + if (argc > 3 && !args[3].startsWith('-')) { + // legacy positional arguments + m_headerPath = args[3]; + if (argc == 5) + m_prefix = args[4]; + } else { + // --header-path= (14 characters) + // --prefix= (9 characters) + // --add-include= (14 characters) + for (int pos = 3; pos < argc; pos++) { + const QByteArray &option = args[pos]; + if (option.startsWith("--header-path=")) { + m_headerPath = option.mid(14); + } else if (option.startsWith("--prefix=")) { + m_prefix = option.mid(10); + } else if (option.startsWith("--add-include=")) { + auto include = option.mid(14); + if (!include.isEmpty()) + m_includes << include; + } else { + return false; + } + } + } return true; } void Scanner::printUsage() { - fprintf(stderr, "Usage: %s [client-header|server-header|client-code|server-code] specfile [header-path] [prefix]\n", m_scannerName.constData()); + fprintf(stderr, "Usage: %s [client-header|server-header|client-code|server-code] specfile [--header-path=] [--prefix=] [--add-include=]\n", m_scannerName.constData()); } bool Scanner::isServerSide() @@ -153,15 +179,15 @@ bool Scanner::isServerSide() return m_option == ServerHeader || m_option == ServerCode; } -bool Scanner::parseOption(const char *str) +bool Scanner::parseOption(const QByteArray &str) { - if (str == QLatin1String("client-header")) + if (str == "client-header") m_option = ClientHeader; - else if (str == QLatin1String("server-header")) + else if (str == "server-header") m_option = ServerHeader; - else if (str == QLatin1String("client-code")) + else if (str == "client-code") m_option = ClientCode; - else if (str == QLatin1String("server-code")) + else if (str == "server-code") m_option = ServerCode; else return false; @@ -441,6 +467,9 @@ bool Scanner::process() if (m_xml->hasError()) return false; + for (auto b : qAsConst(m_includes)) + printf("#include %s\n", b.constData()); + if (m_option == ServerHeader) { QByteArray inclusionGuard = QByteArray("QT_WAYLAND_SERVER_") + preProcessorProtocolName.constData(); printf("#ifndef %s\n", inclusionGuard.constData()); From 5d83deaad2446b10aabc7cccc82f3181e2109651 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 7 Oct 2019 13:45:28 +0200 Subject: [PATCH 3/3] Add missing config tests for wayland, glx, xcomposite The intention of 9b228df was to inline all the tests and delete the rest. Unfortunately, some tests were deleted without being inlined, which led to the tests failing, which in turn led to nothing being built. This was not detected by coin, as configure currently passes although nothing is built. Fixes: QTBUG-79057 Change-Id: Ib09538ebf4b2d369d0fc1087f4b8fbea93d8c5b3 Reviewed-by: Joerg Bornemann --- src/plugins/platforms/wayland/configure.json | 44 +++++++++++++++++--- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/wayland/configure.json b/src/plugins/platforms/wayland/configure.json index a25b61f5517..f49beaf703c 100644 --- a/src/plugins/platforms/wayland/configure.json +++ b/src/plugins/platforms/wayland/configure.json @@ -9,7 +9,24 @@ "libraries": { "wayland-client": { "label": "Wayland client library", - "test": "wayland", + "headers": "wayland-version.h", + "test": { + "main": [ + "#if WAYLAND_VERSION_MAJOR < 1", + "# error Wayland 1.8.0 or higher required", + "#endif", + "#if WAYLAND_VERSION_MAJOR == 1", + "# if WAYLAND_VERSION_MINOR < 8", + "# error Wayland 1.8.0 or higher required", + "# endif", + "# if WAYLAND_VERSION_MINOR == 8", + "# if WAYLAND_VERSION_MICRO < 0", + "# error Wayland 1.8.0 or higher required", + "# endif", + "# endif", + "#endif" + ] + }, "sources": [ { "type": "pkgConfig", "args": "wayland-client" }, "-lwayland-client" @@ -17,7 +34,10 @@ }, "wayland-cursor": { "label": "Wayland cursor library", - "test": "wayland_cursor", + "headers": "wayland-cursor.h", + "test": { + "main": "struct wl_cursor_image *image = 0;" + }, "use": "wayland-client", "sources": [ { "type": "pkgConfig", "args": "wayland-cursor" }, @@ -26,7 +46,10 @@ }, "wayland-egl": { "label": "Wayland EGL library", - "test": "wayland_egl", + "headers": "wayland-egl.h", + "test": { + "main": "struct wl_egl_window *window = wl_egl_window_create(0, 100, 100);" + }, "sources": [ { "type": "pkgConfig", "args": "wayland-egl" }, "-lwayland-egl", @@ -35,7 +58,11 @@ }, "xcomposite": { "label": "XComposite", - "test": "xcomposite", + "headers": "X11/extensions/Xcomposite.h", + "test": { + "main": "XCompositeRedirectWindow((Display *)0,(Window) 0, CompositeRedirectManual);" + + }, "sources": [ { "type": "pkgConfig", "args": "xcomposite" }, "-lxcomposite" @@ -43,7 +70,14 @@ }, "glx": { "label": "GLX", - "test": "glx", + "headers": "GL/glx.h", + "test": { + "main": [ + "Display *dpy = XOpenDisplay(0);", + "int items = 0;", + "GLXFBConfig *fbc = glXChooseFBConfig(dpy, DefaultScreen(dpy), 0 , &items);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "x11 gl" }, "-lX11 -lGl"