renderer: improve zoom in anims (#11453)
Removes `animations:first_launch_animation` as it's useless now
This commit is contained in:
parent
78c9e2080c
commit
3d4dc19412
6 changed files with 13 additions and 36 deletions
|
|
@ -49,6 +49,8 @@ CMonitor::CMonitor(SP<Aquamarine::IOutput> output_) : m_state(this), m_output(ou
|
|||
static auto PZOOMFACTOR = CConfigValue<Hyprlang::FLOAT>("cursor:zoom_factor");
|
||||
g_pAnimationManager->createAnimation(*PZOOMFACTOR, m_cursorZoom, g_pConfigManager->getAnimationPropertyConfig("zoomFactor"), AVARDAMAGE_NONE);
|
||||
m_cursorZoom->setUpdateCallback([this](auto) { g_pHyprRenderer->damageMonitor(m_self.lock()); });
|
||||
g_pAnimationManager->createAnimation(0.F, m_zoomAnimProgress, g_pConfigManager->getAnimationPropertyConfig("monitorAdded"), AVARDAMAGE_NONE);
|
||||
m_zoomAnimProgress->setUpdateCallback([this](auto) { g_pHyprRenderer->damageMonitor(m_self.lock()); });
|
||||
}
|
||||
|
||||
CMonitor::~CMonitor() {
|
||||
|
|
@ -61,6 +63,8 @@ void CMonitor::onConnect(bool noRule) {
|
|||
EMIT_HOOK_EVENT("preMonitorAdded", m_self.lock());
|
||||
CScopeGuard x = {[]() { g_pCompositor->arrangeMonitors(); }};
|
||||
|
||||
m_zoomAnimProgress->setValueAndWarp(0.F);
|
||||
|
||||
g_pEventLoopManager->doLater([] { g_pConfigManager->ensurePersistentWorkspacesPresent(); });
|
||||
|
||||
m_listeners.frame = m_output->events.frame.listen([this] {
|
||||
|
|
@ -89,6 +93,9 @@ void CMonitor::onConnect(bool noRule) {
|
|||
else
|
||||
PROTO::presentation->onPresented(m_self.lock(), Time::fromTimespec(event.when), event.refresh, event.seq, event.flags);
|
||||
|
||||
if (m_zoomAnimProgress->goal() == 0.F)
|
||||
*m_zoomAnimProgress = 1.F;
|
||||
|
||||
m_frameScheduler->onPresented();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue