Changeset 9826 in vbox
- Timestamp:
- Jun 19, 2008 4:06:49 PM (17 years ago)
- Location:
- trunk/src/VBox/Additions/x11/xgraphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/xgraphics/vboxvideo_13.c
r9811 r9826 352 352 int rc = MODE_OK; 353 353 TRACE3("HDisplay=%d, VDisplay=%d\n", mode->HDisplay, mode->VDisplay); 354 if ( vbox_device_available(VBOXGetRec(pScrn)) 354 /* We always like modes specified by the user in the configuration 355 * file, as doing otherwise is likely to annoy people. */ 356 if ( !(mode->type & M_T_USERDEF) 357 && vbox_device_available(VBOXGetRec(pScrn)) 355 358 && !vboxHostLikesVideoMode(pScrn, mode->HDisplay, 356 359 mode->VDisplay, pScrn->bitsPerPixel) … … 381 384 static void 382 385 vbox_output_add_mode (DisplayModePtr *pModes, const char *pszName, int x, int y, 383 Bool isPreferred )386 Bool isPreferred, Bool isUserDef) 384 387 { 385 388 TRACE3("pszName=%s, x=%d, y=%d\n", pszName, x, y); … … 387 390 388 391 pMode->status = MODE_OK; 389 pMode->type = isPreferred ? M_T_PREFERRED : M_T_BUILTIN; 392 /* We don't ask the host whether it likes user defined modes, 393 * as we assume that the user really wanted that mode. */ 394 pMode->type = isUserDef ? M_T_USERDEF : M_T_BUILTIN; 395 if (isPreferred) 396 pMode->type |= M_T_PREFERRED; 390 397 /* VBox only supports screen widths which are a multiple of 8 */ 391 398 pMode->HDisplay = (x + 7) & ~7; … … 411 418 uint32_t x, y, bpp, display; 412 419 bool rc; 420 unsigned i; 413 421 DisplayModePtr pModes = NULL; 414 422 ScrnInfoPtr pScrn = output->scrn; … … 433 441 /* We prefer a slightly smaller size to a slightly larger one */ 434 442 x -= (x % 8); 435 vbox_output_add_mode(&pModes, NULL, x, y, TRUE );443 vbox_output_add_mode(&pModes, NULL, x, y, TRUE, FALSE); 436 444 } 437 445 } 446 /* Also report any modes the user may have requested in the xorg.conf 447 * configuration file. */ 448 for (i = 0; pScrn->display->modes[i] != NULL; i++) 449 if (2 == sscanf(pScrn->display->modes[i], "%dx%d", &x, &y)) 450 vbox_output_add_mode(&pModes, pScrn->display->modes[i], x, y, 451 FALSE, TRUE); 452 438 453 TRACE2; 439 454 return pModes; -
trunk/src/VBox/Additions/x11/xgraphics/vboxvideo_15.c
r9811 r9826 385 385 int rc = MODE_OK; 386 386 TRACE3("HDisplay=%d, VDisplay=%d\n", mode->HDisplay, mode->VDisplay); 387 if ( vbox_device_available(VBOXGetRec(pScrn)) 387 /* We always like modes specified by the user in the configuration 388 * file, as doing otherwise is likely to annoy people. */ 389 if ( !(mode->type & M_T_USERDEF) 390 && vbox_device_available(VBOXGetRec(pScrn)) 388 391 && !vboxHostLikesVideoMode(pScrn, mode->HDisplay, mode->VDisplay, 389 392 pScrn->bitsPerPixel) … … 414 417 static void 415 418 vbox_output_add_mode (DisplayModePtr *pModes, const char *pszName, int x, int y, 416 Bool isPreferred )419 Bool isPreferred, Bool isUserDef) 417 420 { 418 421 TRACE3("pszName=%s, x=%d, y=%d\n", pszName, x, y); … … 420 423 421 424 pMode->status = MODE_OK; 422 pMode->type = isPreferred ? M_T_PREFERRED : M_T_BUILTIN; 425 /* We don't ask the host whether it likes user defined modes, 426 * as we assume that the user really wanted that mode. */ 427 pMode->type = isUserDef ? M_T_USERDEF : M_T_BUILTIN; 428 if (isPreferred) 429 pMode->type |= M_T_PREFERRED; 423 430 /* VBox only supports screen widths which are a multiple of 8 */ 424 431 pMode->HDisplay = (x + 7) & ~7; … … 444 451 uint32_t x, y, bpp, display; 445 452 bool rc; 453 unsigned i; 446 454 DisplayModePtr pModes = NULL; 447 455 ScrnInfoPtr pScrn = output->scrn; … … 460 468 /* We prefer a slightly smaller size to a slightly larger one */ 461 469 x -= (x % 8); 462 vbox_output_add_mode(&pModes, NULL, x, y, TRUE );470 vbox_output_add_mode(&pModes, NULL, x, y, TRUE, FALSE); 463 471 } 464 472 } 473 /* Also report any modes the user may have requested in the xorg.conf 474 * configuration file. */ 475 for (i = 0; pScrn->display->modes[i] != NULL; i++) 476 if (2 == sscanf(pScrn->display->modes[i], "%dx%d", &x, &y)) 477 vbox_output_add_mode(&pModes, pScrn->display->modes[i], x, y, 478 FALSE, TRUE); 465 479 TRACE2; 466 480 return pModes;
Note:
See TracChangeset
for help on using the changeset viewer.