Controlling the Desktop size with Thinfinity® VirtualUI

As already discussed in a previous post, one of Thinfinity VirtualUI’s features is that the desktop application doesn’t need to be limited to a fixed or predetermined size. So, each application can be set to determine its desktop size according its needs, or be left to be dynamic in nature.

The image below shows an application configuration panel (available from the Thinfinity VirtualUI Server manager). In this panel we can see the Resolution attribute, which is set, in this case to “Fit to browser window”, its default value.

Control Desktop size with VirtualUI

The available values for Resolution are the following: “Fit to browser window” (that adjust the desktop size to the browser window size), “Fit to screen” (adjust the desktop size to the device’s screen size), and a list of possible predefined fixed values, ranging from 640 x 480 pixels to 1920 x 1200 pixels.

Both “Fit to browser window” and “Fit to screen” values are clearly dynamic, while all the remaining sizes are fixed. In desktop browsers when the defined desktop size is fixed and it does not fit within the available browser window, scroll bars will appear. In the case of mobile devices, the desktop will be automatically scaled to adjust it into the available screen canvas. However, in none of these cases the contents of the desktop (ie, all application windows) may exceed this field, and the excess will be hidden such as in the normal Windows desktop.

 

An in-depth look: the OnBrowserResize event

The VirtualUI.OnBrowserResize event, available in the application side, will receive any change occurring in the browser size. This would allow us to adapt the window layout as needed  (i.e. change sizes, hide, show or move elements or any other adjust what we want, depending on the received width and height values).

Below, a Delphi example:

procedure TForm9.FormCreate(Sender: TObject);
begin
   ...
   VirtualUI.OnBrowserResize := AdjustWindowSize;
   ...
end;

procedure TMainForm.AdjustWindowSize(Sender: TObject; var Width, Height: Integer;
   var ResizeMaximized: Boolean);
   var borderwidth : Integer;
begin
   if WindowState = TWindowState.wsMaximized then
      borderwidth := 16
   else
      borderwidth := 0;
   Width := Self.Width - borderwidth;
   Height := Self.Height - borderwidth;
end;

 

One thought on “Controlling the Desktop size with Thinfinity® VirtualUI

  1. Why -in this example- are you modifiying the received browser size? Are you changing the browser size from the delphi app? Isn’t it the delphi form size (self.width) the one that need to be adjusted to the browser size, and not the opposite?

Leave a Reply

Your email address will not be published. Required fields are marked *