Skip to content

Commit

Permalink
Add signal to notify cursor changed for WOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
zccrs committed Jul 25, 2024
1 parent 42ef34f commit 6084410
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/server/kernel/woutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,11 +544,15 @@ WOutputLayout *WOutput::layout() const
void WOutput::addCursor(WCursor *cursor)
{
static_cast<QWlrootsCursor*>(screen()->cursor())->addCursor(cursor);
Q_EMIT cursorAdded(cursor);
Q_EMIT cursorListChanged();
}

void WOutput::removeCursor(WCursor *cursor)
{
static_cast<QWlrootsCursor*>(screen()->cursor())->removeCursor(cursor);
Q_EMIT cursorRemoved(cursor);
Q_EMIT cursorListChanged();
}

const QList<WCursor *> &WOutput::cursorList() const
Expand Down
5 changes: 5 additions & 0 deletions src/server/kernel/woutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include <QQmlEngine>
#include <QImage>

Q_MOC_INCLUDE("wcursor.h")

QT_BEGIN_NAMESPACE
class QScreen;
class QQuickWindow;
Expand Down Expand Up @@ -121,6 +123,9 @@ class WAYLIB_SERVER_EXPORT WOutput : public WWrapObject
void scaleChanged();
void forceSoftwareCursorChanged();
void bufferCommitted();
void cursorAdded(WAYLIB_SERVER_NAMESPACE::WCursor *cursor);
void cursorRemoved(WAYLIB_SERVER_NAMESPACE::WCursor *cursor);
void cursorListChanged();

private:
friend class QWlrootsIntegration;
Expand Down

0 comments on commit 6084410

Please sign in to comment.