[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.
This commit is contained in:
Calum Lind 2018-10-19 12:10:25 +01:00
parent ce49cde49d
commit 70d5931622
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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: