This ArcOS wiki is still under active development, and contains errors and unfinished pages.

Window states

An ArcOS window has several different states, these are modes the window can apply to represent it in different ways. These states are available:

  • Minimized — Is this window hidden (minimized)?

  • Maximized — Is this window maximized?

  • Resizable — Can the user resize the window?

  • Headless — Does the window have no titlebar?

  • Fullscreen — Is the window fullscreen?

If you recall, these states are also documented here (point 6) because you're asked about window states in the CLI's app creation wizard. The states have default values that you can set by modifying properties of the state object in your _app.tpa file.

Alright, how do I change them programmatically?

You can't change the Resizable and Headless states dynamically, these will have to be decided upon before your app starts. Other than that, the methods for changing states are part of the App Renderer, so you'll have to manually invoke them from there. The snippets below are from inside your app's main process, here they are:

Toggle the maximized state

this.handler.renderer?.toggleMaximize(this.pid);

Toggle the minimized state

this.handler.renderer?.toggleMinimize(this.pid);

Toggle the fullscreen state

this.handler.renderer?.toggleFullscreen(this.pid);

Window snapping

An ArcOS window can also be snapped to different corners or sides of the screen: top, bottom, left, right, top-left, top-right, bottom-left, bottom-right. These can be set programmatically too by calling AppRenderer.snapWindow:

this.handler.renderer?.snapWindow(this.pid, "top-left");

The first argument is the PID, and the second is the variant, which is one of the 8 options I listed earlier.

Last updated