Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the use of AyatanaAppIndicator #2200

Merged
merged 3 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions guake/guake_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,29 @@ def load_schema():
# trayicon!
img = pixmapfile("guake-tray.png")
try:
import appindicator # pylint: disable=import-outside-toplevel
except ImportError:
try:
gi.require_version("AyatanaAppIndicator3", "0.1")
from gi.repository import ( # pylint: disable=import-outside-toplevel
AyatanaAppIndicator3 as appindicator,
)
except (ValueError, ImportError):
gi.require_version("AppIndicator3", "0.1")
from gi.repository import ( # pylint: disable=import-outside-toplevel
AppIndicator3 as appindicator,
)
except (ValueError, ImportError):
self.tray_icon = Gtk.StatusIcon()
self.tray_icon.set_from_file(img)
self.tray_icon.set_tooltip_text(_("Guake Terminal"))
self.tray_icon.connect("popup-menu", self.show_menu)
self.tray_icon.connect("activate", self.show_hide)
else:
# TODO PORT test this on a system with app indicator
self.tray_icon = appindicator.Indicator(
_("guake-indicator"), _("guake-tray"), appindicator.CATEGORY_OTHER
self.tray_icon = appindicator.Indicator.new(
"guake-indicator", "guake-tray", appindicator.IndicatorCategory.APPLICATION_STATUS
)
self.tray_icon.set_icon(img)
self.tray_icon.set_status(appindicator.STATUS_ACTIVE)
self.tray_icon.set_icon_full("guake-tray", _("Guake Terminal"))
self.tray_icon.set_status(appindicator.IndicatorStatus.ACTIVE)
menu = self.get_widget("tray-menu")
show = Gtk.MenuItem(_("Show"))
show.set_sensitive(True)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
release_summary: >
Enables the use of AyatanaAppIndicator for the tray icon

fixes:
- |
- tray icon broken with AppIndicator #433
Loading