[Sugar-devel] [PATCH Read] Show TopBar (fullscreen mode)

Sascha Silbe silbe at activitycentral.com
Thu Feb 24 11:17:02 EST 2011


Since Sugar 0.86 (commit 76542527) fullscreen mode for activities works a bit
differently. We're not fullscreen in an X11 (window manager) sense anymore,
but rather hide some of our widgets. This caused the logic to detect
fullscreen mode not to trigger and thus not to show the TopBar.

Signed-off-by: Sascha Silbe <silbe at activitycentral.com>
---
 readactivity.py |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/readactivity.py b/readactivity.py
index 9904910..d486f0c 100644
--- a/readactivity.py
+++ b/readactivity.py
@@ -143,7 +143,6 @@ class ReadActivity(activity.Activity):
 
         self.connect('key-press-event', self._key_press_event_cb)
         self.connect('key-release-event', self._key_release_event_cb)
-        self.connect('window-state-event', self._window_state_event_cb)
 
         _logger.debug('Starting Read...')
 
@@ -340,6 +339,14 @@ class ReadActivity(activity.Activity):
         #else:
         #    self._load_document('file:///home/smcv/tmp/test.pdf')
 
+    def fullscreen(self):
+        self._topbar.show_all()
+        activity.Activity.fullscreen(self)
+
+    def unfullscreen(self):
+        self._topbar.hide()
+        activity.Activity.unfullscreen(self)
+
     def _create_back_button(self):
         back = ToolButton('go-previous')
         back.set_tooltip(_('Back'))
@@ -958,15 +965,6 @@ class ReadActivity(activity.Activity):
         #_logger.debug("Keyname Release: %s, time: %s", keyname, event.time)
         return False
 
-    def _window_state_event_cb(self, window, event):
-        if not (event.changed_mask & gtk.gdk.WINDOW_STATE_FULLSCREEN):
-            return False
-
-        if event.new_window_state & gtk.gdk.WINDOW_STATE_FULLSCREEN:
-            self._topbar.show_all()
-        else:
-            self._topbar.hide()
-
     def __view_toolbar_needs_update_size_cb(self, view_toolbar):
         if hasattr(self._view, 'update_view_size'):
             self._view.update_view_size(self._scrolled)
-- 
1.7.2.3



More information about the Sugar-devel mailing list