Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/wayland/wayland_backend.cpp
Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Line(s) | |||||
98 | 98 | | |||
99 | void WaylandCursor::installImage() | 99 | void WaylandCursor::installImage() | ||
100 | { | 100 | { | ||
101 | const QImage image = m_backend->softwareCursor(); | 101 | const QImage image = m_backend->softwareCursor(); | ||
102 | if (image.isNull() || image.size().isEmpty()) { | 102 | if (image.isNull() || image.size().isEmpty()) { | ||
103 | doInstallImage(nullptr, QSize()); | 103 | doInstallImage(nullptr, QSize()); | ||
104 | return; | 104 | return; | ||
105 | } | 105 | } | ||
106 | wl_buffer *imageBuffer = *(m_backend->shmPool()->createBuffer(image).data()); | 106 | | ||
107 | auto buffer = m_backend->shmPool()->createBuffer(image).toStrongRef(); | ||||
108 | wl_buffer *imageBuffer = *buffer.data(); | ||||
107 | doInstallImage(imageBuffer, image.size()); | 109 | doInstallImage(imageBuffer, image.size()); | ||
108 | } | 110 | } | ||
109 | 111 | | |||
110 | void WaylandCursor::doInstallImage(wl_buffer *image, const QSize &size) | 112 | void WaylandCursor::doInstallImage(wl_buffer *image, const QSize &size) | ||
111 | { | 113 | { | ||
112 | auto *pointer = m_backend->seat()->pointer(); | 114 | auto *pointer = m_backend->seat()->pointer(); | ||
113 | if (!pointer || !pointer->isValid()) { | 115 | if (!pointer || !pointer->isValid()) { | ||
114 | return; | 116 | return; | ||
▲ Show 20 Lines • Show All 555 Lines • ▼ Show 20 Line(s) | 670 | for (int i = 0; i < initialOutputCount(); i++) { | |||
670 | if (!surface || !surface->isValid()) { | 672 | if (!surface || !surface->isValid()) { | ||
671 | qCCritical(KWIN_WAYLAND_BACKEND) << "Creating Wayland Surface failed"; | 673 | qCCritical(KWIN_WAYLAND_BACKEND) << "Creating Wayland Surface failed"; | ||
672 | return; | 674 | return; | ||
673 | } | 675 | } | ||
674 | 676 | | |||
675 | if (ssdManager) { | 677 | if (ssdManager) { | ||
676 | auto decoration = ssdManager->create(surface, this); | 678 | auto decoration = ssdManager->create(surface, this); | ||
677 | connect(decoration, &ServerSideDecoration::modeChanged, this, | 679 | connect(decoration, &ServerSideDecoration::modeChanged, this, | ||
678 | [this, decoration] { | 680 | [decoration] { | ||
679 | if (decoration->mode() != ServerSideDecoration::Mode::Server) { | 681 | if (decoration->mode() != ServerSideDecoration::Mode::Server) { | ||
680 | decoration->requestMode(ServerSideDecoration::Mode::Server); | 682 | decoration->requestMode(ServerSideDecoration::Mode::Server); | ||
681 | } | 683 | } | ||
682 | } | 684 | } | ||
683 | ); | 685 | ); | ||
684 | } | 686 | } | ||
685 | 687 | | |||
686 | WaylandOutput *waylandOutput = nullptr; | 688 | WaylandOutput *waylandOutput = nullptr; | ||
▲ Show 20 Lines • Show All 152 Lines • Show Last 20 Lines |