function parseSurfaceLine (line) {
  // the surface bounds are in the format:
  // "rect=(0.0,1184.0) 768.0 x 96.0"
  //       ^ location   ^ size
  // cut out the stuff before the 'rect' and then split the numbers apart
  let bounds = line.split('rect=')[1]
  .replace(/[\(\), x]+/g, ' ')
  .trim()
  .split(' ');

  return {
    visible: (line.indexOf('shown=true') !== -1),
    x: parseFloat(bounds[0]),
    y: parseFloat(bounds[1]),
    width: parseFloat(bounds[2]),
    height: parseFloat(bounds[3])
  };
}
/**
 * Parses the given window manager Surface string to get info.
 * @param line: To parse. This is assumed to be valid.
 * @return: Visibility and bounds of the Surface.
 */
Parses the given window manager Surface string to get info.
@param line: To parse. This is assumed to be valid.
@return: Visibility and bounds of the Surface.
Parses the given window manager Surface string to get info . @param line : To parse . This is assumed to be valid . @return : Visibility and bounds of the Surface .
function parseSurfaceLine (line) {
  let bounds = line.split('rect=')[1]
  .replace(/[\(\), x]+/g, ' ')
  .trim()
  .split(' ');
  return {
    visible: (line.indexOf('shown=true') !== -1),
    x: parseFloat(bounds[0]),
    y: parseFloat(bounds[1]),
    width: parseFloat(bounds[2]),
    height: parseFloat(bounds[3])
  };
}
function parseSurfaceLine ( line ) { let bounds = line . split ( 'rect=' ) [ 1 ] . replace ( / [\(\), x]+ / g , ' ' ) . trim ( ) . split ( ' ' ) ; return { visible : ( line . indexOf ( 'shown=true' ) !== - 1 ) , x : parseFloat ( bounds [ 0 ] ) , y : parseFloat ( bounds [ 1 ] ) , width : parseFloat ( bounds [ 2 ] ) , height : parseFloat ( bounds [ 3 ] ) } ; }
Parses the given window manager Surface string to get info.
Parses the given window manager Surface string to get info .
// the surface bounds are in the format: // "rect=(0.0,1184.0) 768.0 x 96.0" //       ^ location   ^ size // cut out the stuff before the 'rect' and then split the numbers apart