diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-08-05 16:32:50 -0400 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-08-05 16:32:50 -0400 |
commit | 37bfdf4003b7a7833e94f990567cad18d4f01d56 (patch) | |
tree | 0755ca04dad1a90c58f21a522d8f3b8b81083e54 /pts-core/functions/pts-functions_system_graphics.php | |
parent | 3bbdeefed9381a7bf3b62f7e908f41a166fa94ee (diff) | |
download | phoronix-test-suite-upstream-37bfdf4003b7a7833e94f990567cad18d4f01d56.tar.gz phoronix-test-suite-upstream-37bfdf4003b7a7833e94f990567cad18d4f01d56.tar.xz phoronix-test-suite-upstream-37bfdf4003b7a7833e94f990567cad18d4f01d56.zip |
pts-core: Few minor changes to xrandr_available_modes()
Diffstat (limited to 'pts-core/functions/pts-functions_system_graphics.php')
-rw-r--r-- | pts-core/functions/pts-functions_system_graphics.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pts-core/functions/pts-functions_system_graphics.php b/pts-core/functions/pts-functions_system_graphics.php index 489d658..e48962c 100644 --- a/pts-core/functions/pts-functions_system_graphics.php +++ b/pts-core/functions/pts-functions_system_graphics.php @@ -184,6 +184,9 @@ function xrandr_available_modes() $xrandr_lines = array_reverse(explode("\n", $info)); $available_modes = array(); + $supported_ratios = array(1.60, 1.25, 1.33); + $ignore_modes = array(array(832, 624), array(1152, 864)); + foreach($xrandr_lines as $xrandr_mode) { $res = explode("x", $xrandr_mode); @@ -193,7 +196,7 @@ function xrandr_available_modes() $res[0] = trim($res[0]); $res[1] = trim($res[1]); - $res[0] = substr($res[0], strpos($res[0], " ")); + $res[0] = substr($res[0], strrpos($res[0], " ")); $res[1] = substr($res[1], 0, strpos($res[1], " ")); if(is_numeric($res[0]) && is_numeric($res[1]) && $res[0] >= 800 && $res[1] >= 600) @@ -201,9 +204,6 @@ function xrandr_available_modes() $ratio = pts_trim_double($res[0] / $res[1], 2); $this_mode = array($res[0], $res[1]); - $supported_ratios = array(1.60, 1.25, 1.33); - $ignore_modes = array(array(832, 624), array(1152, 864)); - if(in_array($ratio, $supported_ratios) && !in_array($this_mode, $ignore_modes)) array_push($available_modes, $this_mode); } @@ -227,7 +227,7 @@ function xrandr_screen_resolution() $res[0] = trim($res[0]); $res[1] = trim($res[1]); - $res[0] = substr($res[0], strpos($res[0], " ")); + $res[0] = substr($res[0], strrpos($res[0], " ")); $res[1] = substr($res[1], 0, strpos($res[1], " ")); if(is_numeric($res[0]) && is_numeric($res[1])) |