VOGONS


First post, by u_fan

User metadata
Rank Newbie
Rank
Newbie

Further effort on "headless" DOSBox as a DOS utility emulator. Thanks to help from Dominus I was able to get a svn/lfn merged build on macOS Sierra.

Using

export SDL_VIDEODRIVER=dummy

and "-exit" with a batch script makes the app fairly headless.

However DOSBox steals focus regardless of standard Mac Info.plist settings for background apps/services. I have tried various permutations of LSBackgroundOnly, LSUIElement, LSUIPresentationMode, e.g.

 <key>LSBackgroundOnly</key>
<string>True</string>

in Info.plist in the 0.74-1 app bundle but nothing stops the app from stealing focus. I've also tried "touching" the app to make sure it's updated in the system caches and executing the DOSBox MacOS binary from the Terminal command line as well as

open -g  /path-to-app/DOSBox

but no luck.

Any ideas?

Thanks

Reply 2 of 5, by u_fan

User metadata
Rank Newbie
Rank
Newbie

Thanks for the reply, but I'm confused about the recommendation. Autolock refers to mouse/cursor emulation, so I'm confused how it affects opening in background.

But I checked. I already had autolock=false in my headless conf file which I specify in the command args. I also tried it in the GUI app by editing ~/Library/Preferences/DOSBox 0.74 Preferences. It had no effect on stealing focus there either.

Reply 3 of 5, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

btw. if you are using SVN of Dosbox, then the config should be ~/Library/Preferences/DOSBox SVN Preferences.

Also, I dimly remember that there is a patch or someone was working on making Dosbox work better in a headless case. But no idea where that is or what it was about exactly. sorry.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 4 of 5, by u_fan

User metadata
Rank Newbie
Rank
Newbie

Thanks Dominus. Turns out that DOSBox SVN Preferences does have autolock=false. Not sure if you changed the default or if I modified it at some point.

I am assuming that the 0.74-1 app bundle I'm testing is your SVN build.

If you happen to remember or run across the headless patch/build, I'd love to see it. I've searched several times but all the threads I've found point to using AutoHotkey on Windows to auto hide the DOSBox window (and disabling the console window on that platform).

I did something similar with AppleScript on the Mac before I started using the SDL_VIDEODRIVER=dummy env var. Both work but they're not very seamless as DOSBox still kicks the user out of a different virtual desktop and/or pushes the current active app to the background when DOSBox launches from the batch testing script.

Reply 5 of 5, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Actually the 0.74-1 app bundle is a recompile I did for the 0.74 release with development sources of SDL 1.2x and two or three minor backports (things that got fixed in Dosbox for OS X) of DOSBox SVN to make 0.74 compatible with current OS X versions.

My SVN build has SVN in the app bundle name, I think and available from my signature.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper