Ticket #461: 0001-Take-into-account-launcher-windows-when-checking-if.patch

File 0001-Take-into-account-launcher-windows-when-checking-if.patch, 1.8 KB (added by tomeu, 15 years ago)
  • src/jarabe/model/shell.py

    From de60d50faa3db1170cb811426c96921702decffd Mon Sep 17 00:00:00 2001
    From: Tomeu Vizoso <tomeu@sugarlabs.org>
    Date: Sun, 5 Apr 2009 18:36:05 +0200
    Subject: [PATCH] Take into account launcher windows when checking if an already instance is running #461
    
    ---
     src/jarabe/model/shell.py  |    2 +-
     src/jarabe/view/service.py |    9 +++++++--
     2 files changed, 8 insertions(+), 3 deletions(-)
    
    diff --git a/src/jarabe/model/shell.py b/src/jarabe/model/shell.py
    index cfc49ab..709eb03 100644
    a b class Activity(gobject.GObject): 
    7777        self._activity_id = activity_id
    7878        self._activity_info = activity_info
    7979        self._launch_time = time.time()
    80         self._launching = False
     80        self._launching = True
    8181
    8282        if window is not None:
    8383            self.set_window(window)
  • src/jarabe/view/service.py

    diff --git a/src/jarabe/view/service.py b/src/jarabe/view/service.py
    index a2439ce..df00ba6 100644
    a b class UIService(dbus.service.Object): 
    8080    @dbus.service.method(_DBUS_SHELL_IFACE,
    8181                         in_signature="s", out_signature="b")
    8282    def ActivateActivity(self, activity_id):
     83        """Switch to the window related to this activity_id and return a boolean
     84        indicating if there is a real (ie. not a launcher window) activity
     85        already open.
     86        """
    8387        activity = self._shell_model.get_activity_by_id(activity_id)
    84         if activity:
     88
     89        if activity is not None and activity.get_window() is not None:
    8590            activity.get_window().activate(gtk.get_current_event_time())
    86             return True
     91            return not activity.props.launching
    8792
    8893        return False
    8994