Changeset View
Changeset View
Standalone View
Standalone View
plugins/scenes/opengl/scene_opengl.cpp
Show First 20 Lines • Show All 513 Lines • ▼ Show 20 Line(s) | 511 | if (GLPlatform::instance()->recommendedCompositor() == XRenderCompositing) { | |||
---|---|---|---|---|---|
514 | qCCritical(KWIN_OPENGL) << "For more information see https://community.kde.org/KWin/Environment_Variables#KWIN_COMPOSE"; | 514 | qCCritical(KWIN_OPENGL) << "For more information see https://community.kde.org/KWin/Environment_Variables#KWIN_COMPOSE"; | ||
515 | } | 515 | } | ||
516 | delete backend; | 516 | delete backend; | ||
517 | } | 517 | } | ||
518 | 518 | | |||
519 | return scene; | 519 | return scene; | ||
520 | } | 520 | } | ||
521 | 521 | | |||
522 | OverlayWindow *SceneOpenGL::overlayWindow() | 522 | OverlayWindow *SceneOpenGL::overlayWindow() const | ||
523 | { | 523 | { | ||
524 | return m_backend->overlayWindow(); | 524 | return m_backend->overlayWindow(); | ||
525 | } | 525 | } | ||
526 | 526 | | |||
527 | bool SceneOpenGL::syncsToVBlank() const | 527 | bool SceneOpenGL::syncsToVBlank() const | ||
528 | { | 528 | { | ||
529 | return m_backend->syncsToVBlank(); | 529 | return m_backend->syncsToVBlank(); | ||
530 | } | 530 | } | ||
▲ Show 20 Lines • Show All 287 Lines • ▼ Show 20 Line(s) | |||||
818 | } | 818 | } | ||
819 | 819 | | |||
820 | SceneOpenGLTexture *SceneOpenGL::createTexture() | 820 | SceneOpenGLTexture *SceneOpenGL::createTexture() | ||
821 | { | 821 | { | ||
822 | return new SceneOpenGLTexture(m_backend); | 822 | return new SceneOpenGLTexture(m_backend); | ||
823 | } | 823 | } | ||
824 | 824 | | |||
825 | bool SceneOpenGL::viewportLimitsMatched(const QSize &size) const { | 825 | bool SceneOpenGL::viewportLimitsMatched(const QSize &size) const { | ||
826 | if (kwinApp()->operationMode() != Application::OperationModeX11) { | ||||
827 | // TODO: On Wayland we can't suspend. Find a solution that works here as well! | ||||
828 | return true; | ||||
829 | } | ||||
826 | GLint limit[2]; | 830 | GLint limit[2]; | ||
827 | glGetIntegerv(GL_MAX_VIEWPORT_DIMS, limit); | 831 | glGetIntegerv(GL_MAX_VIEWPORT_DIMS, limit); | ||
828 | if (limit[0] < size.width() || limit[1] < size.height()) { | 832 | if (limit[0] < size.width() || limit[1] < size.height()) { | ||
829 | QMetaObject::invokeMethod(Compositor::self(), "suspend", | 833 | QMetaObject::invokeMethod(static_cast<X11Compositor*>(Compositor::self()), "suspend", | ||
830 | Qt::QueuedConnection, Q_ARG(Compositor::SuspendReason, Compositor::AllReasonSuspend)); | 834 | Qt::QueuedConnection, Q_ARG(X11Compositor::SuspendReason, X11Compositor::AllReasonSuspend)); | ||
831 | return false; | 835 | return false; | ||
832 | } | 836 | } | ||
833 | return true; | 837 | return true; | ||
834 | } | 838 | } | ||
835 | 839 | | |||
836 | void SceneOpenGL::screenGeometryChanged(const QSize &size) | 840 | void SceneOpenGL::screenGeometryChanged(const QSize &size) | ||
837 | { | 841 | { | ||
838 | if (!viewportLimitsMatched(size)) | 842 | if (!viewportLimitsMatched(size)) | ||
▲ Show 20 Lines • Show All 1736 Lines • Show Last 20 Lines |