I've found the problem on the second bug.
After testing it both with Xfwm4&Compiz, I' don't think it's a composer bug. It 
maybe a GTK bug or X11 bug.
The method is:
    public void toggle_window_visbility() {
        if(active_notifier != 0) {
            this.disconnect(active_notifier);
            active_notifier = 0;
        }
        if(this.has_toplevel_focus) {
            this.get_position(out _posX, out _posY);
            this.hide();
        }
        else if(this.get_window().is_visible() == true) {
            this.move(_posX, _posY);
            this.present();
            active_notifier = this.notify["is-active"].connect(buffer_position);
        }
        else {
            this.move(_posX, _posY);
            this.present();
            active_notifier = this.notify["is-active"].connect(buffer_position);
        }
    }

For some reason(tested it using GLib.message() method), this.has_toplevel_focus 
is always true in the program.
It maybe a gtk bug(3.4.2-2) or xserver bug.
There is a solution to make it works, by checking if the window is visible.
I've tested it, it works again by this method:
Just change this line in the method:
        if(this.has_toplevel_focus) {
To this:
        if(this.has_toplevel_focus && this.visible) {

This way we can escape the GTK/X11 bug.

BTW: Why do you use buffer_position() and move()?
It just seems useless(correct me if I'm wrong)

Yours
Tal

> Subject: RE: [xnoise] [Bug] Crash when attempt to play tracks
> From: shuerhaa...@googlemail.com
> To: xno...@googlegroups.com
> Date: Tue, 14 Aug 2012 16:17:57 +0200
> 
> I do.
> 
> The code you copied to your mail is used after clicking on tray icon
> only.
> 
> for other code touching window visibility please see
> the signal handler attached to the delete_event of the main_window and
> the handler of window_state_event of the main_window.
> window_state_event is for tracking some window state changes
> internally. 
> 
> I recommend using a tool called regexxer. It will help you understand
> and find out where functions are called from and where signals are
> connected to.
> 
> Best Regards
> 
> 
> 
> 
> Am Dienstag, den 14.08.2012, 15:30 +0300 schrieb Tal Hadad:
> > 
> > Thanks for fixing the first one.
> > And about the second bug, I don't really understand the
> > main_window.toggle_window_visbility method:
> >     public void toggle_window_visbility() {
> >         if(active_notifier != 0) {
> >             this.disconnect(active_notifier);
> >             active_notifier = 0;
> >         }
> >         if(this.is_active) { 
> 
> //is_active is a property of the Gtk.Window base class of main_window
> 
> >             this.get_position(out _posX, out _posY);
> >             this.hide();
> >         }
> >         else if(this.get_window().is_visible() == true) {
> >             this.move(_posX, _posY);
> >             this.present();
> >             active_notifier =
> > this.notify["is-active"].connect(buffer_position);
> >         }
> >         else {
> >             this.move(_posX, _posY);
> >             this.present();
> >             active_notifier =
> > this.notify["is-active"].connect(buffer_position);
> >         }
> >     }
> > 
> > Shouldn't you use only the present () and hide () methods?
> > 
> > Tal 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "xnoise" group.
> To post to this group, send email to xno...@googlegroups.com.
> To unsubscribe from this group, send email to 
> xnoise+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/xnoise?hl=en.
> 
                                          
_______________________________________________
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to