Skip to content

Change setModified to destructively overwrite target in OpenDisplayAction#3720

Open
vincent-hve wants to merge 1 commit intoControlSystemStudio:masterfrom
High-Voltage-Engineering:vvb-open_display_target_fix
Open

Change setModified to destructively overwrite target in OpenDisplayAction#3720
vincent-hve wants to merge 1 commit intoControlSystemStudio:masterfrom
High-Voltage-Engineering:vvb-open_display_target_fix

Conversation

@vincent-hve
Copy link
Contributor

@vincent-hve vincent-hve commented Mar 2, 2026

Middle or control click on a widget supporting Actions, changed the target field permanently in the associated OpenDisplayAction, causing this operation to be executed henceforth, even without the modifier keys, or middle mouse button.

This PR fixes that, such that the target is only active for as long as the modifier is set.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 2, 2026

@vincent-hve vincent-hve marked this pull request as ready for review March 3, 2026 09:02
@georgweiss
Copy link
Collaborator

@vincent-hve, need to admit I do not quite understand the use case this PR fixes. Can you please clarify the workflow, and also attach a bob file?

@vincent-hve
Copy link
Contributor Author

vincent-hve commented Mar 3, 2026

Its not a bob-file specific issue. Any OpenDisplayAction has a default target, normally this is TAB. Thus click on an ActionButton with an OpenDisplayAction (or other widget with an action) will open the bob file in a new tab.

However, additionally the OpenDisplayAction supports pressing middle mouse button (or left + ctrl) to open the bob file in a new window instead of a new tab.

This behavior was previously implemented by permanently changing the target field in the OpenDisplayAction, when processing the modifiers (e.g. ctrl or middle mouse instead of left mouse). Any subsequent clicks without modifiers on the ActionButton would still open the bob file in a new window, instead of a new tab as would be expected.

This unexpected behavior is fixed in this PR by adding an addition override target field, which is only used when the modifier is active, and keeping the original target field as-is.

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.

2 participants