Index: deluge-1.3.6/deluge/common.py =================================================================== --- deluge-1.3.6.orig/deluge/common.py 2013-02-25 18:01:07.000000000 +0100 +++ deluge-1.3.6/deluge/common.py 2013-04-24 01:50:49.872771815 +0200 @@ -233,12 +233,14 @@ return pkg_resources.resource_filename("deluge", os.path.join("data", \ "pixmaps", fname)) -def open_file(path): +def open_file(path, timestamp=0): """ Opens a file or folder using the system configured program :param path: the path to the file or folder to open :type path: string + :param timestamp: the timestamp of the event that requested to open + :type timestamp: int """ if windows_check(): @@ -246,7 +248,17 @@ elif osx_check(): subprocess.Popen(["open", "%s" % path]) else: - subprocess.Popen(["xdg-open", "%s" % path]) + env = os.environ.copy() + + if timestamp > 0: + open_file.calls += 1 + env["DESKTOP_STARTUP_ID"] = "%s-%u-%s-xdg_open-%d_TIME%d" % \ + (os.path.basename(sys.argv[0]), os.getpid(), os.uname()[1], \ + open_file.calls, timestamp) + + subprocess.Popen(["xdg-open", "%s" % path], env=env) + +open_file.calls = 0 def open_url_in_browser(url): """ Index: deluge-1.3.6/deluge/ui/gtkui/menubar.py =================================================================== --- deluge-1.3.6.orig/deluge/ui/gtkui/menubar.py 2013-02-25 18:01:07.000000000 +0100 +++ deluge-1.3.6/deluge/ui/gtkui/menubar.py 2013-04-24 01:54:27.552708754 +0200 @@ -306,7 +306,8 @@ def on_menuitem_open_folder_activate(self, data=None): log.debug("on_menuitem_open_folder") def _on_torrent_status(status): - deluge.common.open_file(status["save_path"]) + timestamp = gtk.get_current_event_time() + deluge.common.open_file(status["save_path"], timestamp=timestamp) for torrent_id in component.get("TorrentView").get_selected_torrents(): component.get("SessionProxy").get_torrent_status(torrent_id, ["save_path"]).addCallback(_on_torrent_status) Index: deluge-1.3.6/deluge/ui/gtkui/files_tab.py =================================================================== --- deluge-1.3.6.orig/deluge/ui/gtkui/files_tab.py 2013-02-25 18:01:07.000000000 +0100 +++ deluge-1.3.6/deluge/ui/gtkui/files_tab.py 2013-04-24 02:01:40.172587724 +0200 @@ -361,7 +361,8 @@ path = self.get_file_path(select).split("/") filepath = os.path.join(status["save_path"], *path) log.debug("Open file '%s'", filepath) - deluge.common.open_file(filepath) + timestamp = gtk.get_current_event_time() + deluge.common.open_file(filepath, timestamp=timestamp) ## The following 3 methods create the folder/file view in the treeview def prepare_file_store(self, files):