Using SDL 1.3 I want to create fake fullscreen SDL_Window under linux. It is easy if i have only one display.
I just got current display mode and created a window.
SDL_GetDesktopDisplayMode(0, &mode);
SDL_Window *win = SDL_CreateWindow("my window",
0,0,mode.w, mode.h,
SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_BORDERLESS );
But when i have two displays, things get complicated. The window spreads across multiple monitors. SDL sees only one, double sized virtual display.
I tested it with this code
int num = SDL_GetNumVideoDisplays();
for( int i=0; i < num; i++ )
{
SDL_Rect displayRect;
SDL_GetDisplayBounds( i, &displayRect );
std::cout
<< "display " << i << ": x,y,w,h("
<< displayRect.x << ", "
<< displayRect.y << ", "
<< displayRect.w << ", "
<< displayRect.h << ")"
<< std::endl;
}
output:
display 0: x,y,w,h(0, 0, 2960, 1050)
But i have two displays (1680×1050 and 1280×1024).
How to force the window to stay on only one (assume main) display?
src/video/x11/SDL_x11modes.cchecks some interesting#defines:You might check
include/SDL_config.hto see which path(s) your copy is following. Rebuilding withX11MODES_DEBUGdefined may also be productive.EDIT: Tried
test/testvidinfo.con my system withX11MODES_DEBUGand got this:You can see SDL has queried Xinerama and gotten both of my monitors but doesn’t seem to communicate that back to the client in a useful manner.
Sadly it looks like you need to post to the mailing list or file a bug 🙁