Changes

Jump to navigation Jump to search
Line 200: Line 200:  
New way:
 
New way:
   −
  success, keyval, effective_group, level, consumed_modifiers = self.keymap.translate_keyboard_state(key['key-scan'], self.active_state, self.active_group)
+
  success, keyval, effective_group, level, consumed_modifiers = \
 
+
    self.keymap.translate_keyboard_state(key['key-scan'], self.active_state,
 +
                                          self.active_group)
    
== 'expose-event' & 'draw' event ==
 
== 'expose-event' & 'draw' event ==
Line 223: Line 224:  
  # Hack to get the current modifier state - which will not be represented by the event.
 
  # Hack to get the current modifier state - which will not be represented by the event.
 
  state = gtk.gdk.device_get_core_pointer().get_state(self.window)[1]
 
  state = gtk.gdk.device_get_core_pointer().get_state(self.window)[1]
 +
 +
 +
* I used a HACK related to Pango fonts and DPI:
 +
 +
<pre>
 +
# Set correct DPI for Rsvg and Screen
 +
from gi.repository import PangoCairo
 +
 +
def _get_screen_dpi():
 +
    xft_dpi = Gtk.Settings.get_default().get_property('gtk-xft-dpi')
 +
    dpi = float(xft_dpi / 1024)
 +
    logging.debug('Setting dpi to: %f', dpi)
 +
    # HACK: if the DPI detected is 200.0 it seems we are on an XO, so
 +
    # we return 133 because the XO manage its resolution in a complex
 +
    # way. More information here:
 +
    #    http://wiki.laptop.org/go/Display
 +
    if 200 == int(dpi):
 +
        return 133
 +
    return dpi
 +
 +
dpi = _get_screen_dpi()
 +
font_map_default = PangoCairo.font_map_get_default()
 +
font_map_default.set_resolution(dpi)
 +
</pre>
    
= Missing / problematic things =
 
= Missing / problematic things =
Line 233: Line 258:     
* [<span style="color: green;">SOLVED</span>] <del>Font Scale is wrong: https://bugzilla.gnome.org/show_bug.cgi?id=680663</del>
 
* [<span style="color: green;">SOLVED</span>] <del>Font Scale is wrong: https://bugzilla.gnome.org/show_bug.cgi?id=680663</del>
 +
 +
* SHIFT and ALT GR keys do not show the correct keys
    
= Useful links =
 
= Useful links =
266

edits

Navigation menu