Skip to main content

Module paint_guard

Module paint_guard 

Source
Expand description

The main window’s paint guard: a window never stays empty without a word.

Experimental: may change in any release (docs/stability.md).

Two holes are watched at the end of each pass of the main window:

  • The focus screen without its page. A wizard run as a focus screen hides the shell (menus, status bar, centre) under its page; the page is drawn by the Settings app’s block. When the wizard is stored and no page was drawn in the pass (the Settings closed under it, its block replaced, its overlay not held), the shell is drawn again from the next pass on, a warning says so once, and window.focus_hole is published.
  • A window that painted nothing. When the shell added nothing but backgrounds and lines under the title bar (no text, no image, no overlay held; without a shell, in the whole pass: a window whose decorations did not draw either, as in zen mode or under a window’s content moved into the main window) for longer than a delay (DEFAULT_DELAY), an error says once what holds the screen (the place stack, the Settings app and its wizard, the overlays, the layout’s areas), window.painted_nothing is published, and a fallback page offers to reset the arrangement and to go back to the first place. The page leaves as soon as the shell paints again.

The cost is a counter and a scan of the pass’s shapes that stops at the first text or image (the menu bar’s, in a healthy window).

Constants§

DEFAULT_DELAY
How long the main window may paint nothing before the fallback page.