xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #163: dummy-constant-dpi-option-ifdefed.diff

File dummy-constant-dpi-option-ifdefed.diff, 1.9 KB (added by Antoine Martin, 8 years ago)

same but with ifdef around randr code so dummy can be built without randr

  • src/dummy.h

    diff --git a/src/dummy.h b/src/dummy.h
    index c3fdd6e..7e7e0aa 100644
    a b typedef struct dummyRec 
    5151    /* options */
    5252    OptionInfoPtr Options;
    5353    Bool swCursor;
     54    Bool constantDPI;
    5455    /* proc pointer */
    5556    CloseScreenProcPtr CloseScreen;
    5657    xf86CursorInfoPtr CursorInfo;
  • src/dummy_driver.c

    diff --git a/src/dummy_driver.c b/src/dummy_driver.c
    index 6062c39..cd29aa7 100644
    a b  
    3434#include <X11/extensions/Xv.h>
    3535#endif
    3636
     37#ifdef RANDR
     38#include "randrstr.h"
     39#endif
     40
    3741/*
    3842 * Driver data structures.
    3943 */
    static SymTabRec DUMMYChipsets[] = { 
    118122};
    119123
    120124typedef enum {
    121     OPTION_SW_CURSOR
     125    OPTION_SW_CURSOR,
     126    OPTION_CONSTANT_DPI
    122127} DUMMYOpts;
    123128
    124129static const OptionInfoRec DUMMYOptions[] = {
    125130    { OPTION_SW_CURSOR, "SWcursor",     OPTV_BOOLEAN,   {0}, FALSE },
     131#ifdef RANDR
     132    { OPTION_CONSTANT_DPI,      "ConstantDPI",  OPTV_BOOLEAN,   {0}, FALSE },
     133#endif
    126134    { -1,                  NULL,           OPTV_NONE,   {0}, FALSE }
    127135};
    128136
    DUMMYPreInit(ScrnInfoPtr pScrn, int flags) 
    362370    xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, dPtr->Options);
    363371
    364372    xf86GetOptValBool(dPtr->Options, OPTION_SW_CURSOR,&dPtr->swCursor);
     373    xf86GetOptValBool(dPtr->Options, OPTION_CONSTANT_DPI, &dPtr->constantDPI);
    365374
    366375    if (device->videoRam != 0) {
    367376        pScrn->videoRam = device->videoRam;
    Bool 
    666675DUMMYSwitchMode(SWITCH_MODE_ARGS_DECL)
    667676{
    668677    SCRN_INFO_PTR(arg);
    669     return dummyModeInit(pScrn, mode);
     678    if (!dummyModeInit(pScrn, mode))
     679        return FALSE;
     680#ifdef RANDR
     681    DUMMYPtr dPtr = DUMMYPTR(pScrn);
     682    if (dPtr->constantDPI) {
     683        pScrn->pScreen->mmWidth = mode->HDisplay * 254 / 960;
     684        pScrn->pScreen->mmHeight = mode->VDisplay * 254 / 960;
     685        RRScreenSizeNotify(pScrn->pScreen);
     686        RRTellChanged(pScrn->pScreen);
     687    }
     688#endif
     689    return TRUE;
    670690}
    671691
    672692/* Mandatory */