effecst: disable launch feedback effect if cursor is hidden

Gets annoying with touch
This commit is contained in:
Xaver Hugl 2022-01-19 13:15:03 +01:00
parent 2c6821fdca
commit 5b86afa6f0
4 changed files with 15 additions and 1 deletions

View file

@ -1717,6 +1717,11 @@ void EffectsHandlerImpl::renderScreen(EffectScreen *screen)
scene()->paintScreen(output, Compositor::self()->windowsToRender());
}
bool EffectsHandlerImpl::isCursorHidden() const
{
return Cursors::self()->isCursorHidden();
}
//****************************************
// EffectScreenImpl
//****************************************

View file

@ -264,6 +264,7 @@ public:
EffectScreen *findScreen(const QString &name) const override;
EffectScreen *findScreen(int screenId) const override;
void renderScreen(EffectScreen *screen) override;
bool isCursorHidden() const override;
public Q_SLOTS:
void slotCurrentTabAboutToChange(EffectWindow* from, EffectWindow* to);

View file

@ -175,6 +175,9 @@ void StartupFeedbackEffect::prePaintScreen(ScreenPrePaintData& data, std::chrono
}
m_lastPresentTime = presentTime;
if (m_active && effects->isCursorHidden()) {
stop();
}
if (m_active) {
// need the unclipped version
switch(m_type) {
@ -289,7 +292,7 @@ void StartupFeedbackEffect::gotStartupChange(const QString &id, const QIcon &ico
void StartupFeedbackEffect::start(const QIcon &icon)
{
if (m_type == NoFeedback || m_splashVisible)
if (m_type == NoFeedback || m_splashVisible || effects->isCursorHidden())
return;
if (!m_active)
effects->startMousePolling();

View file

@ -1262,6 +1262,11 @@ public:
*/
virtual void showCursor() = 0;
/**
* @returns Whether or not the cursor is currently hidden
*/
virtual bool isCursorHidden() const = 0;
/**
* Starts an interactive window selection process.
*