Re: Whether the application is active?



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





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]