Changeset View
Changeset View
Standalone View
Standalone View
shell/shellcorona.cpp
Show First 20 Lines • Show All 1186 Lines • ▼ Show 20 Line(s) | 1176 | { | |||
---|---|---|---|---|---|
1187 | } | 1187 | } | ||
1188 | 1188 | | |||
1189 | int insertPosition = m_screenPool->id(screen->name()); | 1189 | int insertPosition = m_screenPool->id(screen->name()); | ||
1190 | if (insertPosition < 0) { | 1190 | if (insertPosition < 0) { | ||
1191 | insertPosition = m_screenPool->firstAvailableId(); | 1191 | insertPosition = m_screenPool->firstAvailableId(); | ||
1192 | } | 1192 | } | ||
1193 | 1193 | | |||
1194 | DesktopView *view = new DesktopView(this, screen); | 1194 | DesktopView *view = new DesktopView(this, screen); | ||
1195 | connect(view, &QQuickWindow::sceneGraphError, this, &ShellCorona::showOpenGLNotCompatibleWarning); | 1195 | | ||
1196 | if (view->rendererInterface()->graphicsApi() != QSGRendererInterface::Software) { | ||||
1197 | connect(view, &QQuickWindow::sceneGraphError, this, &ShellCorona::glInitialisationFailed); | ||||
1198 | } | ||||
1196 | connect(screen, &QScreen::geometryChanged, this, [=]() { | 1199 | connect(screen, &QScreen::geometryChanged, this, [=]() { | ||
1197 | const int id = m_screenPool->id(screen->name()); | 1200 | const int id = m_screenPool->id(screen->name()); | ||
1198 | if (id >= 0) { | 1201 | if (id >= 0) { | ||
1199 | emit screenGeometryChanged(id); | 1202 | emit screenGeometryChanged(id); | ||
1200 | emit availableScreenRegionChanged(); | 1203 | emit availableScreenRegionChanged(); | ||
1201 | emit availableScreenRectChanged(); | 1204 | emit availableScreenRectChanged(); | ||
1202 | } | 1205 | } | ||
1203 | }); | 1206 | }); | ||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Line(s) | 1280 | if (!m_desktopViewforId.contains(requestedScreen)) { | |||
1278 | stillWaitingPanels << cont; | 1281 | stillWaitingPanels << cont; | ||
1279 | continue; | 1282 | continue; | ||
1280 | } | 1283 | } | ||
1281 | 1284 | | |||
1282 | //TODO: does a similar check make sense? | 1285 | //TODO: does a similar check make sense? | ||
1283 | //Q_ASSERT(qBound(0, requestedScreen, m_screenPool->count() - 1) == requestedScreen); | 1286 | //Q_ASSERT(qBound(0, requestedScreen, m_screenPool->count() - 1) == requestedScreen); | ||
1284 | QScreen *screen = m_desktopViewforId.value(requestedScreen)->screenToFollow(); | 1287 | QScreen *screen = m_desktopViewforId.value(requestedScreen)->screenToFollow(); | ||
1285 | PanelView* panel = new PanelView(this, screen); | 1288 | PanelView* panel = new PanelView(this, screen); | ||
1286 | connect(panel, &QQuickWindow::sceneGraphError, this, &ShellCorona::showOpenGLNotCompatibleWarning); | 1289 | if (panel->rendererInterface()->graphicsApi() != QSGRendererInterface::Software) { | ||
1290 | connect(panel, &QQuickWindow::sceneGraphError, this, &ShellCorona::glInitialisationFailed); | ||||
1291 | } | ||||
1287 | connect(panel, &QWindow::visibleChanged, this, &Plasma::Corona::availableScreenRectChanged); | 1292 | connect(panel, &QWindow::visibleChanged, this, &Plasma::Corona::availableScreenRectChanged); | ||
1288 | connect(panel, &PanelView::locationChanged, this, &Plasma::Corona::availableScreenRectChanged); | 1293 | connect(panel, &PanelView::locationChanged, this, &Plasma::Corona::availableScreenRectChanged); | ||
1289 | connect(panel, &PanelView::visibilityModeChanged, this, &Plasma::Corona::availableScreenRectChanged); | 1294 | connect(panel, &PanelView::visibilityModeChanged, this, &Plasma::Corona::availableScreenRectChanged); | ||
1290 | connect(panel, &PanelView::thicknessChanged, this, &Plasma::Corona::availableScreenRectChanged); | 1295 | connect(panel, &PanelView::thicknessChanged, this, &Plasma::Corona::availableScreenRectChanged); | ||
1291 | 1296 | | |||
1292 | m_panelViews[cont] = panel; | 1297 | m_panelViews[cont] = panel; | ||
1293 | panel->setContainment(cont); | 1298 | panel->setContainment(cont); | ||
1294 | cont->reactToScreenChange(); | 1299 | cont->reactToScreenChange(); | ||
▲ Show 20 Lines • Show All 687 Lines • ▼ Show 20 Line(s) | 1985 | while (it.hasNext()) { | |||
1982 | if (it.value() == containment) { | 1987 | if (it.value() == containment) { | ||
1983 | it.remove(); | 1988 | it.remove(); | ||
1984 | return; | 1989 | return; | ||
1985 | } | 1990 | } | ||
1986 | } | 1991 | } | ||
1987 | } | 1992 | } | ||
1988 | } | 1993 | } | ||
1989 | 1994 | | |||
1990 | void ShellCorona::showOpenGLNotCompatibleWarning() | | |||
1991 | { | | |||
1992 | static bool s_multipleInvokations = false; | | |||
1993 | if (s_multipleInvokations) { | | |||
1994 | return; | | |||
1995 | } | | |||
1996 | s_multipleInvokations = true; | | |||
1997 | | ||||
1998 | QCoreApplication::setAttribute(Qt::AA_ForceRasterWidgets); | | |||
1999 | QMessageBox::critical(nullptr, i18n("Plasma Failed To Start"), | | |||
2000 | i18n("Plasma is unable to start as it could not correctly use OpenGL 2.\n Please check that your graphic drivers are set up correctly.")); | | |||
2001 | qCritical("Open GL context could not be created"); | | |||
2002 | | ||||
2003 | // this doesn't work and I have no idea why. | | |||
2004 | QCoreApplication::exit(1); | | |||
2005 | } | | |||
2006 | | ||||
2007 | void ShellCorona::setupWaylandIntegration() | 1995 | void ShellCorona::setupWaylandIntegration() | ||
2008 | { | 1996 | { | ||
2009 | if (!KWindowSystem::isPlatformWayland()) { | 1997 | if (!KWindowSystem::isPlatformWayland()) { | ||
2010 | return; | 1998 | return; | ||
2011 | } | 1999 | } | ||
2012 | using namespace KWayland::Client; | 2000 | using namespace KWayland::Client; | ||
2013 | ConnectionThread *connection = ConnectionThread::fromApplication(this); | 2001 | ConnectionThread *connection = ConnectionThread::fromApplication(this); | ||
2014 | if (!connection) { | 2002 | if (!connection) { | ||
▲ Show 20 Lines • Show All 129 Lines • Show Last 20 Lines |