From 4a4368df5663729a34761c394a6f02b72071e89c Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Tue, 18 Oct 2016 13:17:53 +0300 Subject: QAndroidPlatformTheme: wrap char* in QL1S to avoid warnings Change-Id: Idcc70038051b03366aa447f3a4c48912d3f911d5 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/plugins/platforms/android/qandroidplatformtheme.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/android/qandroidplatformtheme.cpp b/src/plugins/platforms/android/qandroidplatformtheme.cpp index 9350a15721..801bb78436 100644 --- a/src/plugins/platforms/android/qandroidplatformtheme.cpp +++ b/src/plugins/platforms/android/qandroidplatformtheme.cpp @@ -458,9 +458,9 @@ QVariant QAndroidPlatformTheme::themeHint(ThemeHint hint) const case StyleNames: if (qEnvironmentVariableIntValue("QT_USE_ANDROID_NATIVE_STYLE") && m_androidStyleData) { - return QStringList("android"); + return QStringList(QLatin1String("android")); } - return QStringList("fusion"); + return QStringList(QLatin1String("fusion")); case MouseDoubleClickDistance: { -- cgit v1.2.3 From ee22c6505a1f7cf52a862b1bd9219511db893417 Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Tue, 30 Aug 2016 07:52:17 -0600 Subject: xcb: fix passing of focus from child to its top level QWindow With the client message _NET_ACTIVE_WINDOW, not all window managers will pass focus from a child window to its root window, Detect this child-to-root case, and use xcb_set_input_focus() instead. Task-number: QTBUG-39362 Change-Id: Ib32193018e3b725b323f87d7306c9ae9493d78a7 Reviewed-by: Shawn Rutledge Reviewed-by: Edward Welbourne Reviewed-by: Frederik Gladhorn --- src/plugins/platforms/xcb/qxcbwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 5f402b6eca..25a8b41195 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -1698,9 +1698,11 @@ void QXcbWindow::requestActivateWindow() m_deferredActivation = false; updateNetWmUserTime(connection()->time()); + QWindow *focusWindow = QGuiApplication::focusWindow(); if (window()->isTopLevel() && !(window()->flags() & Qt::X11BypassWindowManagerHint) + && (!focusWindow || !window()->isAncestorOf(focusWindow)) && connection()->wmSupport()->isSupportedByWM(atom(QXcbAtom::_NET_ACTIVE_WINDOW))) { xcb_client_message_event_t event; @@ -1711,7 +1713,6 @@ void QXcbWindow::requestActivateWindow() event.type = atom(QXcbAtom::_NET_ACTIVE_WINDOW); event.data.data32[0] = 1; event.data.data32[1] = connection()->time(); - QWindow *focusWindow = QGuiApplication::focusWindow(); event.data.data32[2] = focusWindow ? focusWindow->winId() : XCB_NONE; event.data.data32[3] = 0; event.data.data32[4] = 0; -- cgit v1.2.3 From cd081ca96a5387abe36f46a347363e07edcdcd67 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 19 Sep 2016 12:13:33 +0200 Subject: macOS: Only show menu and allow dragging on proxy when a file path is set If there is no file path set then it should not be possible to see a menu or to drag from a proxy icon in the titlebar. Task-number: QTBUG-56082 Change-Id: Ib8305bcab5717bc8cb7ddabbb079f152debbdded Reviewed-by: Jake Petroules --- src/plugins/platforms/cocoa/qcocoawindow.h | 1 + src/plugins/platforms/cocoa/qcocoawindow.mm | 2 ++ src/plugins/platforms/cocoa/qnswindowdelegate.h | 3 ++- src/plugins/platforms/cocoa/qnswindowdelegate.mm | 15 +++++++++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h index 9fcb221d37..9cf6328281 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.h +++ b/src/plugins/platforms/cocoa/qcocoawindow.h @@ -346,6 +346,7 @@ public: // for QNSView // This object is tracked by QCocoaWindowPointer, // preventing the use of dangling pointers. QObject sentinel; + bool m_hasWindowFilePath; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index c0d5904367..977a5ae657 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -379,6 +379,7 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw) , m_topContentBorderThickness(0) , m_bottomContentBorderThickness(0) , m_normalGeometry(QRect(0,0,-1,-1)) + , m_hasWindowFilePath(false) { #ifdef QT_COCOA_ENABLE_WINDOW_DEBUG qDebug() << "QCocoaWindow::QCocoaWindow" << this; @@ -941,6 +942,7 @@ void QCocoaWindow::setWindowFilePath(const QString &filePath) QFileInfo fi(filePath); [m_nsWindow setRepresentedFilename: fi.exists() ? QCFString::toNSString(filePath) : @""]; + m_hasWindowFilePath = fi.exists(); } void QCocoaWindow::setWindowIcon(const QIcon &icon) diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.h b/src/plugins/platforms/cocoa/qnswindowdelegate.h index b8d344aa0e..a5f3dca68c 100644 --- a/src/plugins/platforms/cocoa/qnswindowdelegate.h +++ b/src/plugins/platforms/cocoa/qnswindowdelegate.h @@ -51,7 +51,8 @@ - (void)windowWillMove:(NSNotification *)notification; - (BOOL)windowShouldClose:(NSNotification *)notification; - (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame; - +- (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu; +- (BOOL)window:(NSWindow *)window shouldDragDocumentWithEvent:(NSEvent *)event from:(NSPoint)dragImageLocation withPasteboard:(NSPasteboard *)pasteboard; @end QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSWindowDelegate); diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm index 015274cac7..a26f381ddb 100644 --- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm +++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm @@ -109,4 +109,19 @@ return YES; } +- (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu +{ + Q_UNUSED(window); + Q_UNUSED(menu); + return m_cocoaWindow && m_cocoaWindow->m_hasWindowFilePath; +} + +- (BOOL)window:(NSWindow *)window shouldDragDocumentWithEvent:(NSEvent *)event from:(NSPoint)dragImageLocation withPasteboard:(NSPasteboard *)pasteboard +{ + Q_UNUSED(window); + Q_UNUSED(event); + Q_UNUSED(dragImageLocation); + Q_UNUSED(pasteboard); + return m_cocoaWindow && m_cocoaWindow->m_hasWindowFilePath; +} @end -- cgit v1.2.3 From b6df7257501b54521c25587c3c5e600b2c9393d1 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 20 Oct 2016 18:31:10 +0200 Subject: Fix UB (ininited pointer read) in qt_egl_device_integration() The m_integration member of DeviceIntegration, a naked pointer, was checked for nullptr in the DeviceIntegration ctor, but never set to nullptr. Fix by init'ing it to nullptr in the ctor-init-list. Coverity-Id: 172056 Change-Id: Ia1dc9b67b9d16a991bba82338eedb19de68f91d8 Reviewed-by: Thiago Macieira --- src/plugins/platforms/eglfs/qeglfshooks.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/plugins') diff --git a/src/plugins/platforms/eglfs/qeglfshooks.cpp b/src/plugins/platforms/eglfs/qeglfshooks.cpp index cf016d1b01..638960d998 100644 --- a/src/plugins/platforms/eglfs/qeglfshooks.cpp +++ b/src/plugins/platforms/eglfs/qeglfshooks.cpp @@ -61,6 +61,7 @@ private: Q_GLOBAL_STATIC(DeviceIntegration, deviceIntegration) DeviceIntegration::DeviceIntegration() + : m_integration(Q_NULLPTR) { QStringList pluginKeys = QEGLDeviceIntegrationFactory::keys(); if (!pluginKeys.isEmpty()) { -- cgit v1.2.3 From 10b9321c1dc19236620ba20bdf54cae73891d1ef Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Wed, 19 Oct 2016 15:30:58 +0300 Subject: qxcbconnection.cpp: fix warning about unused function isXIEvent() is used iff XCB_USE_XINPUT2 is defined. So move declaration of the function in XCB_USE_XINPUT2 define scope. Change-Id: I6f045cd07d572ee7425ee6edc5ac73dcf0afdb37 Reviewed-by: Edward Welbourne Reviewed-by: Thiago Macieira --- src/plugins/platforms/xcb/qxcbconnection.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index c533a2a5f5..3d808d1d37 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -110,6 +110,7 @@ Q_LOGGING_CATEGORY(lcQpaScreen, "qt.qpa.screen") #define XCB_GE_GENERIC 35 #endif +#if defined(XCB_USE_XINPUT2) // Starting from the xcb version 1.9.3 struct xcb_ge_event_t has changed: // - "pad0" became "extension" // - "pad1" and "pad" became "pad0" @@ -127,6 +128,7 @@ static inline bool isXIEvent(xcb_generic_event_t *event, int opCode) qt_xcb_ge_event_t *e = (qt_xcb_ge_event_t *)event; return e->extension == opCode; } +#endif // XCB_USE_XINPUT2 #ifdef XCB_USE_XLIB static const char * const xcbConnectionErrors[] = { -- cgit v1.2.3