VOGONS

Common searches


First post, by quimkaos

User metadata
Rank Newbie
Rank
Newbie

Hi all, every time i switch DOSBox to full screen, my second monitor gets disabled. Does anyone knows how to use DOSBox in fullscreen mode without disabling other monitors?
i'm using DOSBox in 0.74-3 in linux
i found another post in this forum (~5 years old) that didn't help.

Reply 1 of 8, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

It's a problem of SDL 1.2.
Here is to hoping that the devs switch to SDL2 soon

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 2 of 8, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Can you try changing fullresolution in dosbox.conf to desktop, verify DOSBox is actually using this config on load and see if the same issue occurs?
If you've only found one other post then either it doesn't happen that often or no one reports it.

How To Ask Questions The Smart Way
Make your games work offline

Reply 3 of 8, by krcroft

User metadata
Rank Oldbie
Rank
Oldbie
Dominus wrote:

It's a problem of SDL 1.2.
Here is to hoping that the devs switch to SDL2 soon

Indeed, 1.2 doesn't handle multiple displays without kludges; alas: https://forums.libsdl.org/viewtopic.php?p=31144

Incase the link or forum goes down, here's a copy for future-reference:

Posted: Tue Dec 20, 2011 5:18 pm by René Dudfield […]
Show full quote

Posted: Tue Dec 20, 2011 5:18 pm by René Dudfield

On Mon, Dec 19, 2011 at 10:08 PM, Julian Mayer wrote: […]
Show full quote

On Mon, Dec 19, 2011 at 10:08 PM, Julian Mayer wrote:

hello all
first of all - thanks for SDL!

i've written a game that uses SDL for creating an OpenGL context under Windows and Linux. while everything seems to work fine on single-monitor systems, i've received a report from a linux user that the game actually spans both displays, while he only wants it displayed on the second display.

his setup: "Kubuntu 11.10 x64 with R600g video driver / Laptop Acer 7560G with external FullHD 27" display attached via HDMI. Configured via xrandr."

after some googling i've told him to try these variables:

SDL_VIDEO_FULLSCREEN_HEAD
SDL_VIDEO_X11_XINERAMA
SDL_VIDEO_X11_XINERAMA_SCREEN
SDL_VIDEO_X11_XRANDR

but he said even launching the game with SDL_VIDEO_FULLSCREEN_HEAD=1 doesn't fix the issue...any suggestions?

one issue seems to be that SDL_GetVideoInfo() returns the resolution of BOTH displays combined, i.e. [url=tel:3520%20x%201080]3520 x 1080[/url] ... shouldn't it return the resolution of the primary display?
(the rationale here is that calling SDL_SetVideoMode(info->current_w, info->current_h, 24, SDL_OPENGL | SDL_FULLSCREEN) should yield a usable fullscreen context on the main display and not some weird problem context that spans two displays)

however that can't be responsible for all problems seen here as he said even when forcing the game to a lower resolution, windowed mode and FULLSCREEN_HEAD=1 it still spans both displays.

so are there any suggestions how to make SDL work fine with a multi monitor setup on linux?

thanks, julian

btw: it seems like NONE of the environment variables listed above are documented

Hi,

One hack is to see the aspect ratio is very wide, and if so use half(or a division of a standardish aspect if they have 3 monitors) the width. Then set the position of the window based on that guess. Use the SDL_VIDEO_WINDOW_POS="x,y" environment variable to set the position (then re-init).

Otherwise, SDL 1.2 does not do multiple monitors.

Or wait for SDL 1.3 to be released ; Because that supports multi-monitors on some platforms.

cu!

Reply 4 of 8, by quimkaos

User metadata
Rank Newbie
Rank
Newbie

thanks for all the replies!
@DosFreak yes i'm using the correct .conf file. setting fullresolution to desktop spans dos box thru all monitors. original uses the main monitor and disable others (the monitor goes in to power saving mode). Fixed size behaves as original does.

i've been searching a bit more and all points to SLD 1.2, and that probably wont be addressed by devs...

Reply 5 of 8, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Yeah just wanted to verify thanks. DOSBox will switch to SDL2 eventually but from what I can see for this and the dropped key issue modifying the code to maximize the window instead of switching to fullscreen would likely fix both issues on SDL 1.2.

I do find it strange this hasn't been reported more often though. Mabye number of Linux users using DOSBox and with multiple monitors and using fullscreen is pretty low?

How To Ask Questions The Smart Way
Make your games work offline

Reply 6 of 8, by Roger Wilco

User metadata
Rank Newbie
Rank
Newbie

I had similar issues when connecting a CRT to my laptop, for the good old brain melt.
It took a while to figure out, how to get the fullscreen dosbox working on the CRT. No problems with window mode.
I tried a LOT of settings, in both Linux and Dosbox, but the fullscreen always appeared on the main screen.
I think, the only "solution" was to display same content on both monitors and adjust resolution as needed by the CRT.

Running latest stable Debian, tried this with Dosbox from the official repos.

Reply 7 of 8, by dreamer_

User metadata
Rank Member
Rank
Member

It's rather easy to work around this using SDL environment variables and proper .conf file. I do it automatically in https://github.com/dreamer/boxtron/ to place DOSBox in fullscreen on monitor user prefers.

DOSBox really needs to switch to SDL2 by default at this point.

| ← Ceci n'est pas une pipe
dosbox-staging

Reply 8 of 8, by janskjaer

User metadata
Rank Member
Rank
Member

I have the same issue on Debian Buster, but depending which distribution, desktop environment and window manager you're using, your displays may be managed by a program already installed called xrandr.

If so, you can use xrandr to create profiles (or Layouts) of your display setup, resolutions and orientation. There is a program called ARandR that is a GUI for xrandr.

I have one layout that arranges both displays the way I want, another layout that disables my laptop display, using only my second display, and vice versa.
Such a layout would look like this:

xrandr --output HDMI-2 --primary --mode 1920x1080 --pos 1366x0 --rotate normal --output HDMI-1 --off --output DP-1 --off --output eDP-1 --mode 1366x768 --pos 0x128 --rotate normal --output DP-2 --off

ARandR allows these layouts to be saved within executable scripts, that can be called in the terminal to switch the display layout.
Example: .screenlayout/benq_monitor_only.sh:

#!/bin/sh
xrandr --output HDMI-2 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI-1 --off --output DP-1 --off --output eDP-1 --off --output DP-2 --off

Therefore, you could have another bash script that calls the layout which disables all the displays you don't use for DOSBOX, and sets the secondary to the primary, forcing DOSBOX to use it. The same script then launches DOSBOX, and then when DOSBOX quits, another layout is called immediately after that, which restores the display layout to as it was before:

#!/bin/bash
cd ${HOME}
.screenlayout/benq_only.sh
dosbox
.screenlayout/laptop_and_benq_displays.sh

Attachments

DELL Dimension XPS M200s
:Intel P1 MMX 200MHz
:64MB EDO
:DOS 6.22/Win95b
:Matrox Millenium II + m3D (PowerVR PCX2)
Chaintech 7VJL Apogee
:AMD AthlonXP 2700+
:512MB DDR
:Win98SE/2000 SP4
:3dfx Voodoo5 5500 AGP