Live resize of platform windows

A new, experimental feature is available in the OpenFin Platform API, starting in v25. Live resizing of platform windows: The ability for the end-user to resize a platform window while the window continues to update its content.

Overview

Live resizing is relatively common on desktop computers today. A typical web browser continuously updates its content while its window is resized. Live resize is useful when adjusting the window sizes of, for example, a web browser, Microsoft Outlook, and Microsoft Excel, to optimize your screen for a specific task.

Live resizing is experimental

Live resizing is a computationally intensive and memory-heavy process for the OpenFin Runtime. While a web browser only has to do live resizing on the currently active tab, OpenFin Runtime continuously renders all views in a platform window while the window changes size. To do this smoothly on an average or lower-end computer is a challenge.

For this reason, you must explicitly enable the live resize feature. By default, it is disabled, and windows do not redraw their contents until the resizing operation is finished.

Factors that affect performance of live resizing

Performance of live resizing has many variables. When the variables are tuned carefully, users will have a smooth experience when resizing a platform window. When the variables are tuned poorly, users will have a slow moving, stuttering experience which many may find frustrating.

What variables can be tuned?

Reduce the number of views

The largest burden on the render process is the number of views in the window. Each view must be rendered every time the window changes size by as little as one pixel. Multiply that by a large number of views, and that can be too much for medium to lower-end hardware to keep up.

By reducing the number of views in the window being resized, the user will have a smoother experience in resizing their windows.

Use process affinity on view objects

By default, each render process is a single-threaded process. If numerous views share a single render process, even CPUs with a large number of cores can struggle to render views at an adequate speed. By using different processAffinity values for each view, each view will be rendered with a different CPU core, making the resize process smoother.

Alternatively, the viewProcessAffinityStrategyin PlatformOptions allows you to change the default thread assignment for views. By changing the viewProcessAffinityStrategy property, from the default of 'same' to 'different', each view will be given its own process affinity, spreading the rendering workload more evenly across the CPU cores.

More details on process affinity strategies can be found at Process affinity in Container overview, PlatformOptions, and ProcessAffinityStrategy.

Complexity of responsive design

The more complex the responsive design of your views, the more CPU and memory that will be required to render the view at an acceptable rate. Complex React interfaces, large tables or grids, numerous large resizable images, and similar factors can all place a burden on the render process. Reducing the complexity of the responsive design in your views can smooth out the user experience of live resizing.

Available memory

If there is not enough available memory to resize the views in a window, the consequence can be a poor, stuttering experience for your users. Reducing the use of programs that use large amounts of memory can free up OpenFin to perform smoother live resize actions. And adding more RAM to the computer can also improve live resize performance.

Virtual machines

Virtualizing a computer display is computationally intensive, and can significantly reduce display performance. If you must keep your OpenFin platform in a virtual machine, it may be beneficial to increase the available memory, available video memory, or increase the number of CPUs available to the virtual machine. Additionally, you can improve performance by enabling the 2D acceleration feature of your virtual machine and reducing the use of programs that use large amounts of memory within the virtual machine.

Computer hardware

Fast CPUs and performant graphics cards can significantly increase display speed, though they do come at a budgetary cost.

Windows 10 performance settings

The Windows OS has its set of options that can be used to change the appearance and performance of all your applications windows on that machine. To find these settings search for "Adjust the appearance and performance of windows" in the search box on the windows start bar and select the relevant search result. One option in particular that could stop you from seeing the view and window contents while resizing is the "Show window contents while dragging" option. Make sure this is ticked and apply the option.

How to enable live resize

Live resize is enabled by using the experimental window option, showViewsOnResize. Here is an example of how to enable the live resize feature platform-wide:

{
  "platform": {
  ...
  "defaultWindowOptions": {
    "experimental": {
      "showViewsOnResize": {
        "enabled": true,
        "delayMs": 0 // optional property (this delay helps tweak for non-performant layouts)
      }
    }
  }
  ...
}

Did this page help you?