Re: Fwd: Re: Find out if window is active

2013-04-16 Thread Lanoxx
Hi Matthias, I just installed mutter and tried the use case again, but I am getting the same behaviour. I cannot detect any reasonable pattern for the is_active flag. It is set to true when I call the application for the first time, then it remains true if the application has input focus or

Re: Find out if window is active

2013-04-15 Thread Lanoxx
Doesnt work here either. The window becomes active when i focus it for the first time, after wards the callback is never called again. On 15/04/13 02:06, Matthias Clasen wrote: g_signal_connect (window, notify::is-active, G_CALLBACK (print_active), NULL);

Re: Find out if window is active

2013-04-15 Thread Matthias Clasen
Sounds like you possibly found a bug, then. Which platform is this on ? ___ gtk-devel-list mailing list gtk-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-devel-list

Fwd: Re: Find out if window is active

2013-04-15 Thread Lanoxx
I am using metacity and gnome-panel. I can try switching to mutter or compiz and see if that will fix the problem. Does the behaviour of this function depend of the window manager that im using? On 15/04/13 14:30, Matthias Clasen wrote: Sounds like you possibly found a bug, then. Which platform

Find out if window is active

2013-04-14 Thread Lanoxx
Hi folks, I am trying to find out if a window is active or not, I have tried three different approaches: * get a GdkWindow pointer from the window property of my GtkWindow and check if it is FOCUSED * use the function gtk_window_has_toplevel_focus() * use the function

Re: Find out if window is active

2013-04-14 Thread Matthias Clasen
g_signal_connect (window, notify::is-active, G_CALLBACK (print_active), NULL); with static void print_active (GtkWindow *window) { g_print (active: %d\n, gtk_window_is_active (window)); } works as expected here, and prints active: 1 and active: 0 as the window