Bug ID 1137054
Summary Python Appindicator segfaults on Tumbleweed - fine on Leap
Classification openSUSE
Product openSUSE Tumbleweed
Version Current
Hardware x86-64
OS Other
Status NEW
Severity Normal
Priority P5 - None
Component KDE Workspace (Plasma)
Assignee opensuse-kde-bugs@opensuse.org
Reporter richard.eigenmann@gmail.com
QA Contact qa-bugs@suse.de
Found By ---
Blocker ---

Have been experimenting with system tray icons and came across a very simple
Python example how to use them. It worked fine on my openSUSE Leap desktop and
segfaults on my Tumbleweed laptop. Both fully updated as of today (1 June
2019).

Here is the Python code that puts an avatar in the system tray with a menu item
to open up a zenity info dialog with your user name or shut down the script:

#!/usr/bin/python3

# Inspiration:
https://fosspost.org/tutorials/custom-system-tray-icon-indicator-linux
# Install: sudo zypper in typelib-1_0-AppIndicator3-0_1
# Install: sudo zypper in zenity

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

def main():
  indicator = appindicator.Indicator.new("systrayExperiment",
"avatar-default-symbolic", appindicator.IndicatorCategory.APPLICATION_STATUS)
  indicator.set_status(appindicator.IndicatorStatus.ACTIVE)
  indicator.set_menu(menu())
  indicator.set_title("Cute Systray Experiment")
  gtk.main()

def menu():
  menu = gtk.Menu()

  command_hello = gtk.MenuItem('Say Hello')
  command_hello.connect('activate', hello)
  menu.append(command_hello)

  exittray = gtk.MenuItem('Exit Tray')
  exittray.connect('activate', quit)
  menu.append(exittray)

  menu.show_all()
  return menu

def hello(_):
  os.system("/usr/bin/zenity --info --text \"Hello, $(whoami)!\"")

def quit(_):
  gtk.main_quit()

if __name__ == "__main__":
  main()




Output from Tumbleweed:


me@laptop:~> ./minimalAppIndicator.py 

(process:3049): Gtk-CRITICAL **: 16:37:30.781: gtk_icon_theme_get_for_screen:
assertion 'GDK_IS_SCREEN (screen)' failed
./minimalAppIndicator.py:14: Warning: invalid (NULL) pointer instance
  indicator = appindicator.Indicator.new("systrayExperiment",
"avatar-default-symbolic", appindicator.IndicatorCategory.APPLICATION_STATUS)
./minimalAppIndicator.py:14: Warning: g_signal_connect_data: assertion
'G_TYPE_CHECK_INSTANCE (instance)' failed
  indicator = appindicator.Indicator.new("systrayExperiment",
"avatar-default-symbolic", appindicator.IndicatorCategory.APPLICATION_STATUS)

(process:3049): Gtk-CRITICAL **: 16:37:30.784:
_gtk_style_provider_private_get_settings: assertion
'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed

(process:3049): Gtk-CRITICAL **: 16:37:30.784:
_gtk_style_provider_private_get_settings: assertion
'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed

(process:3049): Gtk-CRITICAL **: 16:37:30.784:
_gtk_style_provider_private_get_settings: assertion
'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
Segmentation fault (core dumped)


You are receiving this mail because: