diff options
author | Calum Lind <calumlind@gmail.com> | 2018-11-07 15:09:47 +0000 |
---|---|---|
committer | Calum Lind <calumlind@gmail.com> | 2018-11-07 15:52:26 +0000 |
commit | 6b2f14e51ea503fcff5c0544a5d24be21b5740f4 (patch) | |
tree | db9e5e41148cd1512c0b7154616c9bc17015beaa /deluge/ui/gtk3/files_tab.py | |
parent | 7e2192e875ea0cc1ed160e0ebf6138e37e975035 (diff) | |
download | deluge-6b2f14e51ea503fcff5c0544a5d24be21b5740f4.tar.gz deluge-6b2f14e51ea503fcff5c0544a5d24be21b5740f4.tar.bz2 deluge-6b2f14e51ea503fcff5c0544a5d24be21b5740f4.zip |
[GTK] Fix windows not showing topmost on desktop
When showing the main_window, Add dialog or file manager windows they
would not appear at the top of the display stack, always one below.
This is due to needing the windowing timestamp to be passed when making
these calls. The recommended Gtk solution to use present_with_time and
use an event.time timestamp. However, this does not always work so
instead used the lower level Gdk set_user_time and fetch timestamp from
X11 server.
Notes:
- Using int(time.time()) for timestamp is not correct as the
windowing timestamp is different.
- Gtk.get_current_event_time only works when there is an event being
processed.
- It might be useful for non-X11 windowing systems to store event
timestamps so that we have a value to use instead of 0.
Diffstat (limited to 'deluge/ui/gtk3/files_tab.py')
-rw-r--r-- | deluge/ui/gtk3/files_tab.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/deluge/ui/gtk3/files_tab.py b/deluge/ui/gtk3/files_tab.py index dc5d914da..6c9b5c7fd 100644 --- a/deluge/ui/gtk3/files_tab.py +++ b/deluge/ui/gtk3/files_tab.py @@ -321,7 +321,7 @@ class FilesTab(Tab): path = self.get_file_path(select).split('/') filepath = os.path.join(status['download_location'], *path) log.debug('Open file: %s', filepath) - timestamp = Gtk.get_current_event_time() + timestamp = component.get('MainWindow').get_timestamp() open_file(filepath, timestamp=timestamp) def _on_show_file(self, status): @@ -334,7 +334,7 @@ class FilesTab(Tab): path = self.get_file_path(select).split('/') filepath = os.path.join(status['download_location'], *path) log.debug('Show file: %s', filepath) - timestamp = Gtk.get_current_event_time() + timestamp = component.get('MainWindow').get_timestamp() show_file(filepath, timestamp=timestamp) # The following 3 methods create the folder/file view in the treeview |