policycoreutils: sandbox: pass DPI from the desktop

Fix sandbox to pass DPI from the desktop to the sandbox program.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
This commit is contained in:
Dan Walsh 2011-06-07 08:34:04 -04:00 committed by Eric Paris
parent f6558d9cec
commit 83e6416bca
2 changed files with 5 additions and 4 deletions

View File

@ -319,7 +319,7 @@ sandbox [-h] [-l level ] [-[X|M] [-H homedir] [-T tempdir]] [-I includefile ] [-
if self.__options.X_ind:
self.setype = DEFAULT_X_TYPE
self.dpi=commands.getoutput("xrdb -query | grep dpi | /bin/cut -f 2")
if self.__options.setype:
self.setype = self.__options.setype
@ -406,7 +406,7 @@ sandbox [-h] [-l level ] [-[X|M] [-H homedir] [-T tempdir]] [-I includefile ] [-
self.__setup_sandboxrc(self.__options.wm)
cmds += [ "--", SANDBOXSH, self.__options.windowsize ]
cmds += [ "--", SANDBOXSH, self.__options.windowsize, self.dpi ]
else:
cmds += [ "--" ] + self.__paths
return subprocess.Popen(cmds).wait()

View File

@ -1,10 +1,11 @@
#!/bin/bash
context=`id -Z | secon -t -l -P`
export TITLE="Sandbox $context -- `grep ^#TITLE: ~/.sandboxrc | /usr/bin/cut -b8-80`"
[ $# -eq 1 ] && export SCREENSIZE="$1" || export SCREENSIZE="1000x700"
[ -z $1 ] && export SCREENSIZE="1000x700" || export SCREENSIZE="$1"
[ -z $2 ] && export DPI="96" || export DPI="$2"
trap "exit 0" HUP
(/usr/bin/Xephyr -title "$TITLE" -terminate -screen $SCREENSIZE -displayfd 5 5>&1 2>/dev/null) | while read D; do
(/usr/bin/Xephyr -title "$TITLE" -terminate -screen $SCREENSIZE -dpi $DPI -displayfd 5 5>&1 2>/dev/null) | while read D; do
export DISPLAY=:$D
cat > ~/seremote << __EOF
#!/bin/sh