From 08f3177fdfc9aefbd4232dcd1529b537b2ca9402 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 25 Nov 2013 13:41:49 +0100 Subject: CoreWLan: Fix potential unhandled exception assert -[QNSListener notificationHandler:] was declared as not taking any parameter, but used as taking a single NSNotification. This would lead to an 'unrecognized selector' exception raised by Cocoa. Task-number: QTBUG-26844 Change-Id: I56d03a7738c2a1b9dcf3cdecc696b01e65d7b233 Reviewed-by: Liang Qi --- src/plugins/bearer/corewlan/qcorewlanengine.mm | 5 +++-- src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm index b0ed4076da..dc2920360d 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.mm +++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm @@ -71,7 +71,7 @@ extern "C" { // Otherwise it won't find CWKeychain* symbols at link time QCoreWlanEngine *engine; NSLock *locker; } -- (void)notificationHandler;//:(NSNotification *)notification; +- (void)notificationHandler:(NSNotification *)notification; - (void)remove; - (void)setEngine:(QCoreWlanEngine *)coreEngine; - (QCoreWlanEngine *)engine; @@ -120,8 +120,9 @@ extern "C" { // Otherwise it won't find CWKeychain* symbols at link time [locker unlock]; } -- (void)notificationHandler//:(NSNotification *)notification +- (void)notificationHandler:(NSNotification *)notification { + Q_UNUSED(notification); engine->requestUpdate(); } @end diff --git a/src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm b/src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm index 1b95ae29ad..7044e9696b 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm +++ b/src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm @@ -48,7 +48,7 @@ QCoreWlanEngine *engine; NSLock *locker; } -- (void)notificationHandler;//:(NSNotification *)notification; +- (void)notificationHandler:(NSNotification *)notification; - (void)remove; - (void)setEngine:(QCoreWlanEngine *)coreEngine; - (QCoreWlanEngine *)engine; @@ -97,8 +97,9 @@ [locker unlock]; } -- (void)notificationHandler//:(NSNotification *)notification +- (void)notificationHandler:(NSNotification *)notification { + Q_UNUSED(notification); engine->requestUpdate(); } @end -- cgit v1.2.3 From 94c17dce04c7726afbdd6ac67c569eedc629a81a Mon Sep 17 00:00:00 2001 From: Frank Osterfeld Date: Fri, 22 Nov 2013 10:43:49 +0100 Subject: QNX: Fix retrieving the window group name The code assumes that there is a root window, and crashed otherwise. Task-number: QTBUG-35121 Change-Id: Idbf0e0bfc03cd427f0aab81db88b34fe94228c81 Reviewed-by: Rafael Roquetto --- src/plugins/platforms/qnx/qqnxnativeinterface.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/qnx/qqnxnativeinterface.cpp b/src/plugins/platforms/qnx/qqnxnativeinterface.cpp index 8958a5c1e2..24af5c2683 100644 --- a/src/plugins/platforms/qnx/qqnxnativeinterface.cpp +++ b/src/plugins/platforms/qnx/qqnxnativeinterface.cpp @@ -52,11 +52,13 @@ QT_BEGIN_NAMESPACE void *QQnxNativeInterface::nativeResourceForWindow(const QByteArray &resource, QWindow *window) { if (resource == "windowGroup" && window && window->screen()) { - const QQnxScreen * const screen = static_cast(window->screen()->handle()); + QQnxScreen * const screen = static_cast(window->screen()->handle()); if (screen) { + screen_window_t screenWindow = reinterpret_cast(window->winId()); + QQnxWindow *qnxWindow = screen->findWindow(screenWindow); // We can't just call data() instead of constData() here, since that would detach // and the lifetime of the char * would not be long enough. Therefore the const_cast. - return const_cast(screen->rootWindow()->groupName().constData()); + return qnxWindow ? const_cast(qnxWindow->groupName().constData()) : 0; } } -- cgit v1.2.3 From 09466a942e7b940c64b7b4bd64a0069247961501 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 26 Nov 2013 14:25:11 +0100 Subject: windows: Set forward compatibility bit properly The bit should be set when QSurfaceFormat::DeprecatedFunctions is _not_ specified. The documentation was correct, the implementation was not. Change-Id: If7202d3a59d5336fff255a290b65fb4bfa7b79c9 Reviewed-by: Friedemann Kleint Reviewed-by: Gunnar Sletta --- src/plugins/platforms/windows/qwindowsglcontext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp index d1ede39549..b7de368fa8 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp @@ -589,7 +589,7 @@ static HGLRC createContext(const QOpenGLStaticContext &staticContext, if (requestedVersion >= 0x0300) { attributes[attribIndex++] = WGL_CONTEXT_FLAGS_ARB; attributes[attribIndex] = 0; - if (format.testOption(QSurfaceFormat::DeprecatedFunctions)) + if (!format.testOption(QSurfaceFormat::DeprecatedFunctions)) attributes[attribIndex] |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; if (format.testOption(QSurfaceFormat::DebugContext)) attributes[attribIndex] |= WGL_CONTEXT_DEBUG_BIT_ARB; -- cgit v1.2.3 From 1aa4ac61f980b2044069e9b89b001d5d07430ac6 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 26 Nov 2013 16:27:17 +0100 Subject: QCocoaFileDialogHelper: Cache directory until delegate has been created MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-34393 Change-Id: Idee9e879e586afe25fd099d157ed7af88c17c4a3 Reviewed-by: Friedemann Kleint Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoafiledialoghelper.h | 1 + src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h index 8a8b1d946c..16d1ffbe85 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h @@ -82,6 +82,7 @@ public: private: void *mDelegate; + QUrl mDir; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm index 1ad833ee44..08505d91a2 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm @@ -610,6 +610,8 @@ void QCocoaFileDialogHelper::setDirectory(const QUrl &directory) QNSOpenSavePanelDelegate *delegate = static_cast(mDelegate); if (delegate) [delegate->mSavePanel setDirectoryURL:[NSURL fileURLWithPath:QCFString::toNSString(directory.toLocalFile())]]; + else + mDir = directory; } QUrl QCocoaFileDialogHelper::directory() const @@ -619,7 +621,7 @@ QUrl QCocoaFileDialogHelper::directory() const QString path = QCFString::toQString([[delegate->mSavePanel directoryURL] path]).normalized(QString::NormalizationForm_C); return QUrl::fromLocalFile(path); } - return QUrl(); + return mDir; } void QCocoaFileDialogHelper::selectFile(const QUrl &filename) @@ -707,7 +709,7 @@ void QCocoaFileDialogHelper::createNSOpenSavePanelDelegate() QCocoaAutoReleasePool pool; const SharedPointerFileDialogOptions &opts = options(); const QList selectedFiles = opts->initiallySelectedFiles(); - const QUrl directory = opts->initialDirectory(); + const QUrl directory = mDir.isEmpty() ? opts->initialDirectory() : mDir; const bool selectDir = selectedFiles.isEmpty(); QString selection(selectDir ? directory.toLocalFile() : selectedFiles.front().toLocalFile()); QNSOpenSavePanelDelegate *delegate = [[QNSOpenSavePanelDelegate alloc] -- cgit v1.2.3 From ca73f493a1c902bb4ddf5ce21a24c1ca2a29ba87 Mon Sep 17 00:00:00 2001 From: Zeno Albisser Date: Wed, 27 Nov 2013 13:34:55 +0100 Subject: Allow resetting Qt::WindowFullscreenButtonHint Currently Qt::WindowFulscreenButtonHint is only respected on window creation. But flags can also be adjusted later on. Further setWindowShadow can be removed from within createNSWindow, as it operates on a Nil object in that case. It is however called by recreateWindow / setWindowFlags subsequently. Change-Id: I507d6fde5ad2f0ee5b9db322325ede99b70e151e Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoawindow.mm | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 4da47f4f1f..b5b9cec2be 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -522,6 +522,20 @@ void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags) if (!(styleMask & NSBorderlessWindowMask)) { setWindowTitle(window()->title()); } + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) { + Qt::WindowType type = window()->type(); + if ((type & Qt::Popup) != Qt::Popup && (type & Qt::Dialog) != Qt::Dialog) { + NSWindowCollectionBehavior behavior = [m_nsWindow collectionBehavior]; + if (flags & Qt::WindowFullscreenButtonHint) + behavior |= NSWindowCollectionBehaviorFullScreenPrimary; + else + behavior &= ~NSWindowCollectionBehaviorFullScreenPrimary; + [m_nsWindow setCollectionBehavior:behavior]; + } + } +#endif } m_windowFlags = flags; @@ -871,8 +885,6 @@ NSWindow * QCocoaWindow::createNSWindow() // before the window is shown and needs a proper window.). if ((type & Qt::Popup) == Qt::Popup) [window setHasShadow:YES]; - else - setWindowShadow(flags); [window setHidesOnDeactivate: NO]; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 @@ -894,14 +906,6 @@ NSWindow * QCocoaWindow::createNSWindow() defer:NO]; // Deferring window creation breaks OpenGL (the GL context is set up // before the window is shown and needs a proper window.). window->m_cocoaPlatformWindow = this; - setWindowShadow(flags); - -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 - if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) { - if (flags & Qt::WindowFullscreenButtonHint) - [window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; - } -#endif createdWindow = window; } -- cgit v1.2.3 From b8ff073c0d0a955776038fde1c16d471c875a4c3 Mon Sep 17 00:00:00 2001 From: Louai Al-Khanji Date: Wed, 27 Nov 2013 14:56:19 +0200 Subject: Fix directwrite font engine compile Add missing comma that prevented compilation. Change-Id: If771366adf3a31427c2beefa09c0206653f8ec84 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp index 7407d88f8b..d81848fcc7 100644 --- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp +++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp @@ -276,7 +276,7 @@ bool QWindowsFontEngineDirectWrite::getSfntTableData(uint tag, uchar *buffer, ui UINT32 tableSize; void *tableContext = 0; BOOL exists; - HRESULT hr = m_directWriteFontFace->TryGetFontTable(qbswap(tag) + HRESULT hr = m_directWriteFontFace->TryGetFontTable(qbswap(tag), &tableData, &tableSize, &tableContext, &exists); if (SUCCEEDED(hr)) { -- cgit v1.2.3 From dc03e0c429c4398ca7905285a30741a7ad8c9daf Mon Sep 17 00:00:00 2001 From: Jorgen Lind Date: Wed, 27 Nov 2013 15:18:59 +0100 Subject: Return the xcb_screen_t and not the QPlatformScreen from QXcbNativeInterface. The QPlatformScreen is available from QScreen::handle() Change-Id: If81daf34c07f4a49c85c43d3755d1a9167626d6d Reviewed-by: Gunnar Sletta Reviewed-by: Laszlo Agocs --- src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index aeda1e11d1..33ae60a017 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -212,7 +212,7 @@ void *QXcbNativeInterface::nativeResourceForWindow(const QByteArray &resourceStr result = connectionForWindow(window); break; case Screen: - result = qPlatformScreenForWindow(window); + result = screenForWindow(window); break; default: break; -- cgit v1.2.3 From 75c9a058b3524de0e7b0575ead85b60be745e874 Mon Sep 17 00:00:00 2001 From: Jorgen Lind Date: Tue, 26 Nov 2013 15:21:56 +0100 Subject: Remove stale xcb_dri2 code in QXcbNativeInterface Change-Id: Ifc8dc8d84fc60b70f8a49282dfe32cd248bef9ba Reviewed-by: Gunnar Sletta --- src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 2 +- src/plugins/platforms/xcb/qxcbnativeinterface.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index 33ae60a017..7d69564c57 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -76,7 +76,7 @@ static int resourceType(const QByteArray &key) static const QByteArray names[] = { // match QXcbNativeInterface::ResourceType QByteArrayLiteral("display"), QByteArrayLiteral("egldisplay"), QByteArrayLiteral("connection"), QByteArrayLiteral("screen"), - QByteArrayLiteral("graphicsdevice"), QByteArrayLiteral("eglcontext"), + QByteArrayLiteral("eglcontext"), QByteArrayLiteral("glxcontext"), QByteArrayLiteral("apptime"), QByteArrayLiteral("appusertime"), QByteArrayLiteral("hintstyle"), QByteArrayLiteral("startupid"), QByteArrayLiteral("traywindow"), diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h index aec78087f5..9c4fa44d3b 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.h +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h @@ -62,7 +62,6 @@ public: EglDisplay, Connection, Screen, - GraphicsDevice, EglContext, GLXContext, AppTime, @@ -90,7 +89,6 @@ public: void *eglDisplayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); - void *graphicsDeviceForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); -- cgit v1.2.3 From d34cae51fa7b3952b651401c9e43ffd7b3d0d32c Mon Sep 17 00:00:00 2001 From: Andrew Knight Date: Thu, 28 Nov 2013 13:07:09 +0200 Subject: Add new configure parameter for Xcb-Xlib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds a new configuration parameter, xcb-xlib, which allows overriding the configure test for that existing configuration option. The use of xcb-xlib in the xcb platform plugin becomes the preferred path for non-OpenGL ES 2 builds, while the EGL codepath is used otherwise. This has the advantage that EGL can be used with Desktop OpenGL if Qt is configured with -no-xcb-xlib. Change-Id: I5018e31fe0399b94f020c671eff9414d00431c44 Reviewed-by: Jørgen Lind --- src/plugins/platforms/xcb/xcb-plugin.pro | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/xcb/xcb-plugin.pro b/src/plugins/platforms/xcb/xcb-plugin.pro index 4f69ca8aab..8968d020c4 100644 --- a/src/plugins/platforms/xcb/xcb-plugin.pro +++ b/src/plugins/platforms/xcb/xcb-plugin.pro @@ -81,15 +81,7 @@ contains(QT_CONFIG, xcb-sm) { } contains(QT_CONFIG, opengl) { - contains(QT_CONFIG, opengles2) { - DEFINES += XCB_USE_EGL - CONFIG += egl - HEADERS += qxcbeglsurface.h - - # EGL on MeeGo 1.2 Harmattan needs this macro to map EGLNativeDisplayType - # and other types to the correct X11 types - DEFINES += SUPPORT_X11 - } else:contains(QT_CONFIG, xcb-xlib) { + contains(QT_CONFIG, xcb-xlib):!contains(QT_CONFIG, opengles2) { DEFINES += XCB_USE_GLX HEADERS += qglxintegration.h SOURCES += qglxintegration.cpp @@ -98,6 +90,14 @@ contains(QT_CONFIG, opengl) { DEFINES += XCB_HAS_XCB_GLX LIBS += -lxcb-glx } + } else:contains(QT_CONFIG, egl) { + DEFINES += XCB_USE_EGL + CONFIG += egl + HEADERS += qxcbeglsurface.h + + # EGL on MeeGo 1.2 Harmattan needs this macro to map EGLNativeDisplayType + # and other types to the correct X11 types + DEFINES += SUPPORT_X11 } } -- cgit v1.2.3 From a2d3b7c99165cb5c4be6f0dd83a967e1119cf732 Mon Sep 17 00:00:00 2001 From: Jorgen Lind Date: Thu, 28 Nov 2013 11:06:29 +0100 Subject: Move the glxfbconfig configtest to qpa and rename it to glx We require glx version 1.3 which is where fbconfig is first defined. Also make use of the configure test and report the glx status. GLX support should always take precedence when compiling the xcb backend Change-Id: Ie46834210bf5cd2ac4006ff08379e0d3434ffa2b Reviewed-by: Laszlo Agocs --- src/plugins/platforms/xcb/xcb-plugin.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/xcb/xcb-plugin.pro b/src/plugins/platforms/xcb/xcb-plugin.pro index 8968d020c4..49a1c1b320 100644 --- a/src/plugins/platforms/xcb/xcb-plugin.pro +++ b/src/plugins/platforms/xcb/xcb-plugin.pro @@ -81,7 +81,7 @@ contains(QT_CONFIG, xcb-sm) { } contains(QT_CONFIG, opengl) { - contains(QT_CONFIG, xcb-xlib):!contains(QT_CONFIG, opengles2) { + contains(QT_CONFIG, xcb-xlib):contains(QT_CONFIG, glx) { DEFINES += XCB_USE_GLX HEADERS += qglxintegration.h SOURCES += qglxintegration.cpp -- cgit v1.2.3 From d55db6dd535149adca77a5d5a1bb61823aee94b5 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Thu, 28 Nov 2013 14:42:56 +0100 Subject: Cocoa: avoid a crash in QCocoaDrag NSEvent needs to be copied. Reference: http://lists.apple.com/archives/cocoa-dev/2007/Dec/msg00678.html Task-number: QTBUG-33533 Change-Id: I73709545573e59aab6875a8c3dd903cb171e858f Reviewed-by: Jake Petroules Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoadrag.h | 1 + src/plugins/platforms/cocoa/qcocoadrag.mm | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/cocoa/qcocoadrag.h b/src/plugins/platforms/cocoa/qcocoadrag.h index 80259df600..6810a21944 100644 --- a/src/plugins/platforms/cocoa/qcocoadrag.h +++ b/src/plugins/platforms/cocoa/qcocoadrag.h @@ -55,6 +55,7 @@ class QCocoaDrag : public QPlatformDrag { public: QCocoaDrag(); + virtual ~QCocoaDrag(); virtual QMimeData *platformDropData(); virtual Qt::DropAction drag(QDrag *m_drag); diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm index a37552d844..a22830f64e 100644 --- a/src/plugins/platforms/cocoa/qcocoadrag.mm +++ b/src/plugins/platforms/cocoa/qcocoadrag.mm @@ -53,9 +53,15 @@ QCocoaDrag::QCocoaDrag() : m_lastView = 0; } +QCocoaDrag::~QCocoaDrag() +{ + [m_lastEvent release]; +} + void QCocoaDrag::setLastMouseEvent(NSEvent *event, NSView *view) { - m_lastEvent = event; + [m_lastEvent release]; + m_lastEvent = [event copy]; m_lastView = view; } -- cgit v1.2.3