Skip to content

Commit

Permalink
catch GTK3 bug parsing key event string and continue as best we can a…
Browse files Browse the repository at this point in the history
…fter printing a warning

git-svn-id: https://xpra.org/svn/Xpra/trunk@20421 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 16, 2018
1 parent babc769 commit d49e84f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/xpra/client/gtk_base/gtk_client_window_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@


from xpra.os_util import bytestostr, is_X11, WIN32, OSX, POSIX, PYTHON3
from xpra.util import (AdHocStruct, typedict, envint, envbool, nonl, csv,
from xpra.util import (AdHocStruct, typedict, envint, envbool, nonl, csv, first_time,
WORKSPACE_UNSET, WORKSPACE_ALL, WORKSPACE_NAMES, MOVERESIZE_DIRECTION_STRING, SOURCE_INDICATION_STRING,
MOVERESIZE_CANCEL,
MOVERESIZE_SIZE_TOPLEFT, MOVERESIZE_SIZE_TOP, MOVERESIZE_SIZE_TOPRIGHT,
Expand Down Expand Up @@ -1871,7 +1871,13 @@ def parse_key_event(self, event, pressed):
key_event.keyval = keyval or 0
key_event.keycode = keycode
key_event.group = event.group
key_event.string = event.string or ""
try:
key_event.string = event.string or ""
except UnicodeDecodeError as e:
if first_time("key-%s-%s" % (keycode, keyname)):
keylog.warn("Warning: failed to parse string for key")
keylog.warn(" keyname=%s, keycode=%s", keyname, keycode)
key_event.string = ""
key_event.pressed = pressed
keylog("parse_key_event(%s, %s)=%s", event, pressed, key_event)
return key_event
Expand Down

0 comments on commit d49e84f

Please sign in to comment.