summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/android/qandroidplatformtheme.cpp2
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm12
-rw-r--r--src/plugins/platforms/eglfs/qeglfscontext.cpp10
-rw-r--r--src/plugins/platforms/eglfs/qeglfscontext.h1
4 files changed, 24 insertions, 1 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformtheme.cpp b/src/plugins/platforms/android/qandroidplatformtheme.cpp
index a906d0b9fd..7bed4a739a 100644
--- a/src/plugins/platforms/android/qandroidplatformtheme.cpp
+++ b/src/plugins/platforms/android/qandroidplatformtheme.cpp
@@ -201,7 +201,7 @@ QJsonObject AndroidStyle::loadStyleData()
}
Q_ASSERT(!stylePath.isEmpty());
- if (!androidTheme.isEmpty() && QFileInfo(stylePath + androidTheme + QLatin1String("style.json")).exists())
+ if (!androidTheme.isEmpty() && QFileInfo::exists(stylePath + androidTheme + QLatin1String("style.json")))
stylePath += androidTheme;
QFile f(stylePath + QLatin1String("style.json"));
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 3d6732b648..eb65f7e061 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -1792,6 +1792,18 @@ void QCocoaWindow::exposeWindow()
if (!isWindowExposable())
return;
+ // Update the QWindow's screen property. This property is set
+ // to QGuiApplication::primaryScreen() at QWindow construciton
+ // time, and we won't get a NSWindowDidChangeScreenNotification
+ // on show. The case where the window is initially displayed
+ // on a non-primary screen needs special handling here.
+ NSUInteger screenIndex = [[NSScreen screens] indexOfObject:m_nsWindow.screen];
+ if (screenIndex != NSNotFound) {
+ QCocoaScreen *cocoaScreen = QCocoaIntegration::instance()->screenAtIndex(screenIndex);
+ if (cocoaScreen)
+ window()->setScreen(cocoaScreen->screen());
+ }
+
if (!m_isExposed) {
m_isExposed = true;
m_exposedGeometry = geometry();
diff --git a/src/plugins/platforms/eglfs/qeglfscontext.cpp b/src/plugins/platforms/eglfs/qeglfscontext.cpp
index 1bb4918948..229ac6bbd9 100644
--- a/src/plugins/platforms/eglfs/qeglfscontext.cpp
+++ b/src/plugins/platforms/eglfs/qeglfscontext.cpp
@@ -91,6 +91,16 @@ void QEglFSContext::destroyTemporaryOffscreenSurface(EGLSurface surface)
}
}
+void QEglFSContext::runGLChecks()
+{
+ // Note that even though there is an EGL context current here,
+ // QOpenGLContext and QOpenGLFunctions are not yet usable at this stage.
+ const char *renderer = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
+ // Be nice and warn about a common source of confusion.
+ if (renderer && strstr(renderer, "llvmpipe"))
+ qWarning("Running on a software rasterizer (LLVMpipe), expect limited performance.");
+}
+
void QEglFSContext::swapBuffers(QPlatformSurface *surface)
{
// draw the cursor
diff --git a/src/plugins/platforms/eglfs/qeglfscontext.h b/src/plugins/platforms/eglfs/qeglfscontext.h
index ffe105cdac..b861ae5329 100644
--- a/src/plugins/platforms/eglfs/qeglfscontext.h
+++ b/src/plugins/platforms/eglfs/qeglfscontext.h
@@ -54,6 +54,7 @@ public:
EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) Q_DECL_OVERRIDE;
EGLSurface createTemporaryOffscreenSurface() Q_DECL_OVERRIDE;
void destroyTemporaryOffscreenSurface(EGLSurface surface) Q_DECL_OVERRIDE;
+ void runGLChecks() Q_DECL_OVERRIDE;
void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE;
private: