Skip to content

Implement the 'standalone' window mode#3859

Open
rjwills28 wants to merge 12 commits into
ControlSystemStudio:masterfrom
rjwills28:add_standalone_windows
Open

Implement the 'standalone' window mode#3859
rjwills28 wants to merge 12 commits into
ControlSystemStudio:masterfrom
rjwills28:add_standalone_windows

Conversation

@rjwills28

Copy link
Copy Markdown
Contributor

The main purpose of this PR is to add back in the standalone window implementation that existed in CS-Studio. See Issue #3543 for a full description of our motivations.

A standalone window is essentially a window with no toolbars or tabs and so just displays the BOB screen (again, see above issue for an example screen).

A summary of what has been done in this PR:

  • Configure a standalone window:
    • No toolbars or tabs:
      • Remove right click menu option to show toolbars
    • All applications launched from a standalone window will open up in the 'main' Phoebus window (including the editor). Focus will also shift to the main window.
  • Allow displays to be opened in a standalone window from an 'Open Display' action:
    • Additional option added.
    • Standalone windows are sized as close to their display dimensions (i.e. width x height from BOB file) as possible and need less padding than the 'original windows' as we do not need to allow room for toolbars, tabs etc.
  • If a standalone window contains an action to open a display in the 'replace' mode, then the standalone window is resized to the new display dimensions.
  • Configure the memento to save the standalone window mode
  • Launch a window in standalone mode from the terminal:
    • These windows will open with the correct width & height specified from the BOB file (if no dimensions are given from the command line).

All of these changes only apply to standalone windows meaning that the original 'New Window' implementation has not been touched and still functions as it did before. These changes will be transparent to users unless they change their actions to open in the standalone mode or use the command line argument to launch them.

We have been actively testing this implementation at Diamond and so have ironed out most of the issues with behaviour.

Note: some of the resizing of windows can be done in a cleaner way once Phoebus has moved to JFX25. This is because there is a bug in older versions of JFX that mean that any sizing of the stage before it is 'shown' (i.e. stage.show()) are not applied (see #3436). This means that currently we have to do all of our resizing after stage.show(), which can cause some flickering of screens when they first launch as they pop up at one size and then very quickly get resized. I have a fix for this but propose postpone implementing that until the basic standalone window implementation has been agreed and Phoebus moves to JFX25.

I appreciate that this is a reasonably big PR but most of the commits should be fairly self contained with a descriptive message. Please let me know if you have any questions/feedback.

I anticipate a few Sonarcloud issues so I will address those asap.

Checklist

  • Testing:

    • The feature has automated tests
    • Tests were run
    • If not, explain how you tested your changes
  • Documentation:

    • The feature is documented
    • The documentation is up to date
    • Release notes:
      • Added an entry if the change is breaking or significant
      • Added an entry when adding a new feature

rjwills28 added 12 commits June 16, 2026 14:19
Standalone windows are configured to have no tabs or toolbar showing.
Panes are configured not to change with the global settings to show/hide
toolbar/tabs.
and also when including the window size and layout.
when launching from a standalone window. As opposed to opening in
the last active window.
Allows the active pane to be set to either the current window or
main Phoebus window before opening the editor.
…ntext menu action

Only context menu items that open new displays should set the focus. Other
items such as copy PV will not.
… standalone

In this case the active pane should be set as the main window so that applications
open there instead of in place of the standaloene.
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
4.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

setFocus = () -> DockPane.setActiveDockPane(dockPane);
if (dockPane.isStandaloneWindow()) {
// If in a standalone window, set the active dock pane
// to be the 'main' Phoebus pain instead of the current dock pane

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Freudian slip :)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an abbreviation: Main pane -> pain

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, yes my bad - I'll fix that ;)

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.

3 participants