Thread Closed

#1
A review by aliov on the Mozilla Add-ons page for MTTP says:

QUOTE:
The Linux version is buggy, don't you know that when you create a status icon using the GTK API you need to call g_object_unref on it when you finish from using it? using this addon on Linux causes a X server windows leaks, after some time the X server exceeds the number of allowed clients because you are actually not destroying the GObject (GtkStatusIcon)

Destructor should look like:
trayLinuxWindowIcon::~trayLinuxWindowIcon() {
gtk_status_icon_set_visible(this->m_systray_icon, FALSE); /* Not needed at all since it will be destoryed anyway*/
g_object_unref (this->m_systray_icon);
this->m_systray_icon = NULL;
this->m_initialized = FALSE;
}

Do you think you could fix this? I would greatly appreciate it!

Thanks!
ReportQuote
#2
I am not really familiar with GTK, so there are plenty of problems right now with the Linux implementation. I will add this line now so it appears in my next release.

Have I helped you? Do you like my add-ons?
Would you consider donating to show your appreciation for my efforts?

/images/paypal.png
ReportQuote
#3
That should fix at least one part which causes "Maximum number of clients reached".

Index: keyState.cpp
===================================================================
--- keyState.cpp (revision 36)
+++ keyState.cpp (working copy)
@@ -33,6 +33,7 @@
return (((key_map_stat >> (alt_l & 7)) & 1)
|| ((key_map_stat >> (alt_r & 7)) & 1));
}
+ XCloseDisplay(display);
}
return false;
}
ReportQuote
#4
Ok thanks, I will do that.

Have I helped you? Do you like my add-ons?
Would you consider donating to show your appreciation for my efforts?

/images/paypal.png
ReportQuote
#5
Its easy to reproduce:

1. Run thunderbird in an terminal
2. Click on the tray icon until you see "Maximum number of clients reached"
3. Try to open another X app...

Micheal, how do you build it at all? :)
I get headaches with the xulrunner stuff..
I thought making a simple Makefile would be enough but linking fails always... seems I missed something there...

g++ -Wl,-O1 -Wl,--as-needed -Wl,-z,now -Wl,--sort-common -L/usr/lib64/xulrunner-devel-1.9.2/lib     -shared -fPIC -Wl,-hliblibMinimizeToTrayPlus.so MinimizeToTray.o trayRoutine.o linux/keyState.o linux/trayLinuxWindowHider.o linux/trayLinuxWindowIcon.o -o libMinimizeToTrayPlus.so -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lxpcomglue_s -lxul -lxpcom -lplds4 -lplc4 -lnspr4 -lpthread  
trayRoutine.o: In function `NSGetModule':
MinimizeToTray.cpp:(.text+0x0): multiple definition of `NSGetModule'
MinimizeToTray.o:MinimizeToTray.cpp:(.text+0x0): first defined here
linux/keyState.o: In function `NSGetModule':
MinimizeToTray.cpp:(.text+0x0): multiple definition of `NSGetModule'
MinimizeToTray.o:MinimizeToTray.cpp:(.text+0x0): first defined here
linux/trayLinuxWindowHider.o: In function `NSGetModule':
MinimizeToTray.cpp:(.text+0x0): multiple definition of `NSGetModule'
MinimizeToTray.o:MinimizeToTray.cpp:(.text+0x0): first defined here
linux/trayLinuxWindowIcon.o: In function `NSGetModule':
MinimizeToTray.cpp:(.text+0x0): multiple definition of `NSGetModule'
MinimizeToTray.o:MinimizeToTray.cpp:(.text+0x0): first defined here
collect2: ld returned 1 exit status
make: *** [libMinimizeToTrayPlus.so] Error 1

http://dpaste.com/177700/
ReportQuote
#6
I do use a Makefile, just mine does not work yet right. There have been some patches posted a few weeks ago, that should fix it. I am yet to get around to applying it all though.

Right now with the Linux version what I would like to get working the most is the Icon's menu. Right now if you click anything in it, the window restores.

Have I helped you? Do you like my add-ons?
Would you consider donating to show your appreciation for my efforts?

/images/paypal.png
ReportQuote
#7
I love this AddOn. I am affected by the both the Linux menu bug and this "memory leak" bug.

The menu bug is inconvenice a minor annoyance. The "memory leak" renders my entire system unable to launch new windows (including new Firefox tabs called from external applications).

Any chance of you rolling out a release that addresses the critical bug ("memory leak") ahead of addressing the minor one?

There is another Linux bug that I would also rate of higher importance than the menu bug, but I will give it it's own thread.

Thanks for writing this AddOn. It definitely fills a void that other AddOns can't.
ReportQuote
#8
An up2date svn repo would be cool so I could try to hunt more bugs esp. regarding this issue.
ReportQuote
#9
@idl0r
The svn is up to date, except for your changes (which I just committed) and a few changes to some JS, that I have not committed yet. If you want write access to the SVN repo for when you fix stuff I can give you that.

The problem is I been really busy at UNI, and unable to add the new stuff I need nor merge the changes from this person. It will be my number one project when I get 4 weeks off UNI mid year.

Have I helped you? Do you like my add-ons?
Would you consider donating to show your appreciation for my efforts?

/images/paypal.png
ReportQuote
#10
Ok, I'm able to build it now..
Just the .xpi is missing/incomplete.
It seems some variables are missing in the Makefiles so I added MODULE, XPI_NAME, XPI_PKGNAME and DIST_FILES to the Makefile.in in the root directory of minimizetotray and got my .xpi now but still incomplete.
How do you build it at all? I mean the basics are clear now but how do you get the complete .xpi?

I added minimizetotray into comm-1.9.1/mozilla/extensions; added "ac_add_options --enable-extensions=default,myextension
" to comm-1.9.1/.mozconfig and ran "make -f client.mk build" like described here: https://developer.mozilla.org/en/Creating_Custom_Firefox_Extensions_with_the_Mozilla_Build_System
ReportQuote
#11
I normally use an ANT build script to package the extension, as that is what I use for other extensions that lack a binary. However I should get a working make file as well. The changes that I have not yet merged that I mentioned in my last post should contain working make files - but I have not tested them yet.

Have I helped you? Do you like my add-ons?
Would you consider donating to show your appreciation for my efforts?

/images/paypal.png
ReportQuote
#12
Hi. I have the same issue. Executing "netstat -ap|grep thunderbird|wc -l" you can see when minimizing, the addon creates 6 new sockets and 1 more socket when restoring. After a while (220 thunderbird clients in my case) when i tried to open a new program, "maximum number of clients" error is displayed.

My addon version is 1.0.8. Thanks for solving this annoying bug, your addon rocks!.
ReportQuote

Thread Closed