Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* fix cython warning: don't pretend that we initialize the structure
* handle errors in XkbGetState and return an empty string

git-svn-id: https://xpra.org/svn/Xpra/trunk@14570 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Dec 19, 2016
1 parent 5009cce commit be708a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/xpra/x11/bindings/keyboard_bindings.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,10 @@ cdef class _X11KeyboardBindings(_X11CoreBindings):
return self.get_layout_group()

def get_layout_group(self):
cdef XkbStateRec xkb_state = XkbStateRec()
XkbGetState(self.display, XkbUseCoreKbd, &xkb_state)
cdef XkbStateRec xkb_state
if not XkbGetState(self.display, XkbUseCoreKbd, &xkb_state):
log.warn("Warning: cannot get keyboard layout group")
return ""
return xkb_state.group

def hasXkb(self):
Expand Down

0 comments on commit be708a0

Please sign in to comment.