Change setModified to destructively overwrite target in OpenDisplayAction#3720
Conversation
|
|
@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? |
|
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. |



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.