Skip to content

Commit

Permalink
Set command lock to false when canvas is constructed. Only a canvas u…
Browse files Browse the repository at this point in the history
…pdates the pd->commandLocked value, and previous canvas could have set it true (eg: if the canvas was closed with ctrl-w, then the last state of command is true)
  • Loading branch information
alcomposer committed Dec 5, 2024
1 parent 4ced7ea commit cc844a2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Source/Canvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,13 @@ Canvas::Canvas(PluginEditor* parent, pd::Patch::Ptr p, Component* parentGraph)
commandLocked.referTo(pd->commandLocked);
commandLocked.addListener(this);

// pd->commandLocked doesn't get updated when a canvas isn't active
// So we set it to false here when a canvas is remade
// Otherwise the last canvas could have set it true, and it would still be
// in that state without command actually being locked
if (!isGraph)
commandLocked.setValue(false);

// init border for testing
settingsChanged("border", SettingsFile::getInstance()->getPropertyAsValue("border"));

Expand Down

0 comments on commit cc844a2

Please sign in to comment.