indicator application menu freezes irregularly

Bug #1712052 reported by Nelly
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
indicator-application (Ubuntu)
New
Undecided
Unassigned

Bug Description

I have written a python program with an application indicator. Sometimes (about 1 over 3 times the complete program is started afresh), but not regularly, the indicator menu shows, the items are getting focus, but nothing happens when clicking.

I started the program from a terminal window, and expect that on clicking on any of the 4 buttons, output is printed to the terminal window, and at clicking on button 4 the program is also ended and the application icon removed. After most starts of the program, that happens, but sometimes (about 1 in 3) the buttons appear correctly, but nothing happens when they are clicked.

A simplified version of my program is:

import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk as gtk
gi.require_version('AppIndicator3', '0.1')
from gi.repository import AppIndicator3 as appindicator

def maken_indicatorscherm():
   APPINDICATOR_ID = 'ID_App_test'
   indicator = appindicator.Indicator.new(APPINDICATOR_ID, "whatever", appindicator.IndicatorCategory.APPLICATION_STATUS)
   indicator.set_status(appindicator.IndicatorStatus.ACTIVE)
   indicator.set_menu(build_menu())
   gtk.main()

def build_menu():
   menu = gtk.Menu()
   item_open = gtk.MenuItem('Test 1')
   item_open.connect('activate', laat_EA_zien)
   menu.append(item_open)
   item_overzicht = gtk.MenuItem('text 2')
   item_overzicht.connect('activate', overzicht_EA)
   menu.append(item_overzicht)
   item_start = gtk.MenuItem('text 3')
   item_start.connect('activate', verberg_EA)
   menu.append(item_start)
   item_quit = gtk.MenuItem('Quit')
   item_quit.connect('activate', quitGTK)
   menu.append(item_quit)
   menu.show_all()
   return menu

def quitGTK(source):
   print "Quit program"
   gtk.main_quit()

def laat_EA_zien(source):
   print "show text 1"

def overzicht_EA(source):
   print "show text 2"

def verberg_EA(source):
   print "show text 3"

if __name__ == '__main__':
   maken_indicatorscherm()

I am using ubuntu:
Description: Ubuntu 16.04.2 LTS
Release: 16.04
with python:
2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609]

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

Other bug subscribers

Remote bug watches

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