Ticket #870: 0001-Flickering-and-unknown-icons-in-the-window-bar-870.patch

File 0001-Flickering-and-unknown-icons-in-the-window-bar-870.patch, 7.1 KB (added by alsroot, 8 years ago)

sucrose-0.88 patch, needs to de midified to apply to the trunk

  • src/jarabe/desktop/activitieslist.py

    From d51ef4d0a24c26f5e4ca6eeb8233c96f4bf96caa Mon Sep 17 00:00:00 2001
    From: Aleksey Lim <alsroot@member.fsf.org>
    Date: Thu, 20 Jan 2011 20:15:01 +0000
    Subject: [PATCH sugar] Flickering and unknown icons in the window bar #870
    
    ---
     src/jarabe/desktop/activitieslist.py |    3 ++-
     src/jarabe/desktop/favoritesview.py  |    1 +
     src/jarabe/desktop/meshbox.py        |    1 +
     src/jarabe/frame/activitiestray.py   |    1 +
     src/jarabe/journal/misc.py           |    4 ++--
     src/jarabe/model/shell.py            |    9 ++++-----
     src/jarabe/view/launcher.py          |    9 ++++++---
     src/jarabe/view/palettes.py          |    1 +
     8 files changed, 18 insertions(+), 11 deletions(-)
    
    diff --git a/src/jarabe/desktop/activitieslist.py b/src/jarabe/desktop/activitieslist.py
    index c3a0775..cf5c131 100644
    a b class ActivitiesTreeView(gtk.TreeView): 
    149149        client = gconf.client_get_default()
    150150        xo_color = XoColor(client.get_string('/desktop/sugar/user/color'))
    151151
    152         launcher.add_launcher(activity_id, bundle.get_icon(), xo_color)
     152        launcher.add_launcher(activity_id,
     153                bundle.get_bundle_id(), bundle.get_icon(), xo_color)
    153154        activityfactory.create(bundle, ActivityHandle(activity_id))
    154155
    155156    def set_filter(self, query):
  • src/jarabe/desktop/favoritesview.py

    diff --git a/src/jarabe/desktop/favoritesview.py b/src/jarabe/desktop/favoritesview.py
    index c59335a..2219be3 100644
    a b class ActivityIcon(CanvasIcon): 
    492492
    493493            activity_id = activityfactory.create_activity_id()
    494494            launcher.add_launcher(activity_id,
     495                                  self._activity_info.get_bundle_id(),
    495496                                  self._activity_info.get_icon(),
    496497                                  xo_color)
    497498
  • src/jarabe/desktop/meshbox.py

    diff --git a/src/jarabe/desktop/meshbox.py b/src/jarabe/desktop/meshbox.py
    index fb4be4e..621d4b2 100644
    a b class ActivityView(hippo.CanvasBox): 
    829829        bundle = bundleregistry.get_registry().get_bundle(bundle_id)
    830830
    831831        launcher.add_launcher(self._model.get_id(),
     832                              bundle.get_bundle_id(),
    832833                              bundle.get_icon(),
    833834                              self._model.get_color())
    834835
  • src/jarabe/frame/activitiestray.py

    diff --git a/src/jarabe/frame/activitiestray.py b/src/jarabe/frame/activitiestray.py
    index 370572c..b20ff8e 100644
    a b class ActivityInviteButton(BaseInviteButton): 
    183183        bundle = registry.get_bundle(self._bundle_id)
    184184
    185185        launcher.add_launcher(self._activity_model.get_id(),
     186                              bundle.get_bundle_id(),
    186187                              bundle.get_icon(),
    187188                              self._activity_model.get_color())
    188189
  • src/jarabe/journal/misc.py

    diff --git a/src/jarabe/journal/misc.py b/src/jarabe/journal/misc.py
    index 4a2211f..0ad70e3 100644
    a b def resume(metadata, bundle_id=None): 
    231231            object_id = model.copy(metadata, '/')
    232232
    233233        if activity_id:
    234             launcher.add_launcher(activity_id, bundle.get_icon(),
    235                     get_icon_color(metadata))
     234            launcher.add_launcher(activity_id, bundle.get_bundle_id(),
     235                    bundle.get_icon(), get_icon_color(metadata))
    236236            handle = ActivityHandle(object_id=object_id,
    237237                                    activity_id=activity_id)
    238238            activityfactory.create(bundle, handle)
  • src/jarabe/model/shell.py

    diff --git a/src/jarabe/model/shell.py b/src/jarabe/model/shell.py
    index b9cb0c2..f99af2d 100644
    a b class ShellModel(gobject.GObject): 
    601601                             " was not found in the bundle registry."
    602602                             % service_name)
    603603        home_activity = Activity(activity_info, activity_id)
    604         self._add_activity(home_activity)
    605 
    606         self._set_active_activity(home_activity)
    607 
    608         self.emit('launch-started', home_activity)
     604        if home_activity is None:
     605            self._add_activity(home_activity)
     606            self._set_active_activity(home_activity)
     607            self.emit('launch-started', home_activity)
    609608
    610609        # FIXME: better learn about finishing processes by receiving a signal.
    611610        # Now just check whether an activity has a window after ~90sec
  • src/jarabe/view/launcher.py

    diff --git a/src/jarabe/view/launcher.py b/src/jarabe/view/launcher.py
    index 89251e5..1e73549 100644
    a b from jarabe.view.pulsingicon import CanvasPulsingIcon 
    3232
    3333class LaunchWindow(gtk.Window):
    3434
    35     def __init__(self, activity_id, icon_path, icon_color):
     35    def __init__(self, activity_id, bundle_id, icon_path, icon_color):
    3636        gobject.GObject.__init__(self)
    3737
    3838        self.props.type_hint = gtk.gdk.WINDOW_TYPE_HINT_NORMAL
    class LaunchWindow(gtk.Window): 
    5151        canvas.pack_start(header, expand=False)
    5252
    5353        self._activity_id = activity_id
     54        self._bundle_id = bundle_id
    5455        self._box = LaunchBox(activity_id, icon_path, icon_color)
    5556        box = hippo.Canvas()
    5657        box.modify_bg(gtk.STATE_NORMAL, style.COLOR_WHITE.get_gdk_color())
    class LaunchWindow(gtk.Window): 
    8889        self.resize(gtk.gdk.screen_width(), gtk.gdk.screen_height())
    8990
    9091    def __realize_cb(self, widget):
     92        wm.set_bundle_id(widget.window, str(self._bundle_id))
    9193        wm.set_activity_id(widget.window, str(self._activity_id))
    9294        widget.window.property_change('_SUGAR_WINDOW_TYPE', 'STRING', 8,
    9395                                      gtk.gdk.PROP_MODE_REPLACE, 'launcher')
    def setup(): 
    163165    model.connect('launch-completed', __launch_completed_cb)
    164166
    165167
    166 def add_launcher(activity_id, icon_path, icon_color):
     168def add_launcher(activity_id, bundle_id, icon_path, icon_color):
    167169    model = shell.get_model()
    168170
    169171    if model.get_launcher(activity_id) is not None:
    170172        return
    171173
    172     launch_window = LaunchWindow(activity_id, icon_path, icon_color)
     174    launch_window = LaunchWindow(activity_id, bundle_id, icon_path, icon_color)
    173175    launch_window.show()
    174176
    175177    model.register_launcher(activity_id, launch_window)
    def add_launcher(activity_id, icon_path, icon_color): 
    177179
    178180def __launch_started_cb(home_model, home_activity):
    179181    add_launcher(home_activity.get_activity_id(),
     182            home_activity.get_bundle_id(),
    180183            home_activity.get_icon_path(), home_activity.get_icon_color())
    181184
    182185
  • src/jarabe/view/palettes.py

    diff --git a/src/jarabe/view/palettes.py b/src/jarabe/view/palettes.py
    index 5994c3d..f93399e 100644
    a b class ActivityPalette(Palette): 
    154154
    155155        activity_id = activityfactory.create_activity_id()
    156156        launcher.add_launcher(activity_id,
     157                              self._activity_info.get_bundle_id(),
    157158                              self._activity_info.get_icon(),
    158159                              xo_color)
    159160