diff --git a/app/LayoutDriver/Xrandr.php b/app/LayoutDriver/Xrandr.php index 8443d72..9157a12 100644 --- a/app/LayoutDriver/Xrandr.php +++ b/app/LayoutDriver/Xrandr.php @@ -5,26 +5,26 @@ declare(strict_types=1); namespace App\LayoutDriver; /** - * Interface to xrandr for configuring outputs + * Interface to xrandr for configuring outputs. * * @author Adam Pippin */ class Xrandr implements \App\ILayoutDriver { /** - * The xrandr command + * The xrandr command. * @var \App\System\Command\Xrandr */ protected $_xrandr; /** - * Cache of current display parameters + * Cache of current display parameters. * @var array */ protected $_displays; /** - * Create a new xrandr driver + * Create a new xrandr driver. * * @param \App\System\Command\Xrandr $xrandr_cmd */ @@ -34,7 +34,7 @@ class Xrandr implements \App\ILayoutDriver } /** - * Read display parameters from xrandr + * Read display parameters from xrandr. * * @return void */ @@ -48,10 +48,10 @@ class Xrandr implements \App\ILayoutDriver if (preg_match('/^(?[^ ]+) connected (?primary )?(?[0-9]+)x(?[0-9]+)\\+(?[0-9]+)\\+(?[0-9]+) /', $line, $match)) { $this->_displays[$match['output']] = [ - 'x' => $match['screen_x'], - 'y' => $match['screen_y'], - 'w' => $match['screen_w'], - 'h' => $match['screen_h'], + 'x' => (int)$match['screen_x'], + 'y' => (int)$match['screen_y'], + 'w' => (int)$match['screen_w'], + 'h' => (int)$match['screen_h'], 'primary' => !empty($match['primary']) ]; }