I only play one game, Master of Orion. So I only ever use the <Alt> key once when I'm done. maybe that's why I never see a problem any more. I am using Ubuntu 12.04, and my .conf file looks like this:
[sdl]
fullscreen=true
fulldouble=false
fullresolution=original
windowresolution=original
output=surface
autolock=true
sensitivity=100
waitonerror=true
priority=higher,normal
mapperfile=mapper-0.74.map
usescancodes=true
[dosbox]
language=
machine=svga_s3
captures=capture
memsize=32
[render]
frameskip=0
aspect=false
scaler=normal2x
[cpu]
core=auto
cputype=auto
cycles=auto
cycleup=10
cycledown=20
[mixer]
nosound=false
rate=44100
blocksize=1024
prebuffer=40
[midi]
mpu401=intelligent
mididevice=default
midiconfig=
[sblaster]
sbtype=sb16
sbbase=220
irq=7
dma=1
hdma=5
sbmixer=true
oplmode=auto
oplemu=fast
oplrate=44100
[gus]
gus=false
gusrate=44100
gusbase=240
gusirq=5
gusdma=3
ultradir=C:\ULTRASND
[speaker]
pcspeaker=true
pcrate=44100
tandy=auto
tandyrate=44100
disney=true
[joystick]
joysticktype=auto
timed=true
autofire=false
swap34=false
buttonwrap=false
[serial]
serial1=dummy
serial2=dummy
serial3=disabled
serial4=disabled
[dos]
xms=true
ems=true
umb=true
keyboardlayout=auto
[ipx]
ipx=false
[autoexec]
mount c dos/c
c:
or
"or" is a short script that runs the game.
I did change some other stuff further down, but I can't remember what. The problem that used to bother me was that when DOSBOX was finished, it had left my screen blown up and I had to reboot to get the proper resolution back again. That is no longer a problem.