VirtualBox

Changeset 91716 in vbox


Ignore:
Timestamp:
Oct 13, 2021 1:42:01 PM (3 years ago)
Author:
vboxsync
Message:

Additions: X11: fix setscreenlayout handling, bugref:10120.

Take into account parameters "xorigin" and "primary" when setting
screen layout with VBoxManage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/display-svga-x11.cpp

    r91670 r91716  
    160160    void (*pXRRFreeCrtcInfo)(XRRCrtcInfo *);
    161161    void (*pXRRAddOutputMode)(Display *, RROutput, RRMode);
     162    void (*pXRRSetOutputPrimary)(Display *, Window, RROutput);
    162163};
    163164
     
    171172    uint32_t height;
    172173    bool fEnabled;
     174    bool fPrimary;
    173175};
    174176
     
    886888    *(void **)(&x11Context.pXRRAddOutputMode) = dlsym(x11Context.pRandLibraryHandle, "XRRAddOutputMode");
    887889    checkFunctionPtrReturn(x11Context.pXRRAddOutputMode);
     890
     891    *(void **)(&x11Context.pXRRSetOutputPrimary) = dlsym(x11Context.pRandLibraryHandle, "XRRSetOutputPrimary");
     892    checkFunctionPtrReturn(x11Context.pXRRSetOutputPrimary);
    888893
    889894    return VINF_SUCCESS;
     
    913918    x11Context.pXRRFreeCrtcInfo = NULL;
    914919    x11Context.pXRRAddOutputMode = NULL;
     920    x11Context.pXRRSetOutputPrimary = NULL;
    915921    x11Context.fWmwareCtrlExtention = false;
    916922    x11Context.fMonitorInfoAvailable = false;
     
    12261232        x11Context.pXRRAddOutputMode(x11Context.pDisplay, outputId, pModeInfo->id);
    12271233#endif
     1234
     1235    if (paOutputs[iOutputIndex].fPrimary)
     1236    {
     1237#ifdef WITH_DISTRO_XRAND_XINERAMA
     1238        XRRSetOutputPrimary(x11Context.pDisplay, x11Context.rootWindow, outputId);
     1239#else
     1240        if (x11Context.pXRRSetOutputPrimary)
     1241            x11Context.pXRRSetOutputPrimary(x11Context.pDisplay, x11Context.rootWindow, outputId);
     1242#endif
     1243    }
     1244
    12281245    /* Make sure outputs crtc is set. */
    12291246    pOutputInfo->crtc = pOutputInfo->crtcs[0];
     
    14221439            /* Create a whole topology and send it to xrandr. */
    14231440            struct RANDROUTPUT aOutputs[VMW_MAX_HEADS];
    1424             int iRunningX = 0;
    14251441            for (int j = 0; j < x11Context.hOutputCount; ++j)
    14261442            {
    1427                 aOutputs[j].x = iRunningX;
     1443                aOutputs[j].x = aMonitors[j].xOrigin;
    14281444                aOutputs[j].y = aMonitors[j].yOrigin;
    14291445                aOutputs[j].width = aMonitors[j].cx;
    14301446                aOutputs[j].height = aMonitors[j].cy;
    14311447                aOutputs[j].fEnabled = !(aMonitors[j].fDisplayFlags & VMMDEV_DISPLAY_DISABLED);
    1432                 if (aOutputs[j].fEnabled)
    1433                     iRunningX += aOutputs[j].width;
     1448                aOutputs[j].fPrimary = (aMonitors[j].fDisplayFlags & VMMDEV_DISPLAY_PRIMARY);
    14341449            }
    14351450            /* In 32-bit guests GAs build on our release machines causes an xserver lock during vmware_ctrl extention
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette