#10453 NORM 10.1.3: DPI is wrong when screen rotated sideways

Zarro Boogs per Child bugtracker at laptop.org
Mon Dec 20 09:43:45 EST 2010


#10453: DPI is wrong when screen rotated sideways
---------------------------------------+------------------------------------
           Reporter:  greenfeld        |       Owner:  cjb                              
               Type:  defect           |      Status:  new                              
           Priority:  normal           |   Milestone:  10.1.3                           
          Component:  x window system  |     Version:  Development build as of this date
         Resolution:                   |    Keywords:                                   
        Next_action:  test in build    |    Verified:  0                                
Deployment_affected:                   |   Blockedby:                                   
           Blocking:  9350             |  
---------------------------------------+------------------------------------

Comment(by godiard):

 The dpi setting in Browse is calculated in /usr/lib/python2.6/site-
 packages/hulahop/__init__.py

 {{{
 def _get_layout_dpi():
     gtk_xft_dpi = gtk.settings_get_default().get_property('gtk-xft-dpi')
     screen_dpi = gtk_xft_dpi / 1024
     screen_width = gtk.gdk.screen_width()

     if screen_dpi != _XO_DPI or screen_width != 1200:
         return -1
     # Layout:
     # 1024x768 -> (96 * 6) / 1024 * 201 = 113 dpi
     # 800x600  -> (96 * 6) /  800 * 201 = 144 dpi
     #
     # Fonts:
     # 7  pt ->  7 / 12 * 201 = 117 dpi
     # 8  pt ->  8 / 12 * 201 = 134 dpi
     # 9  pt ->  9 / 12 * 201 = 150 dpi

     return 134
 }}}

 The screen dpi is changing and screen_width is not 1200, then
 _get_layout_dpi() returns -1

 The code is black magic, but I tried commenting the first lines to ever
 return 134 and the problem goes away.

-- 
Ticket URL: <http://dev.laptop.org/ticket/10453#comment:23>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system


More information about the Bugs mailing list