Re: Whether the application is active?



On Jan 25, 2008 2:07 AM, fkater googlemail com <fkater googlemail com> wrote:
On 19:12 Wed 23 Jan     , aniket ray wrote:
Is there a way to find out if the current application is the active
application (has user-focus) or not?

I have a gtk application with multiple windows and if any among the windows
has focus then I want a variable (let's say boolean isActive) to be set as
true.
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).

I can't provide you with a solution. However the question of active
windows is probably one of the window manager.

Off topic, but doesn't gtk_window_is_active() help us to find out if
individual windows are active
and the activate signals are thrown for each window.
I am looking for a way to implement such a signal for the whole app.

And I can't really imagine the need of telling an app that one of its
windows is currently active -- could you give some more information why
you want this? There might be another solution to what you want.

Well, I am looking to close certain utility and chromeless (without
borders and title) windows, if the application is not active. 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.
If I could get any a pointer in the right direction that would be
great help too.

Felix



Thanks for the response,
Aniket



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