Ticket #10453: xserver-1.6.99-randr-rotate-displaysize.patch

File xserver-1.6.99-randr-rotate-displaysize.patch, 1.7 kB (added by jnettlet, 4 years ago)

When Rotating change screen dimensions if in the 90/270 rotation

  • randr/rrscreen.c

    From adad905d5cb839a4f31597a48c123bf468aaef75 Mon Sep 17 00:00:00 2001
    From: Jon Nettleton <jon.nettleton@gmail.com>
    Date: Thu, 16 Dec 2010 13:03:12 -0800
    Subject: [PATCH] Change physical screen dimensions when rotating
    
    If the physical screen dimensions are not changed when applying
    a rotated mode then the DPI is calculated in correctly.  Most
    configs do not set this so the default calculated DPI is fine,
    however configs that set a custom DisplaySize need this change
    to preserve the DPI.
    ---
     randr/rrscreen.c |    9 +++++++--
     1 files changed, 7 insertions(+), 2 deletions(-)
    
    diff --git a/randr/rrscreen.c b/randr/rrscreen.c
    index e7eb75c..c53bd54 100644
    a b  
    766766    RRModePtr               mode; 
    767767    RR10DataPtr             pData = NULL; 
    768768    RRScreenSizePtr         pSize; 
    769     int                     width, height; 
     769    int                     width, height, mmWidth, mmHeight; 
    770770     
    771771    UpdateCurrentTime (); 
    772772 
     
    916916     */ 
    917917    width = mode->mode.width; 
    918918    height = mode->mode.height; 
     919    mmWidth = pScreen->mmWidth; 
     920    mmHeight = pScreen->mmHeight; 
     921 
    919922    if (rotation & (RR_Rotate_90|RR_Rotate_270)) 
    920923    { 
    921924        width = mode->mode.height; 
    922925        height = mode->mode.width; 
     926        mmWidth = pScreen->mmHeight; 
     927        mmHeight = pScreen->mmWidth; 
    923928    } 
    924929    if (width != pScreen->width || height != pScreen->height) 
    925930    { 
     
    936941            } 
    937942        } 
    938943        if (!RRScreenSizeSet (pScreen, width, height, 
    939                               pScreen->mmWidth, pScreen->mmHeight)) 
     944                              mmWidth, mmHeight)) 
    940945        { 
    941946            rep.status = RRSetConfigFailed; 
    942947            /* XXX recover from failure */