I'm using 2 screens on my Linux system. Still LinuxMint 17.3 (very out of date). MATE desktop environment 1.12.0, Marco window manager, SDL2 2.0.2; RnD 22.214.171.124
I have a main screen which is 1280x1024; and a giant 43" TV, in portrait mode, which is attached to all 3 of my main machines and swapped between them depending what I'm doing. All 3 maintain windows on it, but obviously I can only see the ones belonging to the machine whose HDMI connection is currently 'active'.
So I'm sitting here on my personal desktop, looking at the 1280x1024 screen. I start RnD, and -- it appears -- or doesn't appear -- on the giant vertical screen. To retrieve it I have to switch the HDMI input on the TV, drag it back, then switch the TV back.(*)
This shows how the system sees the 2 screens:
Code: Select all
$ xrandr | grep -w connected HDMI1 connected primary 2160x3840+1280+0 right (normal left inverted right x axis y axis) 800mm x 450mm VGA1 connected 1280x1024+0+2160 (normal left inverted right x axis y axis) 338mm x 270mm
So, for instance, `xterm -geometry +0+2160` pops up an xterm in the upper left corner of the small screen.
Code: Select all
$ ./rocksndiamonds -geometry +20+2180 [FATAL] unrecognized option '-geometry' [FATAL] try option '--help' for more information [FATAL] aborting
I looked for SDL options and the closest I could find was the environment variable SDL_VIDEO_CENTERED=center, but that doesn't even seem to apply to SDL2.
So I'm looking for a way to specify an X11 geometry or a Xinerama screen number or an Xrandr screen number (I've never really properly understood the relationship between or distinction between Xinerama and Xrandr...)
(*)The reality is somewhat more complex. The HDMI screen is 'still there' while the physical display is connected to a different host or powered off. I can mouse over and grab the window without actually seeing what I'm doing, but it's quite hard to actually hit it. Not as hard as having to catch its titlebar, because my window manager recognizes Alt+drag (anywhere within a window) as drag-to-move. AND, having to deal with this all the time, I actually have `x11vnc` running to cast the HDMI screen, and a VNC client in a window on the small screen, showing the big screen in 1/4 scale, and normally minimized. So I can, without powering on or switching the big screen, pop up the VNC and drag the window across the horizontal boundary between screens, onto the small screen. But this is still a hassle.
None of this bizarrity is actually relevant; the baseline problem is: give me a way to tell RnD which of multiple X11 screens to appear on! -geometry (or --geometry) would be perfect, since it lets you set size as well as position; RnD should come up at the specified location in the specified dimensions (doing whatever it does to fix aspect ratio -- which appears to be, allow the window to have 'wrong' aspect ratio, just use the largest interior rectangle which has the correct aspect ratio). --geometry of course allows either or both of location & size to be specified. There is surely X library code to parse it (looks like xparsegeometry(3)).
Really, SDL itself, when built for X11, ought to intercept those args. But maybe it is not set up to fool around with argv outside the control of the calling program. Maybe there's something RnD needs to do to tell it 'hey, parse this here --geometry flag I received'. SDL doesn't intend that all SDL programs be fullscreen, so it ought to have a way to bridge the local OS's way of specifying a size into the generic program inside...