Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/drm_backend.cpp
Show First 20 Lines • Show All 672 Lines • ▼ Show 20 Line(s) | 666 | { | |||
---|---|---|---|---|---|
673 | } | 673 | } | ||
674 | markCursorAsRendered(); | 674 | markCursorAsRendered(); | ||
675 | } | 675 | } | ||
676 | 676 | | |||
677 | void DrmBackend::updateCursor() | 677 | void DrmBackend::updateCursor() | ||
678 | { | 678 | { | ||
679 | if (usesSoftwareCursor()) { | 679 | if (usesSoftwareCursor()) { | ||
680 | return; | 680 | return; | ||
681 | } | 681 | } | ||
davidedmundson: I don't think that's the layer as the software cursor should work on all platforms.
We should… | |||||
davidedmundson: *that's the right layer | |||||
682 | if (isCursorHidden()) { | 682 | if (isCursorHidden()) { | ||
683 | return; | 683 | return; | ||
684 | } | 684 | } | ||
685 | const QImage &cursorImage = softwareCursor(); | 685 | const QImage &cursorImage = softwareCursor(); | ||
686 | if (cursorImage.isNull()) { | 686 | if (cursorImage.isNull()) { | ||
687 | doHideCursor(); | 687 | doHideCursor(); | ||
688 | return; | 688 | return; | ||
689 | } | 689 | } | ||
690 | for (auto it = m_outputs.constBegin(); it != m_outputs.constEnd(); ++it) { | 690 | for (auto it = m_outputs.constBegin(); it != m_outputs.constEnd(); ++it) { | ||
691 | (*it)->updateCursor(); | 691 | (*it)->updateCursor(); | ||
692 | } | 692 | } | ||
693 | 693 | | |||
694 | setCursor(); | 694 | setCursor(); | ||
695 | moveCursor(); | 695 | moveCursor(); | ||
696 | } | 696 | } | ||
697 | 697 | | |||
698 | void DrmBackend::doShowCursor() | 698 | void DrmBackend::doShowCursor() | ||
699 | { | 699 | { | ||
700 | updateCursor(); | 700 | updateCursor(); | ||
701 | } | 701 | } | ||
702 | 702 | | |||
703 | void DrmBackend::doHideCursor() | 703 | void DrmBackend::doHideCursor() | ||
704 | { | 704 | { | ||
705 | if (!m_cursorEnabled) { | 705 | if (!m_cursorEnabled || usesSoftwareCursor()) { | ||
706 | return; | 706 | return; | ||
707 | } | 707 | } | ||
708 | for (auto it = m_outputs.constBegin(); it != m_outputs.constEnd(); ++it) { | 708 | for (auto it = m_outputs.constBegin(); it != m_outputs.constEnd(); ++it) { | ||
709 | (*it)->hideCursor(); | 709 | (*it)->hideCursor(); | ||
710 | } | 710 | } | ||
711 | } | 711 | } | ||
712 | 712 | | |||
713 | void DrmBackend::moveCursor() | 713 | void DrmBackend::moveCursor() | ||
714 | { | 714 | { | ||
715 | if (!m_cursorEnabled || isCursorHidden()) { | 715 | if (!m_cursorEnabled || isCursorHidden() || usesSoftwareCursor()) { | ||
716 | return; | 716 | return; | ||
717 | } | 717 | } | ||
718 | for (auto it = m_outputs.constBegin(); it != m_outputs.constEnd(); ++it) { | 718 | for (auto it = m_outputs.constBegin(); it != m_outputs.constEnd(); ++it) { | ||
719 | (*it)->moveCursor(Cursor::pos()); | 719 | (*it)->moveCursor(Cursor::pos()); | ||
720 | } | 720 | } | ||
721 | } | 721 | } | ||
722 | 722 | | |||
723 | Screens *DrmBackend::createScreens(QObject *parent) | 723 | Screens *DrmBackend::createScreens(QObject *parent) | ||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |
I don't think that's the layer as the software cursor should work on all platforms.
We should be able to update the software cursor in
Platform::showCursor Platform::hideCursor