From 56b88bb4817bafaedd0bca7d94d25377a59a065a Mon Sep 17 00:00:00 2001 From: foudfou Date: Wed, 31 Dec 2014 01:03:05 +0100 Subject: [PATCH] Add 'with_appindicator' hidden pref. This may be useful for StatusNotifierItem-ready environments which still support ICCCM/EWMH, whereby FireTray may be less limited. We'll just make it a hidden pref for now as the related UI is a nightmare. --- README.md | 1 + src/defaults/preferences/prefs.js | 2 ++ src/modules/linux/FiretrayStatusIcon.jsm | 7 ++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2308fbf..e1f7d51 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Features * show icon only when hidden to tray * mouse scroll on tray icon shows/hides * GTK-themable icons + * StatusNotifierItem support (can be disabled by `with_appindicator` hidden pref) * customizable tray icons * popup menu (show/hide individual windows, open new windows, quit) * command-line `-firetrayShowHide` option (useful for window manager's keyboard shortcuts) diff --git a/src/defaults/preferences/prefs.js b/src/defaults/preferences/prefs.js index b00e6e1..7750808 100644 --- a/src/defaults/preferences/prefs.js +++ b/src/defaults/preferences/prefs.js @@ -39,3 +39,5 @@ pref("extensions.firetray.excluded_folders_flags", 1077956384); // exposed in 1 tree, hence 2 branches: serverTypes, excludedAccounts pref("extensions.firetray.mail_accounts", '{ "serverTypes": {"pop3":{"order":1,"excluded":false}, "imap":{"order":1,"excluded":false}, "movemail":{"order":2,"excluded":true}, "none":{"order":3,"excluded":false}, "rss":{"order":4,"excluded":true}, "nntp":{"order":5,"excluded":true}, "exquilla":{"order":6,"excluded":true}}, "excludedAccounts": [] }'); // JSON pref("extensions.firetray.only_favorite_folders", false); + +pref("extensions.firetray.with_appindicator", true); diff --git a/src/modules/linux/FiretrayStatusIcon.jsm b/src/modules/linux/FiretrayStatusIcon.jsm index 1b5755c..4f1b09a 100644 --- a/src/modules/linux/FiretrayStatusIcon.jsm +++ b/src/modules/linux/FiretrayStatusIcon.jsm @@ -26,6 +26,7 @@ firetray.StatusIcon = { prefNewMailIconNames: null, defaultAppIconName: null, defaultNewMailIconName: null, + canAppIndicator: null, init: function() { this.defineIconNames(); @@ -34,7 +35,11 @@ firetray.StatusIcon = { // StatusIcon implementations, PopupMenu must be initialized *after* // implemenations are imported. Cu.import("resource://firetray/ctypes/linux/appindicator.jsm"); - if (appind3.available() && this.dbusNotificationWatcherReady()) { + this.canAppIndicator = + (appind3.available() && this.dbusNotificationWatcherReady()); + log.info("canAppIndicator="+this.canAppIndicator); + if (firetray.Utils.prefService.getBoolPref('with_appindicator') && + this.canAppIndicator) { /* FIXME: Ubuntu14.04/Unity: successfully closing appind3 crashes FF/TB during exit, in Ubuntu's unity-menubar.patch's code. https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1393256 */