Skip to content

Commit

Permalink
Fix undo/redo handling in PopupComponent to respect acquisition statu…
Browse files Browse the repository at this point in the history
…s and signal chain lock
  • Loading branch information
anjaldoshi committed Dec 20, 2024
1 parent 40ea1af commit 4d666c6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Source/UI/PopupComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/

#include "PopupComponent.h"
#include "EditorViewport.h"
#include "UIComponent.h"

#include "../CoreServices.h"
Expand Down Expand Up @@ -89,6 +90,13 @@ bool PopupComponent::keyPressed (const KeyPress& key)
return false;
}

if (CoreServices::getAcquisitionStatus()
&& undoManager->getUndoDescription().contains ("Disabled during acquisition"))
return false;

if (AccessClass::getEditorViewport()->isSignalChainLocked())
return false;

undoManager->undo();

if (parent != nullptr)
Expand All @@ -109,6 +117,13 @@ bool PopupComponent::keyPressed (const KeyPress& key)
return false;
}

if (CoreServices::getAcquisitionStatus()
&& undoManager->getRedoDescription().contains ("Disabled during acquisition"))
return false;

if (AccessClass::getEditorViewport()->isSignalChainLocked())
return false;

undoManager->redo();

if (parent != nullptr)
Expand Down

0 comments on commit 4d666c6

Please sign in to comment.