1
\$\begingroup\$

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,  
SDL_WINDOW_FULLSCREEN | SDL_WINDOW_BORDERLESS ); }
  • 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?

\$\endgroup\$
8
  • \$\begingroup\$ This sounds more like an issue with MATE, I don't get this issue with GNOME, i3, or xmonad. \$\endgroup\$
    – user5665
    Commented May 6, 2016 at 17:48
  • \$\begingroup\$ Have you tried testing this issue with other desktops or window managers? \$\endgroup\$
    – user5665
    Commented May 6, 2016 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
    Commented May 6, 2016 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
    Commented May 6, 2016 at 18:28
  • \$\begingroup\$ I'm using SDL 2.0.4-2 from the Arch Linux official packages. \$\endgroup\$
    – user5665
    Commented May 6, 2016 at 18:40

1 Answer 1

1
\$\begingroup\$

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_CreateWindow( "SDL Tutorial",SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED, screenWidth, screenHeight, 
SDL_WINDOW_FULLSCREEN | SDL_WINDOW_SHOWN | SDL_WINDOW_BORDERLESS | SDL_WINDOW_INPUT_GRABBED );
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .