plugins/startupfeedback: Don't show bouncing cursor if cursor is invisible

BUG: 482566
This commit is contained in:
Vlad Zahorodnii 2024-05-31 15:15:34 +03:00
parent 2ca81bbe32
commit 40839e3347
3 changed files with 20 additions and 1 deletions

View file

@ -16,6 +16,11 @@ CursorSource::CursorSource(QObject *parent)
{
}
bool CursorSource::isBlank() const
{
return m_size.isEmpty();
}
QSizeF CursorSource::size() const
{
return m_size;

View file

@ -28,6 +28,7 @@ class KWIN_EXPORT CursorSource : public QObject
public:
explicit CursorSource(QObject *parent = nullptr);
bool isBlank() const;
QSizeF size() const;
QPointF hotspot() const;

View file

@ -30,6 +30,8 @@
#include "core/pixelgrid.h"
#include "core/rendertarget.h"
#include "core/renderviewport.h"
#include "cursor.h"
#include "cursorsource.h"
#include "effect/effecthandler.h"
#include "opengl/glutils.h"
@ -268,6 +270,15 @@ void StartupFeedbackEffect::slotMouseChanged(const QPointF &pos, const QPointF &
void StartupFeedbackEffect::gotNewStartup(const QString &id, const QIcon &icon)
{
if (Cursors::self()->isCursorHidden()) {
return;
}
const Cursor *mouse = Cursors::self()->mouse();
if (mouse->source() && mouse->source()->isBlank()) {
return;
}
Startup &startup = m_startups[id];
startup.icon = icon;
@ -285,7 +296,9 @@ void StartupFeedbackEffect::gotNewStartup(const QString &id, const QIcon &icon)
void StartupFeedbackEffect::gotRemoveStartup(const QString &id)
{
m_startups.remove(id);
if (!m_startups.remove(id)) {
return;
}
if (m_startups.isEmpty()) {
m_currentStartup.clear();
stop();