getActiveWindowIds method

Future<List<int>> getActiveWindowIds()

Queries the native layer for IDs of currently active windows.

A window is active when it is registered and NOT hidden for reuse (i.e. it is visible, not reuse-enabled, or in the process of being shown after a claim).

Implementation

Future<List<int>> getActiveWindowIds() async {
  return (await _channel.invokeMethod<List<dynamic>>('getActiveWindowIds'))
          ?.cast<int>() ??
      [];
}