From 673dd259e814121c874fb6857e6b2e70f4095228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sat, 14 May 2016 11:15:35 +0000 Subject: [PATCH] [GB.DBUS.TRAYICON] * NEW: Deleting a TrayIcon now unregisters it when Unity-like indicator protocol is in use. * NEW: Support for Cinnamon. Note that the Cinnamon system tray does not send the click events specified by the protocol. Consequently, you get no Click, MiddleClick and Scroll events! git-svn-id: svn://localhost/gambas/trunk@7775 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- comp/src/gb.dbus.trayicon/.src/TrayIcon.class | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/comp/src/gb.dbus.trayicon/.src/TrayIcon.class b/comp/src/gb.dbus.trayicon/.src/TrayIcon.class index 3732adb7e..1164a8b18 100644 --- a/comp/src/gb.dbus.trayicon/.src/TrayIcon.class +++ b/comp/src/gb.dbus.trayicon/.src/TrayIcon.class @@ -39,7 +39,7 @@ Public Sub _new() $hObject = New DBusStatusIcon As "StatusIcon" - $bAppIndicator = LCase(Env["XDG_CURRENT_DESKTOP"]) = "unity" + $bAppIndicator = ["unity", "cinnamon", "x-cinnamon"].Exist(Env["XDG_CURRENT_DESKTOP"], gb.IgnoreCase) Inc $iCount $iId = $iCount @@ -126,6 +126,11 @@ Public Sub Delete() Hide $hMenu = Null + If $bAppIndicator Then + DBus.UnRegister($hMenu) ', "/org/kde/statusnotifieritem" &/ CStr($iId) &/ "menu", ["com.canonical.dbusmenu"]) + DBus.Unregister($hObject) ', "/org/kde/statusnotifieritem" &/ CStr($iId), ["org.kde.StatusNotifierItem"]) + Endif + iIndex = TrayIcons._All.FindByRef(Me) If iIndex < 0 Then Return