Having a problem trying to get proper fullscreen in linux.

I'm using 1440x900 on desktop. When i set SDL to use 1280x720 as fullscreen, it does change screen resolution. But if i drag the mouse cursor to the bottom or right edge of the game screen, it "scrolls" the screen beyond the game surface and makes part of the desktop visible.

Here's how I set the window/screen:

gameWindow = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED, screenWidth, screenHeight,  
  • Am i missing some flag(s) perhaps?
  • Is this a common problem? I'm on Linux Mint MATE (Rosa).
  • This problem also occurs when trying to run the same build in an Openbox session.
  • Using nVidia drivers (x64, v340.96) from nvidia.com, on 9600 GT card(s). No twin/dual screen or second Workspaces.

Any good tips on how to avoid or workaround this issue?

  • \$\begingroup\$ This sounds more like an issue with MATE, I don't get this issue with GNOME, i3, or xmonad. \$\endgroup\$ – user5665 May 6 '16 at 17:48
  • \$\begingroup\$ Have you tried testing this issue with other desktops or window managers? \$\endgroup\$ – user5665 May 6 '16 at 17:48
  • \$\begingroup\$ Same problem occurred using Openbox. I will try some others this evening. Though i'm guessing i'd then have to look at workarounds. What SDL version you use btw? (i'm using sdl2-dev from repos). \$\endgroup\$ – DhP May 6 '16 at 18:05
  • \$\begingroup\$ Version of libsdl2-dev used is: 2.0.2+dfsg1-3ubuntu1.1 , so ill try to step up from that and see as well. \$\endgroup\$ – DhP May 6 '16 at 18:28
  • \$\begingroup\$ I'm using SDL 2.0.4-2 from the Arch Linux official packages. \$\endgroup\$ – user5665 May 6 '16 at 18:40

The flag called SDL_WINDOW_INPUT_GRABBED seems to prevent the problem from happening. But still not sure if that is the, or a, correct solution.

SDL_WINDOWPOS_CENTERED, screenWidth, screenHeight, 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.