The SDL forums have moved to
This is just a read-only archive of the previous forums, to keep old links working.

SDL Forum Index
Simple Directmedia Layer Forums
[RFC] SDL_WINDOWPOS_CENTERED always use the first display
Emmanuel Gil Peyrot


I am trying to implement display selection for fullscreen in the
Wayland, as an alternative implementation of bug 2803[0] based on the
patch I provided in bug 2913[1], but it seems there is no way for the
application to tell SDL it doesn’t care about which display to use for

This issue stems from the definition of SDL_WINDOWPOS_CENTERED, as
follow (SDL2/SDL_video.h, line 129):

What would be the best way to solve this issue? I was thinking about
changing the definition of SDL_WINDOWPOS_CENTERED to something like
SDL_DISPLAY_DONTCARE defined as some currently invalid display, what do
you think about that? It wouldn’t fix already-compiled programs, but
any future one using SDL_WINDOWPOS_CENTERED would let the compositor
select which display to use.


Emmanuel Gil Peyrot

SDL mailing list