Hi Alex,
I'll start! (6) :
1 - the patch is incomplete, it will obviously not compile.. you start using
trayicon.* (your struct) without even defining an instance of it, so I'm
guessing you did the diff between your file and an older version of your
file. so the diff doesn't show all changes
2 - you should definitely use 'svn diff'.. just copy your tray.c file to
your svn version of amsn and do 'svn diff'.
3 - you do a ckalloc for objv then memcpy.. WRONG! never ever do something
like that.. you could at least, just stored the pointer and do a Tcl_IncrRef
(to increment the refcount)...
4 - instead of storing objv, I suggest you put the content of it in the
structure, something like trayicon.tooltip, trayicon.icon, etc.. make sure
you strdup() the strings, and make sure you free them when the tray is
destroyed
5 - don't use event == 32, use something like event == X_EVENT_SOMETHING..
you'd need to find what event 32 represents in the X.h file (or wherever it
comes from
6 - you use managed, and destroyed, makes no sense to me if managed always
equals !destroyed, use only one if you can't have managed==destroyed.
7- don't call the external Tk API for recreating the tray.. you should have
a function that just does the creation and gets called by your MessageEvent
and by Tk_TrayNew (or whatever

That's it for now.. but since the code is so small (the patch being
incomplete), that's why I don't have a lot to say :p
Maybe tonight I'll have a look and just copy the whole the gtk code directly
and refactor it to remove the gtk parts... how much will you pay me to NOT
do that? :p bwahahaha (6)

KaKaRoTo

On Sun, Dec 6, 2009 at 3:49 PM, Alexander Nestorov
<alexander...@gmail.com>wrote:

> Hi everyone!
> After a lot of time I finally made it. It's still in a really hacky/durty
> way (billiob, don't be scared. Maybe you could think that this patch causes
> a kernel panic, but it doesn't... always... :p)
> but I promisse that I'll keep trying to make it cleaner.
>
> So, the patch basically makes the trayicon to detect when the tray manager
> crashes or when it comes back to normallity, and according to this it
> deletes the icon or creates it again.
>
> --
> Alexander Nest
>
>
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> _______________________________________________
> Amsn-devel mailing list
> Amsn-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amsn-devel
>
>
------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel

Reply via email to