diff options
author | Liang Qi <liang.qi@qt.io> | 2016-06-06 08:34:03 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-06-06 09:04:55 +0200 |
commit | 57057f76add416d0faf2e09a90c126baafb6198e (patch) | |
tree | 07d54f8e5daeb3ed1161723542e94c324d745166 /src/platformsupport | |
parent | dc0ae02ebc8e221f952829230c0301a718a6f10b (diff) | |
parent | fd70978693bd92761e9989bc1c76bf83c1e8c987 (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
.qmake.conf
config.tests/unix/nis/nis.cpp
mkspecs/unsupported/freebsd-g++/qplatformdefs.h
src/corelib/tools/qdatetime.cpp
src/corelib/tools/qsimd.cpp
src/corelib/tools/qsimd_p.h
src/network/access/access.pri
src/network/access/qnetworkreplynsurlconnectionimpl.mm
src/network/access/qnetworkreplynsurlconnectionimpl_p.h
src/plugins/platforms/cocoa/qnsview.mm
src/plugins/printsupport/windows/qwindowsprintdevice.cpp
tests/auto/corelib/kernel/qobject/tst_qobject.cpp
tests/auto/network/access/qnetworkreply/BLACKLIST
tests/auto/widgets/widgets/qopenglwidget/BLACKLIST
Change-Id: I4b32055bbf922392ef0264fd403405416fffee57
Diffstat (limited to 'src/platformsupport')
6 files changed, 42 insertions, 21 deletions
diff --git a/src/platformsupport/devicediscovery/devicediscovery.pri b/src/platformsupport/devicediscovery/devicediscovery.pri index 1ac25da901..9829ae88ba 100644 --- a/src/platformsupport/devicediscovery/devicediscovery.pri +++ b/src/platformsupport/devicediscovery/devicediscovery.pri @@ -1,18 +1,14 @@ HEADERS += $$PWD/qdevicediscovery_p.h -linux { - contains(QT_CONFIG, libudev) { - SOURCES += $$PWD/qdevicediscovery_udev.cpp - HEADERS += $$PWD/qdevicediscovery_udev_p.h - INCLUDEPATH += $$QMAKE_INCDIR_LIBUDEV - LIBS_PRIVATE += $$QMAKE_LIBS_LIBUDEV - } else: contains(QT_CONFIG, evdev) { - SOURCES += $$PWD/qdevicediscovery_static.cpp - HEADERS += $$PWD/qdevicediscovery_static_p.h - } else { - SOURCES += $$PWD/qdevicediscovery_dummy.cpp - HEADERS += $$PWD/qdevicediscovery_dummy_p.h - } +contains(QT_CONFIG, libudev) { + SOURCES += $$PWD/qdevicediscovery_udev.cpp + HEADERS += $$PWD/qdevicediscovery_udev_p.h + INCLUDEPATH += $$QMAKE_INCDIR_LIBUDEV + LIBS_PRIVATE += $$QMAKE_LIBS_LIBUDEV +} else: contains(QT_CONFIG, evdev) { + SOURCES += $$PWD/qdevicediscovery_static.cpp + HEADERS += $$PWD/qdevicediscovery_static_p.h } else { SOURCES += $$PWD/qdevicediscovery_dummy.cpp + HEADERS += $$PWD/qdevicediscovery_dummy_p.h } diff --git a/src/platformsupport/eglconvenience/qeglconvenience.cpp b/src/platformsupport/eglconvenience/qeglconvenience.cpp index f8efd105bc..da41cfeabf 100644 --- a/src/platformsupport/eglconvenience/qeglconvenience.cpp +++ b/src/platformsupport/eglconvenience/qeglconvenience.cpp @@ -587,6 +587,10 @@ int q_screenDepthFromFb(int framebufferDevice) qreal q_refreshRateFromFb(int framebufferDevice) { +#ifndef Q_OS_LINUX + Q_UNUSED(framebufferDevice) +#endif + static qreal rate = 0; #ifdef Q_OS_LINUX diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp index 36de1e0c69..c7f6dd2740 100644 --- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp +++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp @@ -60,7 +60,7 @@ Q_LOGGING_CATEGORY(qLcEvdevKeyMap, "qt.qpa.input.keymap") #include "qevdevkeyboard_defaultmap_p.h" QEvdevKeyboardHandler::QEvdevKeyboardHandler(const QString &device, int fd, bool disableZap, bool enableCompose, const QString &keymapFile) - : m_device(device), m_fd(fd), + : m_device(device), m_fd(fd), m_notify(Q_NULLPTR), m_modifiers(0), m_composing(0), m_dead_unicode(0xffff), m_no_zap(disableZap), m_do_compose(enableCompose), m_keymap(0), m_keymap_size(0), m_keycompose(0), m_keycompose_size(0) @@ -75,9 +75,8 @@ QEvdevKeyboardHandler::QEvdevKeyboardHandler(const QString &device, int fd, bool unloadKeymap(); // socket notifier for events on the keyboard device - QSocketNotifier *notifier; - notifier = new QSocketNotifier(m_fd, QSocketNotifier::Read, this); - connect(notifier, SIGNAL(activated(int)), this, SLOT(readKeycode())); + m_notify = new QSocketNotifier(m_fd, QSocketNotifier::Read, this); + connect(m_notify, SIGNAL(activated(int)), this, SLOT(readKeycode())); } QEvdevKeyboardHandler::~QEvdevKeyboardHandler() @@ -162,6 +161,14 @@ void QEvdevKeyboardHandler::readKeycode() } else if (result < 0) { if (errno != EINTR && errno != EAGAIN) { qErrnoWarning(errno, "evdevkeyboard: Could not read from input device"); + // If the device got disconnected, stop reading, otherwise we get flooded + // by the above error over and over again. + if (errno == ENODEV) { + delete m_notify; + m_notify = Q_NULLPTR; + qt_safe_close(m_fd); + m_fd = -1; + } return; } } else { diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h index 89fa879115..b94323fcbb 100644 --- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h +++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h @@ -57,6 +57,8 @@ QT_BEGIN_NAMESPACE +class QSocketNotifier; + namespace QEvdevKeyboardMap { const quint32 FileMagic = 0x514d4150; // 'QMAP' @@ -186,6 +188,7 @@ private: QString m_device; int m_fd; + QSocketNotifier *m_notify; // keymap handling quint8 m_modifiers; diff --git a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp index 382b9b1514..d5ea04bee8 100644 --- a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp +++ b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp @@ -111,9 +111,8 @@ QEvdevMouseHandler::QEvdevMouseHandler(const QString &device, int fd, bool abs, m_abs = getHardwareMaximum(); // socket notifier for events on the mouse device - QSocketNotifier *notifier; - notifier = new QSocketNotifier(m_fd, QSocketNotifier::Read, this); - connect(notifier, SIGNAL(activated(int)), this, SLOT(readMouseData())); + m_notify = new QSocketNotifier(m_fd, QSocketNotifier::Read, this); + connect(m_notify, SIGNAL(activated(int)), this, SLOT(readMouseData())); } QEvdevMouseHandler::~QEvdevMouseHandler() @@ -202,6 +201,14 @@ void QEvdevMouseHandler::readMouseData() } else if (result < 0) { if (errno != EINTR && errno != EAGAIN) { qErrnoWarning(errno, "evdevmouse: Could not read from input device"); + // If the device got disconnected, stop reading, otherwise we get flooded + // by the above error over and over again. + if (errno == ENODEV) { + delete m_notify; + m_notify = Q_NULLPTR; + qt_safe_close(m_fd); + m_fd = -1; + } return; } } else { diff --git a/src/platformsupport/platformsupport.pro b/src/platformsupport/platformsupport.pro index 81c7faa389..60be964b74 100644 --- a/src/platformsupport/platformsupport.pro +++ b/src/platformsupport/platformsupport.pro @@ -21,7 +21,11 @@ include(accessibility/accessibility.pri) include(linuxaccessibility/linuxaccessibility.pri) include(clipboard/clipboard.pri) include(platformcompositor/platformcompositor.pri) -contains(QT_CONFIG, dbus) { + +# dbus convenience, but not for darwin: the platform +# plugins for these platforms do not use dbus and we +# don't want to create a false dependency. +!darwin: contains(QT_CONFIG, dbus) { include(dbusmenu/dbusmenu.pri) include(dbustray/dbustray.pri) } |