[maemo-developers] How to detect/recognize the foreground running application?

From: Hämäläinen Kimmo kimmo.hamalainen at nokia.com
Date: Wed Jan 5 12:35:21 EET 2011
On Wed, 2011-01-05 at 12:20 +0800, ext 百封 wrote:
> I met a challenge on Maemo platform(N900) about detecting the
> foreground application. 
> 
> Detail info:
> 
> When my application is sent to background, it should be able to
> recognize the current foreground application. Then according to the
> different foreground applications, our application can do different
> operations. The problem is that I cannot detect/recognize the
> foreground application. 

The root window has _MB_CURRENT_APP_WINDOW property that tells the
window ID of the current application window (or 0 or desktop). 

If the top-level window with input focus is enough for you, you can use
_NET_ACTIVE_WINDOW:
http://standards.freedesktop.org/wm-spec/wm-spec-latest.html#id2550738

-Kimmo

> 
>  
> 
> Thanks.
> 
> Whitewinds
> 
> 
> 
> 
> _______________________________________________
> maemo-developers mailing list
> maemo-developers at maemo.org
> https://lists.maemo.org/mailman/listinfo/maemo-developers

More information about the maemo-developers mailing list