From 70d5931622c4d97e3e5439f408af8ffa7092e33e Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Fri, 19 Oct 2018 12:10:25 +0100 Subject: [PATCH] [GTK3] Fix column header right-click menu popup The popup_at_pointer method is only available in GTK >=3.22 so for compatibility restore using popup method. Right-clicking on column headers popped-up torrent menu so only show this menu when in torrentview. --- deluge/ui/gtk3/listview.py | 2 +- deluge/ui/gtk3/torrentview.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deluge/ui/gtk3/listview.py b/deluge/ui/gtk3/listview.py index ef328a8c2..d16ef7d64 100644 --- a/deluge/ui/gtk3/listview.py +++ b/deluge/ui/gtk3/listview.py @@ -346,7 +346,7 @@ class ListView(object): def on_treeview_header_right_clicked(self, column, event): if event.button == 3: - self.menu.popup_at_pointer() + self.menu.popup(None, None, None, None, event.button, event.get_time()) def register_checklist_menu(self, menu): """Register a checklist menu with the listview. It will automatically diff --git a/deluge/ui/gtk3/torrentview.py b/deluge/ui/gtk3/torrentview.py index 0529ebed2..f6313da07 100644 --- a/deluge/ui/gtk3/torrentview.py +++ b/deluge/ui/gtk3/torrentview.py @@ -792,7 +792,7 @@ class TorrentView(ListView, component.Component): """This is a callback for showing the right-click context menu.""" log.debug('on_button_press_event') # We only care about right-clicks - if event.button == 3: + if event.button == 3 and event.window == self.treeview.get_bin_window(): x, y = event.get_coords() path = self.treeview.get_path_at_pos(int(x), int(y)) if not path: