src/vmwarectrl.c
static Bool
VMwareCtrlDoSetRes(ScrnInfoPtr pScrn,
                   CARD32 x,
                   CARD32 y,
                   Bool resetXinerama)
{
   int modeIndex;
   DisplayModePtr mode;
   VMWAREPtr pVMWARE = VMWAREPTR(pScrn);

   if (pScrn && pScrn->modes) {
      VmwareLog(("DoSetRes: %d %d\n", x, y));

      if (resetXinerama) {
         free(pVMWARE->xineramaNextState);
         pVMWARE->xineramaNextState = NULL;
         pVMWARE->xineramaNextNumOutputs = 0;
      }

      /*
       * Don't resize larger than possible but don't
       * return an X Error either.
       */
      if (x > pVMWARE->maxWidth ||
          y > pVMWARE->maxHeight) {
         return TRUE;
      }

      /*
       * Find an dynamic mode which isn't current, and replace it with
       * the requested mode. Normally this will cause us to alternate
       * between two dynamic mode slots, but there are some important
       * corner cases to consider. For example, adding the same mode
       * multiple times, adding a mode that we never switch to, or
       * adding a mode which is a duplicate of a built-in mode. The
       * best way to handle all of these cases is to directly test the
       * dynamic mode against the current mode pointer for this
       * screen.
       */

      for (modeIndex = 0; modeIndex < NUM_DYN_MODES; modeIndex++) {
         /*
          * Initialise the dynamic mode if it hasn't been used before.
          */
         if (!pVMWARE->dynModes[modeIndex]) {
            pVMWARE->dynModes[modeIndex] = VMWAREAddDisplayMode(pScrn, "DynMode", 1, 1);
         }

         mode = pVMWARE->dynModes[modeIndex];
         if (mode != pScrn->currentMode) {
            break;
         }
      }

      mode->HDisplay = x;
      mode->VDisplay = y;

      return TRUE;
   } else {
      return FALSE;
   }
}
/*
 *----------------------------------------------------------------------------
 *
 * VMwareCtrlDoSetRes --
 *
 *      Set the custom resolution into the mode list.
 *
 *      This is done by alternately updating one of two dynamic modes. It is
 *      done this way because the server gets upset if you try to switch
 *      to a new resolution that has the same index as the current one.
 *
 * Results:
 *      TRUE on success, FALSE otherwise.
 *
 * Side effects:
 *      One dynamic mode will be updated if successful.
 *
 *----------------------------------------------------------------------------
 */
VMwareCtrlDoSetRes
Set the custom resolution into the mode list.

This is done by alternately updating one of two dynamic modes. It is
done this way because the server gets upset if you try to switch
to a new resolution that has the same index as the current one.

TRUE on success, FALSE otherwise.

Side effects:
One dynamic mode will be updated if successful.
VMwareCtrlDoSetRes Set the custom resolution into the mode list . This is done by alternately updating one of two dynamic modes . It is done this way because the server gets upset if you try to switch to a new resolution that has the same index as the current one . TRUE on success FALSE otherwise . Side effects : One dynamic mode will be updated if successful .
static Bool
VMwareCtrlDoSetRes(ScrnInfoPtr pScrn,
                   CARD32 x,
                   CARD32 y,
                   Bool resetXinerama)
{
   int modeIndex;
   DisplayModePtr mode;
   VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
   if (pScrn && pScrn->modes) {
      VmwareLog(("DoSetRes: %d %d\n", x, y));
      if (resetXinerama) {
         free(pVMWARE->xineramaNextState);
         pVMWARE->xineramaNextState = NULL;
         pVMWARE->xineramaNextNumOutputs = 0;
      }
      if (x > pVMWARE->maxWidth ||
          y > pVMWARE->maxHeight) {
         return TRUE;
      }
      for (modeIndex = 0; modeIndex < NUM_DYN_MODES; modeIndex++) {
         if (!pVMWARE->dynModes[modeIndex]) {
            pVMWARE->dynModes[modeIndex] = VMWAREAddDisplayMode(pScrn, "DynMode", 1, 1);
         }
         mode = pVMWARE->dynModes[modeIndex];
         if (mode != pScrn->currentMode) {
            break;
         }
      }
      mode->HDisplay = x;
      mode->VDisplay = y;
      return TRUE;
   } else {
      return FALSE;
   }
}
static Bool VMwareCtrlDoSetRes ( ScrnInfoPtr pScrn , CARD32 x , CARD32 y , Bool resetXinerama ) { int modeIndex ; DisplayModePtr mode ; VMWAREPtr pVMWARE = VMWAREPTR ( pScrn ) ; if ( pScrn && pScrn -> modes ) { VmwareLog ( ( " \n " , x , y ) ) ; if ( resetXinerama ) { free ( pVMWARE -> xineramaNextState ) ; pVMWARE -> xineramaNextState = NULL ; pVMWARE -> xineramaNextNumOutputs = 0 ; } if ( x > pVMWARE -> maxWidth || y > pVMWARE -> maxHeight ) { return TRUE ; } for ( modeIndex = 0 ; modeIndex < NUM_DYN_MODES ; modeIndex ++ ) { if ( ! pVMWARE -> dynModes [ modeIndex ] ) { pVMWARE -> dynModes [ modeIndex ] = VMWAREAddDisplayMode ( pScrn , " " , 1 , 1 ) ; } mode = pVMWARE -> dynModes [ modeIndex ] ; if ( mode != pScrn -> currentMode ) { break ; } } mode -> HDisplay = x ; mode -> VDisplay = y ; return TRUE ; } else { return FALSE ; } }
VMwareCtrlDoSetRes
      Set the custom resolution into the mode list.
VMwareCtrlDoSetRes Set the custom resolution into the mode list .
/*
       * Don't resize larger than possible but don't
       * return an X Error either.
       */ /*
       * Find an dynamic mode which isn't current, and replace it with
       * the requested mode. Normally this will cause us to alternate
       * between two dynamic mode slots, but there are some important
       * corner cases to consider. For example, adding the same mode
       * multiple times, adding a mode that we never switch to, or
       * adding a mode which is a duplicate of a built-in mode. The
       * best way to handle all of these cases is to directly test the
       * dynamic mode against the current mode pointer for this
       * screen.
       */ /*
          * Initialise the dynamic mode if it hasn't been used before.
          */