From 427e5d61b7b33c8a4cb8da14c1e465244e53cd88 Mon Sep 17 00:00:00 2001 From: Robert Griebl Date: Thu, 17 May 2018 12:58:53 +0200 Subject: Add support for building QtWayland on macOS Change-Id: Ibed63a01abf32e10a31c610996ae93d3bd9ce153 Reviewed-by: Oswald Buddenhagen Reviewed-by: Paul Olav Tvete --- src/platformsupport/platformsupport.pro | 2 +- src/platformsupport/themes/themes.pro | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/platformsupport') diff --git a/src/platformsupport/platformsupport.pro b/src/platformsupport/platformsupport.pro index 7dbb6f6cae..6d4f1b93bd 100644 --- a/src/platformsupport/platformsupport.pro +++ b/src/platformsupport/platformsupport.pro @@ -16,7 +16,7 @@ qtConfig(evdev)|qtConfig(tslib)|qtConfig(libinput)|qtConfig(integrityhid) { input.depends += devicediscovery } -if(unix:!darwin)|qtConfig(xcb): \ +if(unix:!uikit)|qtConfig(xcb): \ SUBDIRS += services qtConfig(opengl): \ diff --git a/src/platformsupport/themes/themes.pro b/src/platformsupport/themes/themes.pro index 44f94fafc8..668a843473 100644 --- a/src/platformsupport/themes/themes.pro +++ b/src/platformsupport/themes/themes.pro @@ -6,7 +6,7 @@ CONFIG += static internal_module DEFINES += QT_NO_CAST_FROM_ASCII -if(unix:!darwin)|qtConfig(xcb): \ +if(unix:!uikit)|qtConfig(xcb): \ include($$PWD/genericunix/genericunix.pri) HEADERS += \ -- cgit v1.2.3 From d0acd26c37c7b98612308e47e635b792949d7210 Mon Sep 17 00:00:00 2001 From: Romain Pokrzywka Date: Mon, 18 Jun 2018 19:01:05 +0200 Subject: Fix evdevtouch input plugin crash when the device can't be opened If a device fails to open during the plugin startup, we exit the handler constructor early and leave the d member as nullptr. However the recently added m_handler->isFiltered() call after m_handler is instantiated assumes that d is always valid, which triggers a crash in the forementionned situation. Fix it to check for d's validity first. This can occur when a device is connected then disconnected right after, so that it's gone by the time we get the notification from udev. Change-Id: Ia755868338f92b91c181be8557e06e087d70fcc6 Reviewed-by: Laszlo Agocs --- src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/platformsupport') diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp index 7b7649bc5c..f3cc160b3e 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp @@ -368,7 +368,7 @@ QEvdevTouchScreenHandler::~QEvdevTouchScreenHandler() bool QEvdevTouchScreenHandler::isFiltered() const { - return d->m_filtered; + return d && d->m_filtered; } QTouchDevice *QEvdevTouchScreenHandler::touchDevice() const -- cgit v1.2.3 From 3f01dc199560e7d31f8941dc81e99a17d2e95cdf Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 21 Jun 2018 12:35:29 +0200 Subject: QWindowsFontDatabase/QWindowsXPStyle: Fix compilation with g++ 8.1/MinGW Silence warnings about copying/clearing memory types which g++ considers non-trivial, for example: windows\qwindowsfontdatabase.cpp:1003:75: error: 'void* memcpy(void*, const void*, size_t)' copying an object of non-trivial type 'class QChar' from an array of 'const ushort' {aka 'const short unsigned int'} [-Werror=class-memaccess] memcpy(faceNamePtr, faceName.utf16(), sizeof(wchar_t) * nameLength); qwindowsxpstyle.cpp:946:46: error: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct ThemeMapData'; use assignment or value-initialization instead [-Werror=class-memaccess] memset(&data, 0, sizeof(data)); ^ qwindowsxpstyle.cpp:1053:38: error: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct ThemeMapData'; use assignment or value-initialization instead [-Werror=class-memaccess] memset(&data, 0, sizeof(data)); by introducing a cast. Task-number: QTBUG-68742 Task-number: QTQAINFRA-2095 Change-Id: I160eb5fc7b64a2bc404e1fa61d306af2662d1252 Reviewed-by: Joerg Bornemann --- src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/platformsupport') diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp index aab1ab9889..8df8da1a38 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp @@ -1000,7 +1000,7 @@ static QChar *createFontFile(const QString &faceName) if (!faceName.isEmpty()) { const int nameLength = qMin(faceName.length(), LF_FACESIZE - 1); faceNamePtr = new QChar[nameLength + 1]; - memcpy(faceNamePtr, faceName.utf16(), sizeof(wchar_t) * nameLength); + memcpy(static_cast(faceNamePtr), faceName.utf16(), sizeof(wchar_t) * nameLength); faceNamePtr[nameLength] = 0; } return faceNamePtr; -- cgit v1.2.3 From d640dbf730b392640d5497a789e95fa7d88f99fb Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Wed, 11 Apr 2018 16:53:56 +0300 Subject: QDBusTrayIcon: Avoid needless initialization of a global var TempFileTemplate is initialized each time an application starts. It leads to the call of QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation) which is slow and can even change permissions of the runtime directory. Use a static wrapper function to initialize this variable only when needed. Change-Id: Ib620f9b842c88103c67f8dfab200f4d39c9981ee Reviewed-by: Dmitry Shachnev Reviewed-by: Shawn Rutledge --- .../themes/genericunix/dbustray/qdbustrayicon.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/platformsupport') diff --git a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp index 2153924ec8..e81d272d4f 100644 --- a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp +++ b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp @@ -90,12 +90,17 @@ static QString iconTempPath() static const QString KDEItemFormat = QStringLiteral("org.kde.StatusNotifierItem-%1-%2"); static const QString KDEWatcherService = QStringLiteral("org.kde.StatusNotifierWatcher"); -static const QString TempFileTemplate = iconTempPath() + QLatin1String("/qt-trayicon-XXXXXX.png"); static const QString XdgNotificationService = QStringLiteral("org.freedesktop.Notifications"); static const QString XdgNotificationPath = QStringLiteral("/org/freedesktop/Notifications"); static const QString DefaultAction = QStringLiteral("default"); static int instanceCount = 0; +static inline QString tempFileTemplate() +{ + static const QString TempFileTemplate = iconTempPath() + QLatin1String("/qt-trayicon-XXXXXX.png"); + return TempFileTemplate; +} + /*! \class QDBusTrayIcon \internal @@ -206,7 +211,7 @@ QTemporaryFile *QDBusTrayIcon::tempIcon(const QIcon &icon) if (!necessary) return nullptr; qreal dpr = qGuiApp->devicePixelRatio(); - QTemporaryFile *ret = new QTemporaryFile(TempFileTemplate, this); + QTemporaryFile *ret = new QTemporaryFile(tempFileTemplate(), this); ret->open(); icon.pixmap(QSize(22 * dpr, 22 * dpr)).save(ret); ret->close(); -- cgit v1.2.3 From 9e15a93b89a46605e224666bffc62b342d4dc73b Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Tue, 19 Jun 2018 15:34:14 +0200 Subject: Fix mouse-wheel handling for evdev devices with extended values Newer mouse devices support a so-called "free-scroll" mode, which unlocks the wheel and allows for faster scrolling. For such input devices, evdev will report an event value greater than 1, when free scrolling is active. Examples for such devices would be the Logitech G700 or MX Master series. However QEvdevMouseHandler interpreted such an event's data incorrectly and triggered wheel events for the opposite scrolling direction. This also often resulted in jittery & jumpy scrolling, when the events' values alternated between 1 and 2. Change-Id: Ibb23ed4419d647fff9b90d371d5bb4037cf2bd9b Reviewed-by: Allan Sandfeld Jensen --- .../input/evdevmouse/qevdevmousehandler.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/platformsupport') diff --git a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp index 04372ae4d9..86a4cd0076 100644 --- a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp +++ b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp @@ -245,18 +245,12 @@ void QEvdevMouseHandler::readMouseData() m_y += data->value; posChanged = true; } else if (data->code == ABS_WHEEL) { // vertical scroll - // data->value: 1 == up, -1 == down - if (data->value == 1) - delta.setY(120); - else - delta.setY(-120); + // data->value: positive == up, negative == down + delta.setY(120 * data->value); emit handleWheelEvent(delta); } else if (data->code == ABS_THROTTLE) { // horizontal scroll - // data->value: 1 == right, -1 == left - if (data->value == 1) - delta.setX(-120); - else - delta.setX(120); + // data->value: positive == right, negative == left + delta.setX(-120 * data->value); emit handleWheelEvent(delta); } } else if (data->type == EV_KEY && data->code == BTN_TOUCH) { -- cgit v1.2.3