Fullscreen mode does not work correctly #31

rootslinux opened this Issue Nov 9, 2012 · 5 comments


None yet

2 participants


This is a old bug from the Allacrost code that was never really addressed. I hope it can be fixed in this release. On my system, which uses a heterogeneous dual-monitor setup on Ubuntu Linux, when I change the game to run in fullscreen mode, it changes the resolution of both screens and runs the game "in the middle" of the two, which looks ugly and is practically unplayable in this state. Even worse, if I try to change the game back to windowed mode, my monitor resolutions are still messed up, and I have to reboot my system to get them back to normal (I'm sure there's another way to fix them without a reboot, but I never found it).

I didn't know if this was the fault of Allacrost or just the nature of my dual screen setup. Until yesterday that is. I installed Aquaria on my system and went to full screen mode, and it worked fine. It disabled my second monitor and just used the first, but that wasn't a big deal. And once I left the game, everything worked again. I hope we can use Aquaria's source code (GPL2) to find out what went wrong. I've already been digging around to see where the full screen toggle code is, and here's what I've found so far.

The code repository (mercurial) is at: http://hg.icculus.org/icculus/aquaria/

// In DSQ.h/.cpp

void toggleFullscreen();

// actually toggle
void DSQ::toggleFullscreen()
    //if (!core->isNested() && !core->sound->isPlayingVoice()) {
    user.video.full = _fullscreen;

// In Core.h/.cpp

void toggleScreenMode(int t=0);

void Core::toggleScreenMode(int t)

        initGraphicsLibrary(false, true);
    resetGraphics(-1, -1, t);

void resetGraphics(int w, int h, int fullscreen=-1, int vsync=-1, int bpp=-1);

void Core::resetGraphics(int w, int h, int fullscreen, int vsync, int bpp)
    int lastMode = mode;

    if (fullscreen == -1)
        fullscreen = _fullscreen;

    if (vsync == -1)
        vsync = _vsync;

    if (w == -1)
        w = width;

    if (h == -1)
        h = height;

    if (bpp == -1)
        bpp = _bpp;



    initGraphicsLibrary(w, h, fullscreen, vsync, bpp);

    case MODE_2D:
        enable2DWide(w, h);
        enable2D(virtualWidth, virtualHeight, true);
    case MODE_3D:



I'll continue to dig around, but I'm not a graphics guy so I don't know if I'll be able to address this issue myself effectively. For now I wanted to open this issue so we can discuss it. I hope that it can be fixed for the first release.

@rootslinux rootslinux closed this Nov 9, 2012
@rootslinux rootslinux reopened this Nov 9, 2012

Hi @rootslinux :)

I've also played Aquaria at the time it went out and I must say this fantastic game left an unalterable trace in my memory.
This game is a rock-solid reference now, IMHO.

Note also that Icculus himself pointed out several problems with linux distro when switching between fullscreen/window mode and is proposing a fix for SDL which is being discussed at this very moment:

Now, the code you've put is too high-level to get to know the actual things done to handle it properly, even if I understand it's just the start of a proposal, of course.

What we need to know, IMHO, is the sequence of screen/draw related OpenGL/SDL calls done in Aquaria when:

  • Toggling to fullscreen on a single monitor/dual monitor
  • Returning to windows mode
  • Exiting the app from a fullscreen mode.

Working on that fix won't happen on my end before I've finished the first dungeon, redone the new game intro, reviewed the game balance (with your fabulous support on it), and refreshed the packaging process.
Ah, and it shouldn't prevent a release, since almost every games out there are concerned by that kind of bugs, that shouldn't need workarounds on our own but rather fixes in X11, the dual-monitor-app-in-the-middle problem apart.

Best regards,


Glad that the SDL folks are talking about fixing this issue. I'm rather hesitant to rely on them to come around with a fix though, since this has been a problem for years already. I agree that the issue shouldn't hold up the release (we've made several releases of Allacrost with this problem present), and understand that there are higher priority issues to take care of.


This issue might be partly solved with logzero fix:


@endoalir did something about that in: 5b2e481
Now in fullscreen, the window will be placed on the first monitor. :)

@Bertram25 Bertram25 closed this Jun 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment