I'm unsure if this is a viable solution, but since 2.10 this function
appears to solve the problem?

http://library.gnome.org/devel/gdk/stable/GdkScreen.html#gdk-screen-get-active-window

You can get your GdkScreen from a GtkWidget and using
gdk_screen_get_active_window() find your GdkWindow.

On Fri, Jan 25, 2008 at 1:00 PM, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:

> On 11:27 Fri 25 Jan     , aniket ray wrote:
>
> > > > I tried changing the value of isActive based on focus-in and
> focus-out
> > > > events of each of the windows. But then, if I switch from one window
> of the
> > > > app to another, the variable is becoming false for a period of time
> (albeit
> > > > a small one).
>
> There might be knowledge inside the window manger or even gtk which
> windows
> belong together to one process, so, there might be a way to get from an
> active window to all others of the same app. However, I don't know how,
> either.
>
> I would simply follow the approach you took: When one window looses the
> focus it should check if one of the others get it. Simply wait let's say
> 0.1 secs. If another window of your's gets the focus you do nothing, if
> none get's it you can hide the tool windows. The user will not notice a
> delay of that time.
>
> > Also,
> > I'd like to make the correct window active if the application becomes
> > active(any of the application window's become active) and similar
> > stuff.
>
> The other way round: Have a flag to be set whenever the 0.1 secs are
> over without any new focus-in event. If a window gets the focus you
> could determine if one of your windows was active before.
>
> Not a clean solution but should do it.
>
> Felix
>
>
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to