[Sugar-devel] [PATCH 1/2] Avoid Escape key disable fullscreen mode

Manuel Kaufmann humitos at gmail.com
Tue Mar 20 13:57:33 EDT 2012


This commit disconnect the __key_press_cb callback used in
sugar.graphics.window.Window to handle the Key Press event and connect a new
__key_press_cb callback (inside TerminalActivity) to manage the Escape key
properly and send this key to the vte module (Virtual Terminal)

This solves ticket: #440
  - http://bugs.sugarlabs.org/ticket/440
---
 terminal.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/terminal.py b/terminal.py
index 77001ea..aed612a 100644
--- a/terminal.py
+++ b/terminal.py
@@ -53,6 +53,11 @@ class TerminalActivity(activity.Activity):
     def __init__(self, handle):
         activity.Activity.__init__(self, handle)
 
+        # HACK to avoid Escape key disable fullscreen mode on Terminal Activity
+        # This is related with http://bugs.sugarlabs.org/ticket/440
+        self.disconnect_by_func(self._Window__key_press_cb)
+        self.connect('key-press-event', self.__key_press_cb)
+
         self.max_participants = 1
 
         toolbar_box = ToolbarBox()
-- 
1.7.9.1



More information about the Sugar-devel mailing list