Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/drm_backend.cpp
| Show First 20 Lines • Show All 618 Lines • ▼ Show 20 Line(s) | 617 | { | |||
|---|---|---|---|---|---|
| 619 | connect(waylandServer()->seat(), &KWayland::Server::SeatInterface::hasPointerChanged, this, | 619 | connect(waylandServer()->seat(), &KWayland::Server::SeatInterface::hasPointerChanged, this, | ||
| 620 | [this] { | 620 | [this] { | ||
| 621 | m_cursorEnabled = waylandServer()->seat()->hasPointer(); | 621 | m_cursorEnabled = waylandServer()->seat()->hasPointer(); | ||
| 622 | if (usesSoftwareCursor()) { | 622 | if (usesSoftwareCursor()) { | ||
| 623 | return; | 623 | return; | ||
| 624 | } | 624 | } | ||
| 625 | for (auto it = m_outputs.constBegin(); it != m_outputs.constEnd(); ++it) { | 625 | for (auto it = m_outputs.constBegin(); it != m_outputs.constEnd(); ++it) { | ||
| 626 | if (m_cursorEnabled) { | 626 | if (m_cursorEnabled) { | ||
| 627 | (*it)->showCursor(); | 627 | if (!(*it)->showCursor()) { | ||
| 628 | setSoftWareCursor(true); | ||||
| 629 | } | ||||
| 628 | } else { | 630 | } else { | ||
| 629 | (*it)->hideCursor(); | 631 | (*it)->hideCursor(); | ||
| 630 | } | 632 | } | ||
| 631 | } | 633 | } | ||
| 632 | } | 634 | } | ||
| 633 | ); | 635 | ); | ||
| 634 | uint64_t capability = 0; | 636 | uint64_t capability = 0; | ||
| 635 | QSize cursorSize; | 637 | QSize cursorSize; | ||
| Show All 12 Lines | |||||
| 648 | connect(this, &DrmBackend::cursorChanged, this, &DrmBackend::updateCursor); | 650 | connect(this, &DrmBackend::cursorChanged, this, &DrmBackend::updateCursor); | ||
| 649 | connect(Cursor::self(), &Cursor::posChanged, this, &DrmBackend::moveCursor); | 651 | connect(Cursor::self(), &Cursor::posChanged, this, &DrmBackend::moveCursor); | ||
| 650 | } | 652 | } | ||
| 651 | 653 | | |||
| 652 | void DrmBackend::setCursor() | 654 | void DrmBackend::setCursor() | ||
| 653 | { | 655 | { | ||
| 654 | if (m_cursorEnabled) { | 656 | if (m_cursorEnabled) { | ||
| 655 | for (auto it = m_outputs.constBegin(); it != m_outputs.constEnd(); ++it) { | 657 | for (auto it = m_outputs.constBegin(); it != m_outputs.constEnd(); ++it) { | ||
| 656 | (*it)->showCursor(); | 658 | if (!(*it)->showCursor()) { | ||
| 659 | setSoftWareCursor(true); | ||||
| 660 | } | ||||
graesslin: nitpick coding style: whitespace between if and ( | |||||
graesslin: here you had the same coding style error :-) | |||||
| 657 | } | 661 | } | ||
| 658 | } | 662 | } | ||
| 659 | markCursorAsRendered(); | 663 | markCursorAsRendered(); | ||
| 660 | } | 664 | } | ||
| 661 | 665 | | |||
| 662 | void DrmBackend::updateCursor() | 666 | void DrmBackend::updateCursor() | ||
| 663 | { | 667 | { | ||
| 664 | if (usesSoftwareCursor()) { | 668 | if (usesSoftwareCursor()) { | ||
| ▲ Show 20 Lines • Show All 127 Lines • Show Last 20 Lines | |||||
nitpick coding style: whitespace between if and (