Skip to content

Fyne Window Per Screen

Stephen M Houston edited this page Jan 16, 2020 · 5 revisions

Currently we are in the process of moving the creation of fake roots to be a Fyne Window per screen - rather than one Fyne Window that layouts contents per screen.

The design is as follows: Fyne desktop provides a screens provider that is accessible to the UI. The screens provider (in the case of X11 it is in wm, in the case of embedded it is in ui) sets up the ScreenList/Screen structures with relative information such as the number of screens, their size, and their scale. The UI can then request that information and create root windows based off that information. When the wm receives a configure request, it can check if the title of the window ID matches "Fyne Desktop" to determine if it is in fact a root. If it is a root, the wm can determine which screen the root belongs to by comparing the name of screens to the portion of the title that follows "Fyne Desktop". For instance "Fyne DesktopHDMI-A-0" would match with a screen with the name HDMI-A-0. In this manner, the wm can then layout the windows accordingly using the screen information that it has.S

  • When the desktop is created - the screens provider is initialized
  • The UI then sets up root windows based on screen information such as scale
  • A background is placed on every window
  • The widget panel and app bar are placed on the window created for the primary screen
  • The UI sets the title of each root window equal to "Fyne Desktop" + Screen.Name
  • The WM receives configure requests for the root windows when they are shown
  • The WM traverses it's screens comparing window titles to screen names to find out if the window provided to the configure request is a root window.
  • If the WM determines it is a root window - it will layout the window according to the screen geometry and store the window id to a list of root ids.
  • The WM can then use it's list of window ids and screens to keep the layout accurate and avoid traverses to check for matches by knowing which ids are roots.

So the responsibilities of each package are:

  • Screens Provider - Share information about screens with UI and WM
  • UI - Create fyne windows for each screen according to size and scale
  • WM - Layout root fyne windows according to position and size
Clone this wiki locally