WindowManager
The Windomw manager module handles wayland graphics application windows.
Members
onWindowManagerEvent
Signal fired whenever the WindowManager sends an event. The listener will be passed the following arguments:
- event: The Event that triggered the Signal.
- name: The Name of the application.
- arg: (Optional) The event argument.
StatusFlags
Enum for WindowManager status flags.
Properties:
| Name | Type | Description |
|---|---|---|
APP_VISIBLE | The window is visible. | |
APP_FOCUS | The window has focus. | |
APP_PENDING | No window associated yet. | |
APP_RUNNING | The app has a window available. | |
APP_TRANSPARENT | Internal use only. |
WindowManagerEvent
Enum for WidnowManager Events.
Properties:
| Name | Type | Description |
|---|---|---|
APP_READY | An application has created a window. | |
APP_TIMEOUT | No window created within the timeout period. | |
APP_FINISHED | An application has closed its window. |
Methods
apps(len)
Return a list of the known (configured) applications.
Parameters:
| Name | Type | Description |
|---|---|---|
len | Number | The length of the array (the number of applications it can store). If the argument is not passed, it returns all the results. |
Returns:
| Type | Description |
|---|---|
| A promise. | The completion handler will be passed the following arguments: - AppInfo: An Object of type AppInfo. |
apps(len)
Return a list of the known (configured) applications.
Parameters:
| Name | Type | Description |
|---|---|---|
len | Number | The length of the array (the number of applications it can store). If the argument is not passed, it returns all the results. |
Returns:
| Type | Description |
|---|---|
| A promise. | The completion handler will be passed the following arguments: - AppInfo: An Object of type AppInfo. |
back(name)
Move an applications window to the back. This changes the render order so that the application in questions window is rendered behind all the others.
Parameters:
| Name | Type | Description |
|---|---|---|
| name | String | The name of the application. |
Returns:
| Type | Description |
|---|---|
| A promise. | No arguments are passed to the completion handler. |
destination(name, x, y, width, height)
Change both position and size of the window.
Parameters:
| Name | Type | Description |
|---|---|---|
| name | String | The name of the application to change. |
| x | Number | The new x coordinate. |
| y | Number | The new y coordinate. |
| width | Number | The new width. |
| height | Number | The new height. |
Returns:
| Type | Description |
|---|---|
| A promise. | No arguments are passed to the completion handler. |
focus(name, focus)
Assign input focus to, or remove input focus from a window.
Parameters:
| Name | Type | Description |
|---|---|---|
| name | String | The name of the application. |
| focus | Boolean | If true assign focus otherwise remove it. |
Returns:
| Type | Description |
|---|---|
| A promise. | No arguments are passed to the completion handler. |
front(name)
Move an applications window to the front. This changes the render order so that the application in question window is rendered in front of all the others.
Parameters:
| Name | Type | Description |
|---|---|---|
| name | String | The name of the application. |
Returns:
| Type | Description |
|---|---|
| A promise. | No arguments are passed to the completion handler. |
fullscreen(name, full)
Make a window fullscreen or restore to previous size.
Parameters:
| Name | Type | Description |
|---|---|---|
| name | String | The name of the application. |
| full | Boolean | If true make fullscreen otherwise restore to previous size. |
Returns:
| Type | Description |
|---|---|
| A promise. | No arguments are passed to the completion handler. |
getInfo(name, info)
Return information on the given application.
Parameters:
| Name | Type | Description |
|---|---|---|
| name | The name of the application. | |
| info | SoliwmApp structure with the information. |
Returns:
| Type | Description |
|---|---|
| A promise. | The completion handler will be passed the following arguments: - AppInfo: An Object of type AppInfo. |
kill(name)
Terminate the named application. This sends the SIGHUP signal to the PID that created the window.
Parameters:
| Name | Type | Description |
|---|---|---|
| name | String | The name of the application. |
Returns:
| Type | Description |
|---|---|
| A promise. | No arguments are passed to the completion handler. |
move(name, x, y)
Move a window.
Parameters:
| Name | Type | Description |
|---|---|---|
| name | String | The name of the application to move. |
| x | Number | The new x coordinate. |
| y | Number | The new y coordinate. |
Returns:
| Type | Description |
|---|---|
| A promise. | No arguments are passed to the completion handler. |
pending(len)
Return a list of the pending applications. These are the applications that have been started, but are yet to create a window.
Parameters:
| Name | Type | Description |
|---|---|---|
| len | Number | The length of the array (the number of applications it can store). If the argument is not passed, it returns all the results. |
Returns:
| Type | Description |
|---|---|
| A promise. | The completion handler will be passed the following arguments: - AppInfo: An Object of type AppInfo. |
resize(name, width, height)
Resize a window.
Parameters:
| Name | Type | Description |
|---|---|---|
| name | String | The name of the application to move. |
| width | Number | The new width. |
| height | Number | The new height. |
Returns:
| Type | Description |
|---|---|
| A promise. | No arguments are passed to the completion handler. |
running(len)
Return a list of the running applications.
Parameters:
| Name | Type | Description |
|---|---|---|
| len | Number | The length of the array (the number of applications it can store). If the argument is not passed, it returns all the results. |
Returns:
| Type | Description |
|---|---|
| A promise. | The completion handler will be passed the following arguments: - AppInfo: An Object of type AppInfo. |
show(name, show)
Show or hide a window.
Parameters:
| Name | Type | Description |
|---|---|---|
| name | String | The name of the application. |
| show | Boolean | If true show the window otherwise hide it. |
Returns:
| Type | Description |
|---|---|
| A promise. | No arguments are passed to the completion handler. |
start(name, alias)
Start the named application and assign it the give alias. The supplied name must be one defined by one of the application configuration files. Once started you can refer to it in other commands using the alias. The alias must not be used by any other running application.
Parameters:
| Name | Type | Description |
|---|---|---|
| name | String | The name of the application to start as defined by the config files. |
| alias | String | The name it will be known by in future API calls. |
Returns:
| Type | Description |
|---|---|
| A promise. | No arguments are passed to the completion handler. |
startNew(alias, exec, args)
Start a new (unconfigured) application. It is also possible to start an application that hasn't been defined in a configuration file. You have to supply the executable location and the arguments to pass to it.
Parameters:
| Name | Type | Description |
|---|---|---|
| alias | String | The name to use in other API calls (must be unique). |
| exec | String | The location of the binary. |
| args | String | The argument string to pas to the application. |
Returns:
| Type | Description |
|---|---|
| A promise. | No arguments are passed to the completion handler. |
Type Definitions
AppInfo
Description for an Application Info. SolidWM representation of an application. This is the structure used in all API calls that return information about an application or a list of applications.
Properties:
| Name | Type | Description |
|---|---|---|
| name | String | The name or alias of the application. |
| exec | String | The location of the application binary. |
| args | String | The argument string passed to the application. |
| surface_id | Number | The wayland surface identifier of the window. |
| pid | Number | The ID of the process that created the window. |
| x_pos | Number | The X coordinate of the window. |
| y_pos | Number | The Y coordinate of the window. |
| width | Number | The width of the window. |
| height | Number | The height of the window. |
| flags | Number | Flags, visibility, focus, running etc. |