Don't assume windows and GL contexts are created on the primary screen
Change-Id: Ib4f1c377bf93b1041b5f5e3fc56c0e01e35aeb38 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
This commit is contained in:
parent
d8c98de399
commit
5d7f7e6559
@ -48,6 +48,7 @@
|
|||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
#include <QtGui/QOpenGLContext>
|
#include <QtGui/QOpenGLContext>
|
||||||
|
#include <QtGui/QScreen>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -103,7 +104,7 @@ QQnxGLContext::QQnxGLContext(QOpenGLContext *glContext)
|
|||||||
// Check if all channels are don't care
|
// Check if all channels are don't care
|
||||||
if (alphaSize == -1 && redSize == -1 && greenSize == -1 && blueSize == -1) {
|
if (alphaSize == -1 && redSize == -1 && greenSize == -1 && blueSize == -1) {
|
||||||
// Set colour channels based on depth of window's screen
|
// Set colour channels based on depth of window's screen
|
||||||
QQnxScreen *screen = static_cast<QQnxScreen*>(QQnxScreen::screens().first());
|
QQnxScreen *screen = static_cast<QQnxScreen*>(glContext->screen()->handle());
|
||||||
int depth = screen->depth();
|
int depth = screen->depth();
|
||||||
if (depth == 32) {
|
if (depth == 32) {
|
||||||
// SCREEN_FORMAT_RGBA8888
|
// SCREEN_FORMAT_RGBA8888
|
||||||
|
@ -121,8 +121,7 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context)
|
|||||||
qFatal("QQnxWindow: failed to set window swap interval, errno=%d", errno);
|
qFatal("QQnxWindow: failed to set window swap interval, errno=%d", errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assign the window to the primary display (this is the default specified by screen).
|
setScreen(static_cast<QQnxScreen *>(window->screen()->handle()));
|
||||||
setScreen(QQnxScreen::primaryDisplay());
|
|
||||||
|
|
||||||
// Add the window to the root of the hierarchy
|
// Add the window to the root of the hierarchy
|
||||||
QQnxScreen::addWindow(this);
|
QQnxScreen::addWindow(this);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user