fullscreen issues with single and multiple monitors (linux)

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
dresb
Prole
Posts: 10
Joined: Thu Jan 20, 2011 8:33 pm

fullscreen issues with single and multiple monitors (linux)

Post by dresb »

Hello everyone, new user here. I've been playing with screen modes and have various issues, specially when it comes to multiple monitors.

This is my current setup:
Display Setup
Display Setup
display.png (12.28 KiB) Viewed 4770 times
The blue square represents the LÖVE's default window placement, which is annoying but can live with. When I turn off either of the displays and try again the new windows are centered properly so its not a deal-breaker.

The reason seems to be LÖVE not being "current screen aware" which becomes a real problem later since it applies fullscreen to both displays. Another framework called pyglet does not have this issue, they seem to be using OpenGL calls directly instead of going through SDL which might be part of the reason.

There is also a single screen problem when going fullscreen, a simple test like this:

Code: Select all

function love.load()
    love.graphics.toggleFullscreen()
    love.timer.sleep(3000)
    love.graphics.toggleFullscreen()
    love.timer.sleep(3000)
    love.event.push('q')
end
On exit it does not restore the screen's previous resolution. Instead, it goes to the monitor's default resolution (1024x768 in VGA1's case). I've looked for a LÖVE API to get the current screen resolution before going fullscreen (and later restore it manually) but had no luck. Browsing through the various examples and games it seems they either don't use fullscreen or have the same issue.

I'm not sure if these are real problems (I did search the bug tracker and forums to no avail) or just me missing something. Thanks.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: fullscreen issues with single and multiple monitors (lin

Post by bartbes »

Unfortunately the fullscreen issue is something from SDL, so we can't really do anything about that, of course you have to understand that linux tends to do weird stuff with multiple monitors, so I can't really blame it..
Regarding starting out between the screens, this is something love does 'on purpose', it sets the default window position to be the center of the screen, if you wish you could file a feature request to make it overridable.
User avatar
dresb
Prole
Posts: 10
Joined: Thu Jan 20, 2011 8:33 pm

Re: fullscreen issues with single and multiple monitors (lin

Post by dresb »

Thank you. I don' t really mind having the window between the screens. I guess the multi-screen fullscreen issues can wait until I do some research on how other SDL apps get around this.

The real deal-breaker (from a player's point of view) is the single-screen fullscreen problem. It does not restore the display's previous resolution, instead fallbacks to the monitor's hardware default (1024x768 for my VGA).

Is there a way within LÖVE to know what resolution the desktop had before going fullscreen? That way I can restore it with setMode before going windowed.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: fullscreen issues with single and multiple monitors (lin

Post by bartbes »

I remember something about implementing this, let me dive into my memory..
ah right, create a windowed app with width and height 0, it'll use desktop size.
User avatar
dresb
Prole
Posts: 10
Joined: Thu Jan 20, 2011 8:33 pm

Re: fullscreen issues with single and multiple monitors (lin

Post by dresb »

Awesome, that worked. Thank you.

I added the setMode call (keeping fullscreen true) like this:

Code: Select all

function love.load()
    love.graphics.toggleFullscreen()
    love.timer.sleep(3000)
    love.graphics.setMode( 0, 0, true, true, 0 )
    love.graphics.toggleFullscreen()
    love.timer.sleep(3000)
    love.event.push('q')
end
(I guess that game-wise I would force a fake black screen during the process to make it indistinguishable from a single resolution change to the player)

Shouldn't keeping the original resolution be the default behavior for toggleFullscreen (when toggling off)?
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: fullscreen issues with single and multiple monitors (lin

Post by bartbes »

It should, but again, this might be SDL's fault.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests