예제 #1
0
파일: rdprandr.c 프로젝트: mario911/xrdp-ng
Bool rdpRRRegisterSize(ScreenPtr pScreen, int width, int height)
{
	int mmwidth;
	int mmheight;
	RRScreenSizePtr pSize;

	ErrorF("rdpRRRegisterSize: width %d height %d\n", width, height);
	mmwidth = PixelToMM(width);
	mmheight = PixelToMM(height);
	pSize = RRRegisterSize(pScreen, width, height, mmwidth, mmheight);
	/* Tell RandR what the current config is */
	RRSetCurrentConfig(pScreen, RR_Rotate_0, 0, pSize);
	return TRUE;
}
예제 #2
0
파일: rdpup.c 프로젝트: kevinzhou2012/xrdp
/*
    this from miScreenInit
    pScreen->mmWidth = (xsize * 254 + dpix * 5) / (dpix * 10);
    pScreen->mmHeight = (ysize * 254 + dpiy * 5) / (dpiy * 10);
*/
static int
process_screen_size_msg(int width, int height, int bpp, int rfx)
{
  RRScreenSizePtr pSize;
  int mmwidth;
  int mmheight;
  Bool ok;

  DEBUG_OUT_UP(("process_screen_size_msg: set width %d height %d bpp %d rfx %d\n",
         width, height, bpp, rfx));
  g_rdpScreen.rdp_width = width;
  g_rdpScreen.rdp_height = height;
  g_rdpScreen.rdp_bpp = bpp;
  g_rdpScreen.rfx = rfx;
  if (bpp < 15)
  {
    g_rdpScreen.rdp_Bpp = 1;
    g_rdpScreen.rdp_Bpp_mask = 0xff;
  }
  else if (bpp == 15)
  {
    g_rdpScreen.rdp_Bpp = 2;
    g_rdpScreen.rdp_Bpp_mask = 0x7fff;
  }
  else if (bpp == 16)
  {
    g_rdpScreen.rdp_Bpp = 2;
    g_rdpScreen.rdp_Bpp_mask = 0xffff;
  }
  else if (bpp > 16)
  {
    g_rdpScreen.rdp_Bpp = 4;
    g_rdpScreen.rdp_Bpp_mask = 0xffffff;
  }
  mmwidth = PixelToMM(width);
  mmheight = PixelToMM(height);

  pSize = RRRegisterSize(g_pScreen, width, height, mmwidth, mmheight);
  RRSetCurrentConfig(g_pScreen, RR_Rotate_0, 0, pSize);
  if ((g_rdpScreen.width != width) || (g_rdpScreen.height != height))
  {
    ErrorF("  calling RRScreenSizeSet\n");
    ok = RRScreenSizeSet(g_pScreen, width, height, mmwidth, mmheight);
    ErrorF("  RRScreenSizeSet ok=[%d]\n", ok);
  }
  return 0;
}