Re: Whether the application is active?



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.

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.

Felix




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