Page 1 of 1

Setting Fullscreen window to a secondary screen

PostPosted: 15 Sep 2017, 20:55
by jobenmoe
Hello,

I am trying to get supertuxkart to run full screen on a second monitor that is not set as main. Could someone be kind enough to guide me on how I could change screen setting in the code?

Best,
Jason

Re: Setting Fullscreen window to a secondary screen

PostPosted: 16 Sep 2017, 00:09
by Auria
Hi,

first of all, which OS are you using?

Re: Setting Fullscreen window to a secondary screen

PostPosted: 16 Sep 2017, 00:30
by deve
If on linux, in CIrrDeviceLinux.cpp:

{l Code}: {l Select All Code}
            RROutput primary_id = XRRGetOutputPrimary(display, DefaultRootWindow(display));
      
            for (int i = 0; i < res->noutput; i++)
            {
               XRROutputInfo* output_tmp = XRRGetOutputInfo(display, res, res->outputs[i]);
               if (!output_tmp || !output_tmp->crtc || output_tmp->connection == RR_Disconnected)
               {
                  XRRFreeOutputInfo(output_tmp);
                  continue;
               }
      
               XRRCrtcInfo* crtc_tmp = XRRGetCrtcInfo(display, res, output_tmp->crtc);
               if (!crtc_tmp)
               {
                  XRRFreeOutputInfo(output_tmp);
                  continue;
               }
               
               if (res->outputs[i] == primary_id ||
                  output_id == BadRROutput || crtc_tmp->x < crtc->x ||
                  (crtc_tmp->x == crtc->x && crtc_tmp->y < crtc->y))
               {
                  XRRFreeCrtcInfo(crtc);
                  XRRFreeOutputInfo(output);      
                  
                  output = output_tmp;
                  crtc = crtc_tmp;               
                  output_id = res->outputs[i];
               }
               else
               {
                  XRRFreeCrtcInfo(crtc_tmp);
                  XRRFreeOutputInfo(output_tmp);         
               }
               
               if (res->outputs[i] == primary_id)
                  break;
            }


It uses primary display if available. If not available, it uses the most top left display.

So probably
{l Code}: {l Select All Code}
if (res->outputs[i] == primary_id)

should be changed to
{l Code}: {l Select All Code}
if (res->outputs[i] != primary_id)

in both places, assuming that you have two monitors connected. I didn't test it though.