Commit c0bcd072 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

destroy context menu when selection is done. see #1820

parent 163d3eba
......@@ -602,3 +602,6 @@ def get_possible_button_event(event):
event_button = event.button
return event_button
def destroy_widget(widget):
widget.destroy()
......@@ -631,7 +631,6 @@ class RosterWindow:
# make it sensitive. it is insensitive only if no accounts are *available*
advanced_menuitem.set_sensitive(True)
if self.add_new_contact_handler_id:
add_new_contact_menuitem.handler_disconnect(
self.add_new_contact_handler_id)
......@@ -1312,6 +1311,9 @@ class RosterWindow:
event_button = gtkgui_helpers.get_possible_button_event(event)
roster_contact_context_menu.attach_to_widget(self.tree, None)
roster_contact_context_menu.connect('selection-done',
gtkgui_helpers.destroy_widget)
roster_contact_context_menu.popup(None, None, None, event_button,
event.time)
roster_contact_context_menu.show_all()
......@@ -1343,6 +1345,8 @@ class RosterWindow:
event_button = gtkgui_helpers.get_possible_button_event(event)
menu.attach_to_widget(self.tree, None)
menu.connect('selection-done', gtkgui_helpers.destroy_widget)
menu.popup(None, None, None, event_button, event.time)
menu.show_all()
......@@ -1407,6 +1411,8 @@ class RosterWindow:
event_button = gtkgui_helpers.get_possible_button_event(event)
menu.attach_to_widget(self.tree, None)
menu.connect('selection-done', gtkgui_helpers.destroy_widget)
menu.popup(None, None, None, event_button, event.time)
menu.show_all()
......@@ -1536,6 +1542,8 @@ class RosterWindow:
event_button = gtkgui_helpers.get_possible_button_event(event)
menu.attach_to_widget(self.tree, None)
menu.connect('selection-done', gtkgui_helpers.destroy_widget)
menu.popup(None, self.tree, None, event_button, event.time)
menu.show_all()
......@@ -3110,6 +3118,8 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
c_dest, is_big_brother, context, etime)
menu.append(item)
menu.attach_to_widget(self.tree, None)
menu.connect('selection-done', gtkgui_helpers.destroy_widget)
menu.popup(None, None, None, 1, etime)
menu.show_all()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment