Require Qt 5.7 and remove pre-5.7 code

Summary:
Increases minimum Qt version to 5.7. This allows to drop the pre-5.7
virtual keyboard and various ifdefs for now unsupported versions.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D4485
This commit is contained in:
Martin Gräßlin 2017-02-07 20:31:22 +01:00
parent 0fcbf4bafb
commit 16647c3a3c
12 changed files with 3 additions and 78 deletions

View file

@ -3,7 +3,7 @@ set(PROJECT_VERSION "5.9.90")
set(PROJECT_VERSION_MAJOR 5) set(PROJECT_VERSION_MAJOR 5)
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
set(QT_MIN_VERSION "5.5.0") set(QT_MIN_VERSION "5.7.0")
set(KF5_MIN_VERSION "5.26.0") set(KF5_MIN_VERSION "5.26.0")
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH} ) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH} )

View file

@ -177,10 +177,6 @@ int main(int argc, char *argv[]) \
return QTest::qExec(&tc, argc, argv); \ return QTest::qExec(&tc, argc, argv); \
} }
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
#define WAYLANDTEST_MAIN(TestObject) WAYLANDTEST_MAIN_HELPER(TestObject, QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling) ) #define WAYLANDTEST_MAIN(TestObject) WAYLANDTEST_MAIN_HELPER(TestObject, QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling) )
#else
#define WAYLANDTEST_MAIN(TestObject) WAYLANDTEST_MAIN_HELPER(TestObject,)
#endif
#endif #endif

View file

@ -297,13 +297,6 @@ void TestScreenEdges::testCreatingInitialEdges()
// approach windows for edges not created as screen too small // approach windows for edges not created as screen too small
s->updateLayout(); s->updateLayout();
auto edgeWindows = s->windows(); auto edgeWindows = s->windows();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
#if (QT_VERSION < QT_VERSION_CHECK(5, 6, 1))
if (!Xcb::Extensions::self()->isRandrAvailable()) {
QEXPECT_FAIL("", "Broken on no xrandr systems in Qt 5.5", Abort);
}
#endif
#endif
QCOMPARE(edgeWindows.size(), 12); QCOMPARE(edgeWindows.size(), 12);
auto testWindowGeometry = [&](int index) { auto testWindowGeometry = [&](int index) {
@ -422,13 +415,6 @@ void TestScreenEdges::testCallback()
auto it = std::find_if(edges.constBegin(), edges.constEnd(), [](Edge *e) { auto it = std::find_if(edges.constBegin(), edges.constEnd(), [](Edge *e) {
return e->isScreenEdge() && e->isLeft() && e->approachGeometry().bottom() < 768; return e->isScreenEdge() && e->isLeft() && e->approachGeometry().bottom() < 768;
}); });
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
#if (QT_VERSION < QT_VERSION_CHECK(5, 6, 1))
if (!Xcb::Extensions::self()->isRandrAvailable()) {
QEXPECT_FAIL("", "Broken on no xrandr systems in Qt 5.5", Abort);
}
#endif
#endif
QVERIFY(it != edges.constEnd()); QVERIFY(it != edges.constEnd());
xcb_enter_notify_event_t event; xcb_enter_notify_event_t event;

View file

@ -68,9 +68,7 @@ static void xkbLogHandler(xkb_context *context, xkb_log_level priority, const ch
qCDebug(KWIN_XKB) << "XKB:" << buf; qCDebug(KWIN_XKB) << "XKB:" << buf;
break; break;
case XKB_LOG_LEVEL_INFO: case XKB_LOG_LEVEL_INFO:
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
qCInfo(KWIN_XKB) << "XKB:" << buf; qCInfo(KWIN_XKB) << "XKB:" << buf;
#endif
break; break;
case XKB_LOG_LEVEL_WARNING: case XKB_LOG_LEVEL_WARNING:
qCWarning(KWIN_XKB) << "XKB:" << buf; qCWarning(KWIN_XKB) << "XKB:" << buf;

View file

@ -44,9 +44,7 @@ static void libinputLogHandler(libinput *libinput, libinput_log_priority priorit
qCDebug(KWIN_LIBINPUT) << "Libinput:" << buf; qCDebug(KWIN_LIBINPUT) << "Libinput:" << buf;
break; break;
case LIBINPUT_LOG_PRIORITY_INFO: case LIBINPUT_LOG_PRIORITY_INFO:
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
qCInfo(KWIN_LIBINPUT) << "Libinput:" << buf; qCInfo(KWIN_LIBINPUT) << "Libinput:" << buf;
#endif
break; break;
case LIBINPUT_LOG_PRIORITY_ERROR: case LIBINPUT_LOG_PRIORITY_ERROR:
default: default:

View file

@ -468,9 +468,7 @@ int main(int argc, char * argv[])
qunsetenv("QT_DEVICE_PIXEL_RATIO"); qunsetenv("QT_DEVICE_PIXEL_RATIO");
qputenv("QT_IM_MODULE", "qtvirtualkeyboard"); qputenv("QT_IM_MODULE", "qtvirtualkeyboard");
qputenv("QSG_RENDER_LOOP", "basic"); qputenv("QSG_RENDER_LOOP", "basic");
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
#endif
KWin::ApplicationWayland a(argc, argv); KWin::ApplicationWayland a(argc, argv);
a.setupTranslator(); a.setupTranslator();
// reset QT_QPA_PLATFORM to a sane value for any processes started from KWin // reset QT_QPA_PLATFORM to a sane value for any processes started from KWin

View file

@ -406,9 +406,7 @@ KWIN_EXPORT int kdemain(int argc, char * argv[])
setenv("QT_QPA_PLATFORM", "xcb", true); setenv("QT_QPA_PLATFORM", "xcb", true);
qunsetenv("QT_DEVICE_PIXEL_RATIO"); qunsetenv("QT_DEVICE_PIXEL_RATIO");
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
#endif
KWin::ApplicationX11 a(argc, argv); KWin::ApplicationX11 a(argc, argv);
a.setupTranslator(); a.setupTranslator();

View file

@ -119,17 +119,10 @@ QSurfaceFormat AbstractPlatformContext::format() const
return m_format; return m_format;
} }
#if (QT_VERSION < QT_VERSION_CHECK(5, 7, 0))
QFunctionPointer AbstractPlatformContext::getProcAddress(const QByteArray &procName)
{
return eglGetProcAddress(procName.constData());
}
#else
QFunctionPointer AbstractPlatformContext::getProcAddress(const char *procName) QFunctionPointer AbstractPlatformContext::getProcAddress(const char *procName)
{ {
return eglGetProcAddress(procName); return eglGetProcAddress(procName);
} }
#endif
bool AbstractPlatformContext::isValid() const bool AbstractPlatformContext::isValid() const
{ {

View file

@ -39,11 +39,7 @@ public:
void doneCurrent() override; void doneCurrent() override;
QSurfaceFormat format() const override; QSurfaceFormat format() const override;
bool isValid() const override; bool isValid() const override;
#if (QT_VERSION < QT_VERSION_CHECK(5, 7, 0))
QFunctionPointer getProcAddress(const QByteArray &procName) override;
#else
QFunctionPointer getProcAddress(const char *procName) override; QFunctionPointer getProcAddress(const char *procName) override;
#endif
protected: protected:
EGLDisplay eglDisplay() const { EGLDisplay eglDisplay() const {

View file

@ -227,9 +227,7 @@ void Integration::initializeWayland()
void Integration::createWaylandOutput(quint32 name, quint32 version) void Integration::createWaylandOutput(quint32 name, quint32 version)
{ {
if (m_dummyScreen) { if (m_dummyScreen) {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
destroyScreen(m_dummyScreen); destroyScreen(m_dummyScreen);
#endif
m_dummyScreen = nullptr; m_dummyScreen = nullptr;
} }
using namespace KWayland::Client; using namespace KWayland::Client;

View file

@ -1,32 +0,0 @@
/********************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
Copyright (C) 2016 Martin Gräßlin <mgraesslin@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
import QtQuick 2.0
import QtQuick.Enterprise.VirtualKeyboard 2.0
Item {
id: window
InputPanel {
id: inputPanel
objectName: "inputPanel"
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
}
}

View file

@ -72,12 +72,8 @@ void VirtualKeyboard::init()
m_inputWindow->setResizeMode(QQuickView::SizeRootObjectToView); m_inputWindow->setResizeMode(QQuickView::SizeRootObjectToView);
m_inputWindow->setSource(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral(KWIN_NAME "/virtualkeyboard/main.qml")))); m_inputWindow->setSource(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral(KWIN_NAME "/virtualkeyboard/main.qml"))));
if (m_inputWindow->status() != QQuickView::Status::Ready) { if (m_inputWindow->status() != QQuickView::Status::Ready) {
// try enterprise m_inputWindow.reset();
m_inputWindow->setSource(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral(KWIN_NAME "/virtualkeyboard/main-enterprise.qml")))); return;
if (m_inputWindow->status() != QQuickView::Status::Ready) {
m_inputWindow.reset();
return;
}
} }
m_inputWindow->setProperty("__kwin_input_method", true); m_inputWindow->setProperty("__kwin_input_method", true);