Context types

When you create a context, you must specify a flag in order to define the type of context. The context defines the connection between your application and the underlying windowing system. Depending on the needs of your application, and in some cases, the permissions of your application, there are a number of different context types available.

The following context types are supported:

Flag Description Permission
SCREEN_APPLICATION_CONTEXT

This context type enables a process to create its own windows and to control some of the window properties.

An application cannot modify a window that was created by another application and it cannot send an event outside of its own process space. An application's context is unaware of other top-level windows in the system.

An application context can parent another window, even if the window is created in another context within another processes.

Process ID can be of any type.
SCREEN_WINDOW_MANAGER_CONTEXT

This context type enables a process to modify all windows in the system whenever new application windows are created or destroyed.

The context also receives notifications when an application creates new windows, when existing application windows are destroyed, or when an application tries to change certain window properties.

Process must reflect a user ID of type root in order to successfully create this context.
SCREEN_INPUT_PROVIDER_CONTEXT

This context type enables a process to send an event to any application in the system.

This context does not receive notifications when applications create new windows, when applications destroy existing windows, or when an application attempts to change certain window properties.
Process must reflect a user ID of type root in order to successfully create this context.
SCREEN_POWER_MANAGER_CONTEXT This context type provides access to power management functionality. Process ID can be of any type.