We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1514

Summary: Strange SDL_CreateWindow behaviour under Twinview
Product: SDL Reporter: Gabriel Jacobo <gabomdq>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED DUPLICATE QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.0   
Hardware: x86_64   
OS: Linux   

Description Gabriel Jacobo 2012-06-05 12:30:30 UTC
I'm creating a window in my dual monitor setup configured with Nvidia's Twinview.
The problem is no combination of position and size parameters can make a window become fullscreen at the correct resolution on one the secondary monitor, it always picks up the size of the first monitor. 

My metamode is:

./nv-control-dpy --print-current-metamode

Using NV-CONTROL extension 1.27 on :0
Connected Display Devices:
  CRT-1 (0x00000002): CVT Crystal View
  DFP-0 (0x00010000): DELL 2408WFP

current metamode: "id=50, switchable=yes, source=xconfig :: CRT-1: nvidia-auto-select @1024x768 +0+0, DFP-0: nvidia-auto-select @1920x1200 +1024+0"


If I create a window with:

SDL_CreateWindow("test",1024, 0,1920,1200, SDL_WINDOW_FULLSCREEN)

everything looks nice, a full screen window on my primary monitor of the correct resolution.

But if I do:

SDL_CreateWindow("test",0, 0,1024,768, SDL_WINDOW_FULLSCREEN)

...hoping to get a full screen 1024x768 on the left side monitor (which is the secondary in my setup), I get a fullscreen window that's 1920x1200 (it starts correctly at 0x0 though, but it "overflows" the secondary monitor because it's of a lower resolution).

I've also tried with SDL_WINDOWPOS_UNDEFINED | display_number, but that doesn't work in this case, I think because boths monitors appear as a single display to SDL.

The internal value _this->num_displays used in SDL_GetWindowDisplay is always 1 (that may explain the problem, at least partially)

In SDL 1.2 apps, I can set the SDL_VIDEO_FULLSCREEN_HEAD to 0 or 1 and I'll get the app on the appropriate monitor and at the correct resolution (I tested this with the Humble Bundle V apps).
Comment 1 Gabriel Jacobo 2012-06-18 14:58:22 UTC
Marking as duplicate of #1522 as I've uploaded a more general patch there to solve this problem.

*** This bug has been marked as a duplicate of bug 1522 ***