Popup menu doesn't work

Bug #1171433 reported by Viktor Suprun
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
gobject-introspection (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Hi guys!
I'm using a Python and gir bindings to libgtk3, and I've trouble with Gtk.Menu
(and gi.overrides.Menu) in Ubuntu Raring and I think that is bug. After calling

menu.popup(None, None, lambda menu, data: (event.get_root_coords()[0],
event.get_root_coords()[1], True), None, event.button, event.time)

the popup-menu doesn't appear, if menu has added within ListView/TreeView or
some other widgets. Popup menu works only when it has been added to the Tab of the
Notetab widget.

I've roughly the list of package versions (latest version of the Ubuntu, 13.04):
$ dpkg -l | grep -E "ii\s\s(python|python-gi|gir1.2-gtk-3.0|libgtk-3-0)(\s|\:)"
ii gir1.2-gtk-3.0 3.6.4-0ubuntu7 amd64 GTK+ graphical
user interface library -- gir bindings
ii libgtk-3-0:amd64 3.6.4-0ubuntu7 amd64 GTK+ graphical
user interface library
ii python 2.7.4-0ubuntu1 amd64 interactive
high-level object-oriented language (default version)
ii python-gi 3.8.0-2 amd64 Python 2.x
bindings for gobject-introspection libraries

But, in Ubuntu 12.10 which had a following list of packages all be ok, and menu
would be appear:
ii gir1.2-gtk-3.0 3.6.0-0ubuntu3.2 amd64 GTK+ graphical
user interface library -- gir bindings
ii libgtk-3-0:amd64 3.6.0-0ubuntu3.2 amd64 GTK+ graphical
user interface library
ii python 2.7.3-0ubuntu7 amd64 interactive
high-level object-oriented language (default version)
ii python-gi 3.4.0-1ubuntu0.1 amd64 Python 2.x
bindings for gobject-introspection libraries

Tags: raring
Revision history for this message
Viktor Suprun (popsul1993) wrote :
tags: added: raring
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gobject-introspection (Ubuntu):
status: New → Confirmed
description: updated
Revision history for this message
Dmitry-Kogura (dmitry-kogura) wrote :

I confirm this bug. In my application (with gir1.2-gtk-3.0 using) popup menu doesn't work too since I updated to Raring. In Quantal all is OK. Please, fix it, otherwise my application just can not use in Raring.

Revision history for this message
Viktor Suprun (popsul1993) wrote :

Hello again. During the time while I waited an answer about this issue I found temporary solution for solve it problem.
Attached example has contains a following part of the code:

def on_button_press(w, event):
    if event.button == 3:
        menu = Menu()
        menu.add(Gtk.MenuItem("item 1"))
        menu.show_all()
        menu.popup(None, None, lambda menu, data: (event.get_root_coords()[0], event.get_root_coords()[1], True), None, event.button, event.time)

But if it is rewritten so:

menu = Menu()
def on_button_press(w, event):
    if event.button == 3:
        menu.add(Gtk.MenuItem("item 1"))
        menu.show_all()
        menu.popup(None, None, None, None, event.button, event.time)

menu works perfectly without any bugs.
So, I think it's a bug because first example works with version 3.4 of the gir1.2-gtk-3.0 package, but, with version 3.6+ menu doesn't work.

description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.