Nightingale Forums

Full Version: Ubuntu: compiling MinimizeToTray Plus addon
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Does anyone know how I can compile the MinimizeToTray Plus addon on Ubuntu from the source code provided here? -> http://codefisher.org/minimizetotray/
I was trying to figure out how to add the source to Nightingale's extensions source folder in such a way that it will be compiled with the other extensions. It creates an XPI file but that doesn't contain the actual plugin file which should be compiled from the provided c++ code.
I recomment looking at other native add-on's Makefile/jar.mn files, for example the MPRIS, Unity or libnotify extensions. You also need to tell the Makefile in the extensions/ folder that there is a new folder with the minimizetotray extension in it.
I couldn't really get it to work. However, I figured that the "systray" extension does actually build and work on Linux, at least on Ubuntu 13.10/Mint 16 with MATE 1.6.1. It shows up in the systray and I can restore it with right click -> restore. However, when I left click, it won't restore and remain opened in background. But I'm sure this can be fixed somehow.

edit:

This patch makes systray on Linux somewhat useable:

Code:
--- a/extensions/Makefile.in
+++ b/extensions/Makefile.in
@@ -70,7 +70,9 @@

# MPRIS
ifeq (linux,$(SB_PLATFORM))
-    DEFAULT_EXTENSIONS += mpris
+    DEFAULT_EXTENSIONS += mpris \
+                          systray \
+                          $(NULL)
endif

SUBDIRS = $(sort $(subst $(COMMA),$(SPACE), \
--- a/extensions/systray/Makefile.in
+++ b/extensions/systray/Makefile.in
@@ -30,6 +30,7 @@
include $(DEPTH)/build/autodefs.mk

IS_EXTENSION = 1
+INSTALL_EXTENSION = 1

SUBDIRS = chrome components

--- a/extensions/systray/chrome/content/prefwindow.xul
+++ b/extensions/systray/chrome/content/prefwindow.xul
@@ -16,8 +16,9 @@
     <preferences>
       <preference id="prefNotify" name="extensions.minimizetotray.sb.notify" type="bool"/>
     </preferences>
-    
-    <checkbox id="checkNotify" preference="prefNotify"
-              label="&prefs.notify.label;" accesskey="&prefs.notify.key;"/>
+
+    <!-- Hiding it because it's broken. We can use the libnotify plugin for this. -->    
+    <!-- checkbox id="checkNotify" preference="prefNotify"
+              label="&prefs.notify.label;" accesskey="&prefs.notify.key;"/ -->
   </prefpane>
</prefwindow>
--- a/extensions/systray/components/src/nsSystemTrayServiceGTK.cpp
+++ b/extensions/systray/components/src/nsSystemTrayServiceGTK.cpp
@@ -117,7 +117,7 @@
     return NS_ERROR_INVALID_ARG;
   }
   // destructing the icon removes it for us
-  mIconDataMap.Remove(aIconId);
+  /* mIconDataMap.Remove(aIconId); */  // << This made it impossible to restore NG
   return NS_OK;
}

--- a/extensions/systray/install.rdf.in
+++ b/extensions/systray/install.rdf.in
@@ -24,8 +24,8 @@
     <em:targetApplication>
       <Description>
         <em:id>nightingale@getnightingale.com</em:id> <!-- nightingale -->
-        <em:minVersion>@EXTENSION_MIN_VER@</em:minVersion>
-        <em:maxVersion>@EXTENSION_MAX_VER@</em:maxVersion>
+        <em:minVersion>1.11.0a</em:minVersion>
+        <em:maxVersion>2.1.0a</em:maxVersion>
       </Description>
     </em:targetApplication>
   </Description>
My goodness, after countless attempts I was finally able to build this plugin from source.
Here's the modified source code: https://github.com/darealshinji/minimizetotrayplus