Skip to content

Conversation

@abrahamwolk
Copy link
Collaborator

@abrahamwolk abrahamwolk commented Dec 1, 2025

In a7e5d4c (part of #3475), the @Override method EmbeddedDisplayWidget.getEffectiveMacros() was removed in order to remove the LCID macro.

A side-effect of this was that no new instance of Macros was created when calling the function EmbeddedDisplayWidget.getEffectiveMacros(). This in turn leads to the firePropertyChange()-functionality stopping to work properly, since it contains the optimization that listeners should not be updated if the new value is equal() to the old value:

// Any change at all?
if (new_value != null && old_value != null && !forceNotify && new_value.equals(old_value))
return;

A concrete example to illustrate the problem is the following: consider an OPI A.bob that contains (1) an embedded display Widget of the name "EmbeddedDisplay" and (2) a script of the following form:

embeddedDisplayWidget = ScriptUtil.findWidgetByName(widget, "EmbeddedDisplay")
macros = embeddedDisplayWidget.getEffectiveMacros()
macros.add("NewMacro", "This is a new macro binding")
embeddedDisplayWidget.propMacros().setValue(macros)

This pull request reinstates the creation of a new instance of Macros when calling EmbeddedDisplayWidget.getEffectiveMacros(), which leads to firePropertyChange() notifying the embedded display of the change.

I am not sure if this is the best way to fix the issue, or not. It does seem to me, however, that calling embeddedDisplayWidget.propMacros().setValue(macros) with a valid argument should correctly update the embedded display.

I have tested the change manually.

@shroffk shroffk merged commit cb3b6f3 into master Dec 3, 2025
3 checks passed
@abrahamwolk abrahamwolk deleted the CSSTUDIO-3597 branch December 4, 2025 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants