diff --git a/src/dummy.h b/src/dummy.h
index c3fdd6e..7e7e0aa 100644
a
|
b
|
typedef struct dummyRec |
51 | 51 | /* options */ |
52 | 52 | OptionInfoPtr Options; |
53 | 53 | Bool swCursor; |
| 54 | Bool constantDPI; |
54 | 55 | /* proc pointer */ |
55 | 56 | CloseScreenProcPtr CloseScreen; |
56 | 57 | xf86CursorInfoPtr CursorInfo; |
diff --git a/src/dummy_driver.c b/src/dummy_driver.c
index 6062c39..fef0c57 100644
a
|
b
|
|
34 | 34 | #include <X11/extensions/Xv.h> |
35 | 35 | #endif |
36 | 36 | |
| 37 | #ifdef RANDR |
| 38 | #include "randrstr.h" |
| 39 | #define CONSTANT_DPI 96 |
| 40 | #endif |
| 41 | |
37 | 42 | /* |
38 | 43 | * Driver data structures. |
39 | 44 | */ |
… |
… |
static SymTabRec DUMMYChipsets[] = { |
118 | 123 | }; |
119 | 124 | |
120 | 125 | typedef enum { |
121 | | OPTION_SW_CURSOR |
| 126 | OPTION_SW_CURSOR, |
| 127 | OPTION_CONSTANT_DPI |
122 | 128 | } DUMMYOpts; |
123 | 129 | |
124 | 130 | static const OptionInfoRec DUMMYOptions[] = { |
125 | 131 | { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, |
| 132 | #ifdef RANDR |
| 133 | { OPTION_CONSTANT_DPI, "ConstantDPI", OPTV_BOOLEAN, {0}, FALSE }, |
| 134 | #endif |
126 | 135 | { -1, NULL, OPTV_NONE, {0}, FALSE } |
127 | 136 | }; |
128 | 137 | |
… |
… |
DUMMYPreInit(ScrnInfoPtr pScrn, int flags) |
362 | 371 | xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, dPtr->Options); |
363 | 372 | |
364 | 373 | xf86GetOptValBool(dPtr->Options, OPTION_SW_CURSOR,&dPtr->swCursor); |
| 374 | xf86GetOptValBool(dPtr->Options, OPTION_CONSTANT_DPI, &dPtr->constantDPI); |
365 | 375 | |
366 | 376 | if (device->videoRam != 0) { |
367 | 377 | pScrn->videoRam = device->videoRam; |
… |
… |
Bool |
666 | 676 | DUMMYSwitchMode(SWITCH_MODE_ARGS_DECL) |
667 | 677 | { |
668 | 678 | SCRN_INFO_PTR(arg); |
669 | | return dummyModeInit(pScrn, mode); |
| 679 | if (!dummyModeInit(pScrn, mode)) |
| 680 | return FALSE; |
| 681 | #ifdef RANDR |
| 682 | DUMMYPtr dPtr = DUMMYPTR(pScrn); |
| 683 | if (dPtr->constantDPI) { |
| 684 | pScrn->pScreen->mmWidth = mode->HDisplay * 254 / CONSTANT_DPI /10; |
| 685 | pScrn->pScreen->mmHeight = mode->VDisplay * 254 / CONSTANT_DPI /10; |
| 686 | RRScreenSizeNotify(pScrn->pScreen); |
| 687 | RRTellChanged(pScrn->pScreen); |
| 688 | } |
| 689 | #endif |
| 690 | return TRUE; |
670 | 691 | } |
671 | 692 | |
672 | 693 | /* Mandatory */ |