Changeset View
Changeset View
Standalone View
Standalone View
shell/shellcorona.cpp
Show First 20 Lines • Show All 211 Lines • ▼ Show 20 Line(s) | |||||
212 | 212 | | |||
213 | bool ShellCorona::eventFilter(QObject *watched, QEvent *event) | 213 | bool ShellCorona::eventFilter(QObject *watched, QEvent *event) | ||
214 | { | 214 | { | ||
215 | #if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) | 215 | #if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) | ||
216 | if (event->type() == QEvent::PlatformSurface && | 216 | if (event->type() == QEvent::PlatformSurface && | ||
217 | watched->inherits("PlasmaQuick::Dialog")) { | 217 | watched->inherits("PlasmaQuick::Dialog")) { | ||
218 | QPlatformSurfaceEvent *se = static_cast<QPlatformSurfaceEvent *>(event); | 218 | QPlatformSurfaceEvent *se = static_cast<QPlatformSurfaceEvent *>(event); | ||
219 | if (se->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated) { | 219 | if (se->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated) { | ||
220 | if (QGuiApplication::platformName().startsWith( | 220 | if (KWindowSystem::isPlatformWayland()) { | ||
221 | QLatin1String("wayland"), Qt::CaseInsensitive)) { | | |||
222 | WaylandDialogFilter::install(qobject_cast<QWindow *>(watched), this); | 221 | WaylandDialogFilter::install(qobject_cast<QWindow *>(watched), this); | ||
223 | } | 222 | } | ||
224 | } | 223 | } | ||
225 | } | 224 | } | ||
226 | #endif | 225 | #endif | ||
227 | 226 | | |||
228 | return QObject::eventFilter(watched, event); | 227 | return QObject::eventFilter(watched, event); | ||
229 | } | 228 | } | ||
▲ Show 20 Lines • Show All 1346 Lines • ▼ Show 20 Line(s) | 1565 | { | |||
1576 | qCritical("Open GL context could not be created"); | 1575 | qCritical("Open GL context could not be created"); | ||
1577 | 1576 | | |||
1578 | // this doesn't work and I have no idea why. | 1577 | // this doesn't work and I have no idea why. | ||
1579 | QCoreApplication::exit(1); | 1578 | QCoreApplication::exit(1); | ||
1580 | } | 1579 | } | ||
1581 | 1580 | | |||
1582 | void ShellCorona::setupWaylandIntegration() | 1581 | void ShellCorona::setupWaylandIntegration() | ||
1583 | { | 1582 | { | ||
1584 | if (!QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) { | 1583 | if (!KWindowSystem::isPlatformWayland()) { | ||
1585 | return; | 1584 | return; | ||
1586 | } | 1585 | } | ||
1587 | using namespace KWayland::Client; | 1586 | using namespace KWayland::Client; | ||
1588 | ConnectionThread *connection = ConnectionThread::fromApplication(this); | 1587 | ConnectionThread *connection = ConnectionThread::fromApplication(this); | ||
1589 | if (!connection) { | 1588 | if (!connection) { | ||
1590 | return; | 1589 | return; | ||
1591 | } | 1590 | } | ||
1592 | Registry *registry = new Registry(this); | 1591 | Registry *registry = new Registry(this); | ||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |