fix: animate emotes when overlay is open (#5659)
This commit is contained in:
@@ -26,6 +26,7 @@ void GIFTimer::initialize()
|
||||
|
||||
QObject::connect(&this->timer, &QTimer::timeout, [this] {
|
||||
if (getSettings()->animationsWhenFocused &&
|
||||
this->openOverlayWindows_ == 0 &&
|
||||
QApplication::activeWindow() == nullptr)
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -18,9 +18,21 @@ public:
|
||||
return this->position_;
|
||||
}
|
||||
|
||||
void registerOpenOverlayWindow()
|
||||
{
|
||||
this->openOverlayWindows_++;
|
||||
}
|
||||
|
||||
void unregisterOpenOverlayWindow()
|
||||
{
|
||||
assert(this->openOverlayWindows_ >= 1);
|
||||
this->openOverlayWindows_--;
|
||||
}
|
||||
|
||||
private:
|
||||
QTimer timer;
|
||||
long unsigned position_{};
|
||||
size_t openOverlayWindows_ = 0;
|
||||
};
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "common/FlagsEnum.hpp"
|
||||
#include "common/Literals.hpp"
|
||||
#include "controllers/hotkeys/HotkeyController.hpp"
|
||||
#include "singletons/Emotes.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "singletons/WindowManager.hpp"
|
||||
#include "widgets/BaseWidget.hpp"
|
||||
@@ -166,6 +167,7 @@ OverlayWindow::OverlayWindow(IndirectChannel channel,
|
||||
|
||||
this->addShortcuts();
|
||||
this->triggerFirstActivation();
|
||||
getApp()->getEmotes()->getGIFTimer().registerOpenOverlayWindow();
|
||||
}
|
||||
|
||||
OverlayWindow::~OverlayWindow()
|
||||
@@ -173,6 +175,7 @@ OverlayWindow::~OverlayWindow()
|
||||
#ifdef Q_OS_WIN
|
||||
::DestroyCursor(this->sizeAllCursor_);
|
||||
#endif
|
||||
getApp()->getEmotes()->getGIFTimer().unregisterOpenOverlayWindow();
|
||||
}
|
||||
|
||||
void OverlayWindow::applyTheme()
|
||||
|
||||
Reference in New Issue
Block a user