From 1399cacb6be044550bbd330b5ec77c1c1609b3ff Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Thu, 16 Feb 2017 14:58:13 +0100 Subject: Fix build with -no-feature-cursor Change-Id: I971dbe7827adf0cf06337348a0d011632c364725 Reviewed-by: Lars Knoll --- src/plugins/platforms/vnc/qvnc.cpp | 8 ++------ src/plugins/platforms/vnc/qvnc_p.h | 3 ++- src/plugins/platforms/vnc/qvncclient.cpp | 4 ++-- src/plugins/platforms/vnc/qvncscreen.cpp | 11 +++++++++++ src/plugins/platforms/vnc/qvncscreen.h | 2 ++ 5 files changed, 19 insertions(+), 9 deletions(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/vnc/qvnc.cpp b/src/plugins/platforms/vnc/qvnc.cpp index a45bb1c19c..fa65e8c9a4 100644 --- a/src/plugins/platforms/vnc/qvnc.cpp +++ b/src/plugins/platforms/vnc/qvnc.cpp @@ -531,13 +531,12 @@ void QRfbRawEncoder::write() socket->flush(); } +#if QT_CONFIG(cursor) QVncClientCursor::QVncClientCursor() { -#ifndef QT_NO_CURSOR QWindow *w = QGuiApplication::focusWindow(); QCursor c = w ? w->cursor() : QCursor(Qt::ArrowCursor); changeCursor(&c, 0); -#endif } QVncClientCursor::~QVncClientCursor() @@ -587,7 +586,6 @@ void QVncClientCursor::write(QVncClient *client) const void QVncClientCursor::changeCursor(QCursor *widgetCursor, QWindow *window) { Q_UNUSED(window); -#ifndef QT_NO_CURSOR const Qt::CursorShape shape = widgetCursor ? widgetCursor->shape() : Qt::ArrowCursor; if (shape == Qt::BitmapCursor) { @@ -601,9 +599,6 @@ void QVncClientCursor::changeCursor(QCursor *widgetCursor, QWindow *window) cursor = *platformImage.image(); hotspot = platformImage.hotspot(); } -#else // !QT_NO_CURSOR - Q_UNUSED(widgetCursor); -#endif for (auto client : clients) client->setDirtyCursor(); } @@ -619,6 +614,7 @@ uint QVncClientCursor::removeClient(QVncClient *client) clients.removeOne(client); return clients.count(); } +#endif // QT_CONFIG(cursor) QVncServer::QVncServer(QVncScreen *screen, quint16 port) : qvnc_screen(screen) diff --git a/src/plugins/platforms/vnc/qvnc_p.h b/src/plugins/platforms/vnc/qvnc_p.h index e58b6ae056..338fae9f87 100644 --- a/src/plugins/platforms/vnc/qvnc_p.h +++ b/src/plugins/platforms/vnc/qvnc_p.h @@ -364,6 +364,7 @@ private: friend class QRfbMultiColorHextile; }; +#if QT_CONFIG(cursor) class QVncClientCursor : public QPlatformCursor { public: @@ -381,7 +382,7 @@ public: QPoint hotspot; QVector clients; }; - +#endif // QT_CONFIG(cursor) class QVncServer : public QObject { diff --git a/src/plugins/platforms/vnc/qvncclient.cpp b/src/plugins/platforms/vnc/qvncclient.cpp index 58dcfc9b51..9dfe873927 100644 --- a/src/plugins/platforms/vnc/qvncclient.cpp +++ b/src/plugins/platforms/vnc/qvncclient.cpp @@ -425,14 +425,14 @@ void QVncClient::checkUpdate() { if (!m_wantUpdate) return; - +#if QT_CONFIG(cursor) if (m_dirtyCursor) { m_server->screen()->clientCursor->write(this); m_dirtyCursor = false; m_wantUpdate = false; return; } - +#endif if (!m_dirtyRegion.isEmpty()) { if (m_encoder) m_encoder->write(); diff --git a/src/plugins/platforms/vnc/qvncscreen.cpp b/src/plugins/platforms/vnc/qvncscreen.cpp index 75c8bedff7..cd43ce4e69 100644 --- a/src/plugins/platforms/vnc/qvncscreen.cpp +++ b/src/plugins/platforms/vnc/qvncscreen.cpp @@ -58,8 +58,10 @@ QVncScreen::QVncScreen(const QStringList &args) QVncScreen::~QVncScreen() { +#if QT_CONFIG(cursor) if (clientCursor) delete clientCursor; +#endif } bool QVncScreen::initialize() @@ -120,17 +122,21 @@ QRegion QVncScreen::doRedraw() return touched; } + void QVncScreen::enableClientCursor(QVncClient *client) { +#if QT_CONFIG(cursor) delete mCursor; mCursor = nullptr; if (!clientCursor) clientCursor = new QVncClientCursor(); clientCursor->addClient(client); +#endif } void QVncScreen::disableClientCursor(QVncClient *client) { +#if QT_CONFIG(cursor) uint clientCount = clientCursor->removeClient(client); if (clientCount == 0) { delete clientCursor; @@ -138,11 +144,16 @@ void QVncScreen::disableClientCursor(QVncClient *client) } mCursor = new QFbCursor(this); +#endif } QPlatformCursor *QVncScreen::cursor() const { +#if QT_CONFIG(cursor) return mCursor ? static_cast(mCursor) : static_cast(clientCursor); +#else + return nullptr; +#endif } // grabWindow() grabs "from the screen" not from the backingstores. diff --git a/src/plugins/platforms/vnc/qvncscreen.h b/src/plugins/platforms/vnc/qvncscreen.h index b2dd89a2ed..e69aa90d41 100644 --- a/src/plugins/platforms/vnc/qvncscreen.h +++ b/src/plugins/platforms/vnc/qvncscreen.h @@ -86,7 +86,9 @@ public: QRegion dirtyRegion; int refreshRate = 30; QVncServer *vncServer = 0; +#if QT_CONFIG(cursor) QVncClientCursor *clientCursor = 0; +#endif }; QT_END_NAMESPACE -- cgit v1.2.3 From 432fd5a5afe6f165cc11b7e039dadbec9ed80eb5 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Thu, 16 Feb 2017 13:56:13 +0100 Subject: Make VNC a proper feature Change-Id: Iffae3f4d77f46bbf7ac38e7c9bc916f060606dd9 Reviewed-by: Lars Knoll --- src/plugins/platforms/platforms.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro index 2a6e059243..9ccc2b54b9 100644 --- a/src/plugins/platforms/platforms.pro +++ b/src/plugins/platforms/platforms.pro @@ -36,7 +36,7 @@ qtConfig(directfb) { qtConfig(linuxfb): SUBDIRS += linuxfb -unix:!android:!darwin: SUBDIRS += vnc +qtConfig(vnc): SUBDIRS += vnc freebsd { SUBDIRS += bsdfb -- cgit v1.2.3 From 374e0223c2a948e5d3b71e8edeae471ab79cef50 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Thu, 2 Mar 2017 11:53:37 +0100 Subject: winrt: Fix compiler warning The drag event handler classes should have virtual destructors. Change-Id: Ia011856eec37ed303649a1eda036c52f5fa9f8e5 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/winrt/qwinrtdrag.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/winrt/qwinrtdrag.cpp b/src/plugins/platforms/winrt/qwinrtdrag.cpp index 89ebf7d26f..cf52816b65 100644 --- a/src/plugins/platforms/winrt/qwinrtdrag.cpp +++ b/src/plugins/platforms/winrt/qwinrtdrag.cpp @@ -504,6 +504,8 @@ static HRESULT qt_drop(IInspectable *sender, ABI::Windows::UI::Xaml::IDragEventA class QtDragEventHandler##name : public IDragEventHandler \ { \ public: \ + virtual ~QtDragEventHandler##name() {\ + }\ STDMETHODIMP Invoke(IInspectable *sender, \ ABI::Windows::UI::Xaml::IDragEventArgs *e) \ { \ -- cgit v1.2.3 From 66e1d20537b728c449e01dd992917e58f0b5e923 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Thu, 2 Mar 2017 12:35:37 +0100 Subject: winrt: Fix potential warning fix warning about non-portable-includepath due to case insensitivity on windows file system. Change-Id: Ib92db836910c2b9d06a18c841e7c6f0c2e9abab4 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/winrt/qwinrtscreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp index d9a9d3b20f..150fc8a25e 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.cpp +++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp @@ -58,7 +58,7 @@ #include #include #include -#include +#include #include #include #include -- cgit v1.2.3 From 259adc5e77a40bc8f0b7e4c17f7a38bfc4ad511b Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 20 Feb 2017 13:15:40 +0100 Subject: Fix build with -no-opengl Change-Id: I6fb61944ef88e328a94ea6b7ab42db271828a602 Reviewed-by: Lars Knoll Reviewed-by: Laszlo Agocs --- src/plugins/platforms/eglfs/api/qeglfscursor_p.h | 6 +++++- .../platforms/eglfs/deviceintegration/deviceintegration.pro | 2 +- .../eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp | 7 ++++--- .../deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp | 4 ++-- .../eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp | 6 +++++- 5 files changed, 17 insertions(+), 8 deletions(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/eglfs/api/qeglfscursor_p.h b/src/plugins/platforms/eglfs/api/qeglfscursor_p.h index 942fb09aac..aaeb83cb99 100644 --- a/src/plugins/platforms/eglfs/api/qeglfscursor_p.h +++ b/src/plugins/platforms/eglfs/api/qeglfscursor_p.h @@ -79,7 +79,10 @@ private: QEglFSCursor *m_cursor; }; -class Q_EGLFS_EXPORT QEglFSCursor : public QPlatformCursor, protected QOpenGLFunctions +#if QT_CONFIG(opengl) + +class Q_EGLFS_EXPORT QEglFSCursor : public QPlatformCursor + , protected QOpenGLFunctions { Q_OBJECT public: @@ -153,6 +156,7 @@ private: }; QHash m_gfx; }; +#endif // QT_CONFIG(opengl) QT_END_NAMESPACE diff --git a/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro b/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro index aca0078bfb..6d759938b5 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro +++ b/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro @@ -9,7 +9,7 @@ qtConfig(eglfs_mali): SUBDIRS += eglfs_mali qtConfig(eglfs_viv): SUBDIRS += eglfs_viv qtConfig(eglfs_viv_wl): SUBDIRS += eglfs_viv_wl -SUBDIRS += eglfs_emu +qtConfig(opengl): SUBDIRS += eglfs_emu eglfs_kms_egldevice.depends = eglfs_kms_support eglfs_kms.depends = eglfs_kms_support diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp index 16767114ab..b6cdcf92b6 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp @@ -105,12 +105,13 @@ void QEglFSKmsGbmIntegration::destroyNativeWindow(EGLNativeWindowType window) QPlatformCursor *QEglFSKmsGbmIntegration::createCursor(QPlatformScreen *screen) const { - if (screenConfig()->hwCursor()) { - return nullptr; - } else { +#if QT_CONFIG(opengl) + if (!screenConfig()->hwCursor()) { qCDebug(qLcEglfsKmsDebug, "Using plain OpenGL mouse cursor"); return new QEglFSCursor(screen); } +#endif + return nullptr; } void QEglFSKmsGbmIntegration::presentBuffer(QPlatformSurface *surface) diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp index f0bf59466e..0a66a897a1 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp @@ -85,12 +85,12 @@ EGLNativeDisplayType QEglFSKmsEglDevice::nativeDisplay() const QPlatformScreen *QEglFSKmsEglDevice::createScreen(const QKmsOutput &output) { QEglFSKmsScreen *screen = new QEglFSKmsEglDeviceScreen(this, output); - +#if QT_CONFIG(opengl) if (!m_globalCursor && !screenConfig()->separateScreens()) { qCDebug(qLcEglfsKmsDebug, "Creating new global mouse cursor"); m_globalCursor = new QEglFSCursor(screen); } - +#endif return screen; } diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp index 3e333fc25a..43bdb77a18 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp @@ -280,7 +280,11 @@ bool QEglFSKmsEglDeviceIntegration::query_egl_device() QPlatformCursor *QEglFSKmsEglDeviceIntegration::createCursor(QPlatformScreen *screen) const { - return screenConfig()->separateScreens() ? new QEglFSCursor(screen) : nullptr; +#if QT_CONFIG(opengl) + if (screenConfig()->separateScreens()) + return new QEglFSCursor(screen); +#endif + return nullptr; } QT_END_NAMESPACE -- cgit v1.2.3 From 0cd15fd94de4c688f67049b1fef17b6ca698bf67 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 15 Feb 2017 10:47:01 +0100 Subject: Make "finger touch" not be a tablet Otherwise QTouchDevices::devices() doesn't return the touchscreen on my Thinkpad Yoga 460 Change-Id: Ibb829df95f92152a77c512e4325522825901074e Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index 7c842ae1ba..73a7e97716 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -208,6 +208,8 @@ void QXcbConnection::xi2SetupDevices() isTablet = true; tabletData.pointerType = QTabletEvent::Cursor; dbgType = QLatin1String("cursor"); + } else if (name.contains("wacom") && name.contains("finger touch")) { + isTablet = false; } else if ((name.contains("pen") || name.contains("stylus")) && isTablet) { tabletData.pointerType = QTabletEvent::Pen; dbgType = QLatin1String("pen"); -- cgit v1.2.3 From 46bf3d71e58457afcc8177a68243ac71308534db Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 3 Mar 2017 09:00:23 +0100 Subject: xcb: stringify enums for tablet qt.qpa.input.events qCDebug It's a bit easier to read, not having to look up TabletDevice and PointerType enum values manually. Change-Id: I53353be4dcea3e2cb875f04250502ffe802fc971 Reviewed-by: Andy Shaw --- src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index 73a7e97716..4a30f7b7bc 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -42,6 +42,7 @@ #include "qxcbscreen.h" #include "qxcbwindow.h" #include "qtouchdevice.h" +#include "QtCore/qmetaobject.h" #include #include #include @@ -1065,6 +1066,18 @@ static QTabletEvent::TabletDevice toolIdToTabletDevice(quint32 toolId) { return QTabletEvent::Stylus; // Safe default assumption if nonzero } +static const char *toolName(QTabletEvent::TabletDevice tool) { + static const QMetaObject *metaObject = qt_getEnumMetaObject(tool); + static const QMetaEnum me = metaObject->enumerator(metaObject->indexOfEnumerator(qt_getEnumName(tool))); + return me.valueToKey(tool); +} + +static const char *pointerTypeName(QTabletEvent::PointerType ptype) { + static const QMetaObject *metaObject = qt_getEnumMetaObject(ptype); + static const QMetaEnum me = metaObject->enumerator(metaObject->indexOfEnumerator(qt_getEnumName(ptype))); + return me.valueToKey(ptype); +} + bool QXcbConnection::xi2HandleTabletEvent(const void *event, TabletData *tabletData) { bool handled = true; @@ -1138,9 +1151,9 @@ bool QXcbConnection::xi2HandleTabletEvent(const void *event, TabletData *tabletD // TODO maybe have a hash of tabletData->deviceId to device data so we can // look up the tablet name here, and distinguish multiple tablets if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled())) - qCDebug(lcQpaXInputEvents, "XI2 proximity change on tablet %d (USB %x): last tool: %x id %x current tool: %x id %x TabletDevice %d", + qCDebug(lcQpaXInputEvents, "XI2 proximity change on tablet %d (USB %x): last tool: %x id %x current tool: %x id %x %s", tabletData->deviceId, ptr[_WACSER_USB_ID], ptr[_WACSER_LAST_TOOL_SERIAL], ptr[_WACSER_LAST_TOOL_ID], - ptr[_WACSER_TOOL_SERIAL], ptr[_WACSER_TOOL_ID], tabletData->tool); + ptr[_WACSER_TOOL_SERIAL], ptr[_WACSER_TOOL_ID], toolName(tabletData->tool)); } XFree(data); } @@ -1203,9 +1216,10 @@ void QXcbConnection::xi2ReportTabletEvent(const void *event, TabletData *tabletD } if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled())) - qCDebug(lcQpaXInputEvents, "XI2 event on tablet %d with tool %d type %d seq %d detail %d time %d " + qCDebug(lcQpaXInputEvents, "XI2 event on tablet %d with tool %s type %s seq %d detail %d time %d " "pos %6.1f, %6.1f root pos %6.1f, %6.1f buttons 0x%x pressure %4.2lf tilt %d, %d rotation %6.2lf", - tabletData->deviceId, tabletData->tool, ev->evtype, ev->sequenceNumber, ev->detail, ev->time, + tabletData->deviceId, toolName(tabletData->tool), pointerTypeName(tabletData->pointerType), + ev->sequenceNumber, ev->detail, ev->time, fixed1616ToReal(ev->event_x), fixed1616ToReal(ev->event_y), fixed1616ToReal(ev->root_x), fixed1616ToReal(ev->root_y), (int)tabletData->buttons, pressure, xTilt, yTilt, rotation); -- cgit v1.2.3 From 8afc6146be513e7adee6e4ade342e28951bfefc6 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Fri, 24 Feb 2017 09:18:10 -0800 Subject: Windows QPA: Better recover from removed screens when fullscreen QWindowsWindow::handleResized would call isFullScreen_sys which checks if the window's screen geometry matches the one of the window. When switching back from fullscreen, Windows will have set the geometry to fill the next window, but we don't switch QScreen until later in that function, inside handleGeometryChange. This would result in our window to take the whole screen geometry, but the FullScreen state wouldn't be transferred to the new screen. Fix the issue by using screenForGeometry and check if we are fullscreen on any screen. Also make sure that we check the validity of m_savedFrameGeometry when restoring after a screen remove, since we would previously restore to an area not covered by any screen anymore. Change-Id: I43bc02738007918e9a26c1d27a699c51d3365034 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowswindow.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 0028ad1bd0..79dce2fc43 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1750,10 +1750,9 @@ bool QWindowsWindow::isFullScreen_sys() const const QWindow *w = window(); if (!w->isTopLevel()) return false; - const QScreen *screen = w->screen(); - if (!screen) - screen = QGuiApplication::primaryScreen(); - return screen && geometry_sys() == QHighDpi::toNativePixels(screen->geometry(), w); + QRect geometry = geometry_sys(); + QPlatformScreen *screen = screenForGeometry(geometry); + return screen && geometry == QHighDpi::toNativePixels(screen->geometry(), screen); } /*! @@ -1825,6 +1824,13 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState) newStyle |= WS_VISIBLE; setStyle(newStyle); + const QScreen *screen = window()->screen(); + if (!screen) + screen = QGuiApplication::primaryScreen(); + // That area of the virtual desktop might not be covered by a screen anymore. + if (!screen->geometry().intersects(m_savedFrameGeometry)) + m_savedFrameGeometry.moveTo(screen->geometry().topLeft()); + UINT swpf = SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOACTIVATE; if (!m_savedFrameGeometry.isValid()) swpf |= SWP_NOSIZE | SWP_NOMOVE; -- cgit v1.2.3