I've got a better patch locally (fixing configureti and removeti, + adding
bindings to resize the image correctly when the icon gets mapped, etc...).
And I think it's ready to get committed.. tktray is much superior to our
current libtray..
the tooltips work just fine (it was done in tcl anyways, and our libtray
never supported tooltips either)  and with my latest changes, the image gets
resized to the correct size by tkcximage so we get proper image/transparency
(tktray just crops it otherwise).

However, I don't see tktray in debian and it's probably not on any other
system. So I think that if I commit this, we'll end up with people
complaining about "I lost my tray". So here's a suggestion :
have an if/else on tktray.. use tktray by default, but if it's not
available, use our local libtray instead as a fallback... If people want a
no-bugs/stable/better tray, they'd just need to install tktray..
This is great stuff because it will allow us to completely forget about
maintaining libtray in the future.
What do you think ? Should I re-add the libtray code iin case tktray is not
found, then commit ?

p.s: It also automatically docks/undocks/reparents if the tray manager
crashes/restarts.. :)

KaKaRoTo

On Tue, May 11, 2010 at 2:27 PM, Sander Hoentjen <san...@hoentjen.eu> wrote:

> On Fri, 2010-04-23 at 16:37 +0200, Alexander Nestorov wrote:
> > Hi, thanks for sending this here.
> > This is a known bug and it will be fixed when possible. Trayicon code
> > should be rewritten, but currently nobody is working on it.
> >
> > Regards
> >
> Try <http://tktray.googlecode.com/files/tktray1.3.6.tar.gz> + following
> diff. For me i only see 2 problems:
> 1) no tooltip
> 2) if the image is smaller then 24x24 px transparancy seems odd
>
>
> $ svn diff
> Index: trayicon.tcl
> ===================================================================
> --- trayicon.tcl        (revision 12029)
> +++ trayicon.tcl        (working copy)
> @@ -87,14 +87,14 @@
>                set iconmenu .trayiconwin.immain
>
>        } elseif {[UnixDock]} {
> -               if { [catch {package require libtray} res] } {
> +               if { [catch {package require tktray} res] } {
>                        set systemtray_exist 0
>                        status_log "[trans traynotcompiled] : $res"
>                        close_dock
>                        return
>                }
>
> -               set systemtray_exist [systemtray_exist]; #a system tray
> exist?
> +               set systemtray_exist 1; #a system tray exist?
>
>                destroy .immain
>                set iconmenu .immain
> @@ -251,9 +251,8 @@
>                if { $systemtray_exist == 1 && $statusicon == 0 && $status
> != "REMOVE" && [UnixDock]} {
>                        set pixmap "[::skin::GetSkinFile pixmaps
> doffline.png]"
>                        image create photo statustrayicon -file $pixmap
> -                       image create photo statustrayiconres
>                        #add the icon
> -                       set statusicon [newti .si -tooltip "[trans
> offline]" -pixmap statustrayiconres -command "::trayicon_callback
> statustrayicon statustrayiconres"]
> +                       set statusicon [tktray::icon .si -image
> statustrayicon]
>
>                        bind .si <<Button1>> iconify_proc
>                        bind .si <<Button3>> "tk_popup $iconmenu %X %Y"
> @@ -281,7 +280,6 @@
>                        if {[UnixDock] } {
>                                catch {
>                                        image delete statustrayicon
> -                                       image delete statustrayiconres
>                                }
>                        }
>                }
> @@ -407,9 +405,7 @@
>
>                        } elseif {[UnixDock] } {
>                                if { $pixmap != "null"} {
> -                                       configureti $statusicon -tooltip
> $tooltip
>                                        image create photo statustrayicon
> -file $pixmap
> -                                       image create photo
> statustrayiconres
>                                }
>                        } elseif {[MacDock] } {
>                                if { $pixmap == "null"} {
> @@ -536,7 +532,6 @@
>             if { $pixmap != "null"} {
>                 configureti $statusicon -tooltip $tooltip
>                 image create photo statustrayicon -file $pixmap
> -                image create photo statustrayiconres
>             }
>         } elseif {[MacDock] } {
>             if { $pixmap == "null"} {
> @@ -587,8 +582,7 @@
>                        set mailicon 1
>                } elseif {[UnixDock] } {
>                        image create photo mailtrayicon -file $pixmap
> -                       image create photo mailtrayiconres
> -                       set mailicon [newti .mi -tooltip offline -pixmap
> mailtrayiconres -command "::trayicon_callback mailtrayicon mailtrayiconres"]
> +                       set mailicon [tktray::icon .mi -image mailtrayicon]
>
>                        bind .mi <Button-1> "::hotmail::hotmail_login"
>                        bind .mi <Enter> [list balloon_enter %W %X %Y $msg]
> @@ -609,7 +603,6 @@
>                        if {[UnixDock] } {
>                                catch {
>                                        image delete mailtrayicon
> -                                       image delete mailtrayiconres
>                                 }
>                        }
>                }
>
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Amsn-devel mailing list
> Amsn-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amsn-devel
>
------------------------------------------------------------------------------

_______________________________________________
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel

Reply via email to