Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/wayland/wayland_backend.cpp
Show First 20 Lines • Show All 448 Lines • ▼ Show 20 Line(s) | 444 | WaylandBackend::WaylandBackend(QObject *parent) | |||
---|---|---|---|---|---|
449 | , m_compositor(new KWayland::Client::Compositor(this)) | 449 | , m_compositor(new KWayland::Client::Compositor(this)) | ||
450 | , m_subCompositor(new KWayland::Client::SubCompositor(this)) | 450 | , m_subCompositor(new KWayland::Client::SubCompositor(this)) | ||
451 | , m_shell(new Shell(this)) | 451 | , m_shell(new Shell(this)) | ||
452 | , m_shm(new ShmPool(this)) | 452 | , m_shm(new ShmPool(this)) | ||
453 | , m_connectionThreadObject(new ConnectionThread(nullptr)) | 453 | , m_connectionThreadObject(new ConnectionThread(nullptr)) | ||
454 | , m_connectionThread(nullptr) | 454 | , m_connectionThread(nullptr) | ||
455 | { | 455 | { | ||
456 | connect(this, &WaylandBackend::connectionFailed, this, &WaylandBackend::initFailed); | 456 | connect(this, &WaylandBackend::connectionFailed, this, &WaylandBackend::initFailed); | ||
457 | handleOutputs(); | ||||
457 | } | 458 | } | ||
458 | 459 | | |||
459 | WaylandBackend::~WaylandBackend() | 460 | WaylandBackend::~WaylandBackend() | ||
460 | { | 461 | { | ||
461 | if (m_pointerConstraints) { | 462 | if (m_pointerConstraints) { | ||
462 | m_pointerConstraints->release(); | 463 | m_pointerConstraints->release(); | ||
463 | } | 464 | } | ||
464 | delete m_waylandCursor; | 465 | delete m_waylandCursor; | ||
▲ Show 20 Lines • Show All 237 Lines • ▼ Show 20 Line(s) | 702 | } else if (m_shell->isValid()) { | |||
702 | waylandOutput = new ShellOutput(surface, m_shell, this); | 703 | waylandOutput = new ShellOutput(surface, m_shell, this); | ||
703 | } | 704 | } | ||
704 | 705 | | |||
705 | if (!waylandOutput) { | 706 | if (!waylandOutput) { | ||
706 | qCCritical(KWIN_WAYLAND_BACKEND) << "Binding to all shell interfaces failed for output" << i; | 707 | qCCritical(KWIN_WAYLAND_BACKEND) << "Binding to all shell interfaces failed for output" << i; | ||
707 | return; | 708 | return; | ||
708 | } | 709 | } | ||
709 | 710 | | |||
710 | waylandOutput->setScale(initialOutputScale()); | 711 | waylandOutput->init(QPoint(logicalWidthSum, 0), QSize(pixelWidth, pixelHeight)); | ||
711 | waylandOutput->setGeometry(QPoint(logicalWidthSum, 0), QSize(pixelWidth, pixelHeight)); | | |||
712 | 712 | | |||
713 | connect(waylandOutput, &WaylandOutput::sizeChanged, this, [this, waylandOutput](const QSize &size) { | 713 | connect(waylandOutput, &WaylandOutput::sizeChanged, this, [this, waylandOutput](const QSize &size) { | ||
714 | Q_UNUSED(size) | 714 | Q_UNUSED(size) | ||
715 | updateScreenSize(waylandOutput); | 715 | updateScreenSize(waylandOutput); | ||
716 | Compositor::self()->addRepaintFull(); | 716 | Compositor::self()->addRepaintFull(); | ||
717 | }); | 717 | }); | ||
718 | connect(waylandOutput, &WaylandOutput::frameRendered, this, &WaylandBackend::checkBufferSwap); | 718 | connect(waylandOutput, &WaylandOutput::frameRendered, this, &WaylandBackend::checkBufferSwap); | ||
719 | 719 | | |||
▲ Show 20 Lines • Show All 133 Lines • Show Last 20 Lines |