diff options
| author | Sylvain Pineau <sylvain.pineau@canonical.com> | 2015-04-24 12:03:52 +0200 |
|---|---|---|
| committer | Sylvain Pineau <sylvain.pineau@canonical.com> | 2015-04-24 12:03:52 +0200 |
| commit | 7941ba1e7b68314f67d76fefd34a9bbf8f9a1a0e (patch) | |
| tree | ddc715aa2464574d955a52549e82145145fe01de /jobs | |
| parent | 2e842a9822c5d6165d2becebc9956a6fa44c68a1 (diff) | |
providers:checkbox:graphics.txt.in: Escape subshell commands in maximum_resolution generator
Not escaping the subshell commands hardcoded the current and maximum resolutions values in the new job definition thus preventing any dynamic change to be detected. Also replacing the xdpyinfo command by a call to gdk_screen_get_monitor_geometry() using the python gi.repository allow us to only get the primary display resolution (useful in a dual head setup). https://developer.gnome.org/gdk3/stable/GdkScreen.html#gdk-screen-get-monitor-geometry Fixes: https://bugs.launchpad.net/plainbox-provider-checkbox/+bug/1447466
Diffstat (limited to 'jobs')
| -rw-r--r-- | jobs/graphics.txt.in | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/jobs/graphics.txt.in b/jobs/graphics.txt.in index 00a57ad..6e16fa6 100644 --- a/jobs/graphics.txt.in +++ b/jobs/graphics.txt.in @@ -146,8 +146,8 @@ command: device.category == 'VIDEO' package.name == 'zenity' command: - maxi="$(xrandr -q |grep -A 1 "connected\( primary\)* [0-9]" |tail -1 |awk '{print $1}')" - now="$(xdpyinfo | grep dimension | awk '{print $2}')" + maxi="\$(xrandr -q |grep -A 1 "connected\( primary\)* [0-9]" |tail -1 |awk '{print \$1}')" + now="\$(python3 -c 'from gi.repository import Gdk; screen=Gdk.Screen.get_default(); geo = screen.get_monitor_geometry(screen.get_primary_monitor()); print(geo.width, "x", geo.height, sep="")')" test "\$maxi" != "\$now" && notify="\nPlease switch to the maximum resolution \nfor every graphic tests" zenity --info --text "Maximum resolution: \$maxi\nCurrent resolution: \$now \$notify" estimated_duration: 10.0 |
