Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added to check the input purpose for gnome-shell password dialog.
  • Loading branch information
fujiwarat committed Aug 30, 2013
1 parent 8689214 commit 6aae0a9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions engine/engine.py
Expand Up @@ -126,6 +126,10 @@ def __init__(self, bus, object_path):
# init state
self.__idle_id = 0
self.__prop_dict = {}
self.__input_purpose = 0
self.__has_input_purpose = False
if hasattr(IBus, 'InputPurpose'):
self.__has_input_purpose = True
try:
self.__is_utf8 = (getpreferredencoding().lower() == 'utf-8')
except:
Expand Down Expand Up @@ -963,11 +967,17 @@ def do_focus_in(self):
self.__lookup_table.set_page_size(size)

def do_focus_out(self):
if self.__has_input_purpose:
self.__input_purpose = 0
mode = self.__prefs.get_value('common', 'behavior_on_focus_out')
if mode == 0 or mode == 1:
self.__reset()
self.__invalidate()

def do_set_content_type(self, purpose, hints):
if self.__has_input_purpose:
self.__input_purpose = purpose

def do_disable(self):
self.__reset()
self.__invalidate()
Expand Down Expand Up @@ -1807,6 +1817,10 @@ def T2():
return True

def __process_key_event_internal2(self, keyval, keycode, state):
if self.__has_input_purpose and \
self.__input_purpose == IBus.InputPurpose.PASSWORD:
return False

if Engine.__typing_mode == jastring.TYPING_MODE_THUMB_SHIFT and \
Engine.__input_mode not in [INPUT_MODE_LATIN, INPUT_MODE_WIDE_LATIN]:
return self.process_key_event_thumb(keyval, keycode, state)
Expand Down

0 comments on commit 6aae0a9

Please sign in to comment.