VirtualBox

Changeset 84156 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
May 6, 2020 9:22:11 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137757
Message:

bugref:9637. Don't bail out if wmware's extension is not avaible.

File:
1 edited

Legend:

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

    r84045 r84156  
    124124    XRRScreenResources *pScreenResources;
    125125    int hRandRMajor;
    126     int hVMWCtrlMajorOpCode;
    127126    int hRandRMinor;
    128127    int hRandREventBase;
     
    132131    int hOutputCount;
    133132    void *pRandLibraryHandle;
     133    bool fWmwareCtrlExtention;
     134    int hVMWCtrlMajorOpCode;
    134135    /** Function pointers we used if we dlopen libXrandr instead of linking. */
    135136    void (*pXRRSelectInput) (Display *, Window, int);
     
    426427}
    427428
    428 
     429/** Makes a call to vmwarectrl extension. This updates the
     430 * connection information and possible resolutions (modes)
     431 * of each monitor on the driver. Also sets the preferred mode
     432 * of each output (monitor) to currently selected one. */
    429433bool VMwareCtrlSetTopology(Display *dpy, int hExtensionMajorOpcode,
    430434                            int screen, xXineramaScreenInfo extents[], int number)
     
    780784    x11Context.pXRRGetCrtcInfo = NULL;
    781785    x11Context.pXRRAddOutputMode = NULL;
     786    x11Context.fWmwareCtrlExtention = false;
    782787
    783788    int dummy;
     
    798803    }
    799804#endif
    800     if (!XQueryExtension(x11Context.pDisplay, "VMWARE_CTRL",
    801                          &x11Context.hVMWCtrlMajorOpCode, &dummy, &dummy))
    802     {
    803         XCloseDisplay(x11Context.pDisplay);
    804         XCloseDisplay(x11Context.pDisplayRandRMonitoring);
    805         x11Context.pDisplay = NULL;
    806         x11Context.pDisplayRandRMonitoring = NULL;
    807         return;
    808     }
     805
     806    x11Context.fWmwareCtrlExtention = XQueryExtension(x11Context.pDisplay, "VMWARE_CTRL",
     807                                                      &x11Context.hVMWCtrlMajorOpCode, &dummy, &dummy);
     808    if (!x11Context.fWmwareCtrlExtention)
     809        VBClLogError("VMWARE's ctrl extension is not available!\n");
     810    else
     811    {
     812        VBClLogInfo("VMWARE's ctrl extension is available. Major Opcode is %d.\n", x11Context.hVMWCtrlMajorOpCode);
     813    }
     814
     815    /* Check Xrandr stuff. */
    809816    bool fSuccess = false;
    810817#ifdef WITH_DISTRO_XRAND_XINERAMA
     
    11151122{
    11161123    XGrabServer(x11Context.pDisplay);
    1117     callVMWCTRL(paOutputs);
     1124    if (x11Context.fWmwareCtrlExtention)
     1125        callVMWCTRL(paOutputs);
    11181126
    11191127#ifdef WITH_DISTRO_XRAND_XINERAMA
Note: See TracChangeset for help on using the changeset viewer.

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