[Sugar-devel] [PATCH sugar] Launcher: set the standard SPLASHSCREEN hint instead of our own _SUGAR_WINDOW_TYPE hint

Simon Schampijer simon at schampijer.de
Thu Aug 23 13:19:50 EDT 2012


From: Simon Schampijer <simon at laptop.org>

Currently we have issues with introspecting gdk_property_get and we already
have a wrapper around gdk_property_change [1]. We discussed reimplementing
the toolkit wm module in C, and provide the following functions:

get_activity_id
get_bundle_id
set_activity_id
set_bundle_id

To prepare for this move we want to remove our own _SUGAR_WINDOW_TYPE
hint and replace it with the standard SPLASHSCREEN one [2][3], which is
done in this patch.

[1] http://wiki.sugarlabs.org/go/Features/GTK3/Shell#gdk_property_change
[2] http://www.pygtk.org/docs/pygtk/gdk-constants.html#gdk-window-type-hint-constants
[3] http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html

Signed-off-by: Simon Schampijer <simon at laptop.org>
---
 src/jarabe/model/shell.py   | 8 +++++---
 src/jarabe/view/launcher.py | 4 +---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/jarabe/model/shell.py b/src/jarabe/model/shell.py
index 31605f7..1f3ee8d 100644
--- a/src/jarabe/model/shell.py
+++ b/src/jarabe/model/shell.py
@@ -521,7 +521,8 @@ class ShellModel(gobject.GObject):
            them.
 
          """
-        if window.get_window_type() == wnck.WINDOW_NORMAL:
+        if window.get_window_type() == wnck.WINDOW_NORMAL or \
+                window.get_window_type() == wnck.WINDOW_SPLASHSCREEN:
             home_activity = None
 
             activity_id = wm.get_activity_id(window)
@@ -552,7 +553,7 @@ class ShellModel(gobject.GObject):
                 logging.debug('window registered for %s', activity_id)
                 home_activity.add_window(window)
 
-            if wm.get_sugar_window_type(window) != 'launcher' \
+            if window.get_window_type() != wnck.WINDOW_SPLASHSCREEN \
                     and home_activity.get_launch_status() == Activity.LAUNCHING:
                 self.emit('launch-completed', home_activity)
                 startup_time = time.time() - home_activity.get_launch_time()
@@ -563,7 +564,8 @@ class ShellModel(gobject.GObject):
                 self._set_active_activity(home_activity)
 
     def _window_closed_cb(self, screen, window):
-        if window.get_window_type() == wnck.WINDOW_NORMAL:
+        if window.get_window_type() == wnck.WINDOW_NORMAL or \
+                window.get_window_type() == wnck.WINDOW_SPLASHSCREEN:
             xid = window.get_xid()
             activity = self._get_activity_by_xid(xid)
             if activity is not None:
diff --git a/src/jarabe/view/launcher.py b/src/jarabe/view/launcher.py
index 5c645c4..e9f81d7 100644
--- a/src/jarabe/view/launcher.py
+++ b/src/jarabe/view/launcher.py
@@ -32,7 +32,7 @@ class LaunchWindow(gtk.Window):
     def __init__(self, activity_id, icon_path, icon_color):
         gobject.GObject.__init__(self)
 
-        self.props.type_hint = gtk.gdk.WINDOW_TYPE_HINT_NORMAL
+        self.props.type_hint = gtk.gdk.WINDOW_TYPE_HINT_SPLASHSCREEN
         self.props.decorated = False
         self.modify_bg(gtk.STATE_NORMAL, style.COLOR_WHITE.get_gdk_color())
 
@@ -94,8 +94,6 @@ class LaunchWindow(gtk.Window):
 
     def __realize_cb(self, widget):
         wm.set_activity_id(widget.window, str(self._activity_id))
-        widget.window.property_change('_SUGAR_WINDOW_TYPE', 'STRING', 8,
-                                      gtk.gdk.PROP_MODE_REPLACE, 'launcher')
 
     def __size_changed_cb(self, screen):
         self._update_size()
-- 
1.7.11.4



More information about the Sugar-devel mailing list