VirtualBox

Changeset 1383 in vbox


Ignore:
Timestamp:
Mar 9, 2007 6:06:02 PM (18 years ago)
Author:
vboxsync
Message:

Made our X graphics driver use 1024x768 if all user specified modes are invalid, like in the standard SUSE configuration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/xgraphics/vboxvideo.c

    r1260 r1383  
    523523    xf86SetGamma(pScrn, gzeros);
    524524
    525     /* If no modes where specified for this display, add a default mode */
    526     if (!pScrn->display->modes || !*pScrn->display->modes)
     525    /* To get around the problem of SUSE specifying a single, invalid mode in their Xorg.conf
     526       by default, we add an additional mode to the end of the user specified list.  This means
     527       that if all user modes are invalid, X will try our mode before falling back to its standard
     528       mode list. */
     529    if (pScrn->display->modes == NULL)
    527530    {
    528         if ((pScrn->display->modes = xnfalloc(2 * sizeof(char*))))
    529         {
    530             pScrn->display->modes[0] = "1024x768";
    531             pScrn->display->modes[1] = NULL;
    532         }
     531        /* The user specified no modes at all - specify 1024x768 as a default. */
     532        pScrn->display->modes = xnfalloc(2 * sizeof(char*));
     533        pScrn->display->modes[0] = "1024x768";
     534        pScrn->display->modes[1] = NULL;
     535    }
     536    else
     537    {
     538        /* Add 1024x768 to the end of the mode list in case the others are all invalid. */
     539        for (i = 0; pScrn->display->modes[i] != NULL; i++);
     540        pScrn->display->modes = xnfrealloc(pScrn->display->modes, (i + 2) * sizeof(char *));
     541        pScrn->display->modes[i] = "1024x768";
     542        pScrn->display->modes[i + 1] = NULL;
    533543    }
    534544
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