[maemo-developers] dealing with non-GTK windows

From: Eero Tamminen eero.tamminen at nokia.com
Date: Wed Oct 24 12:28:20 EEST 2007
Hi,

ext Tapani Pälli wrote:
> ext Austin Che wrote:
>> Tapani Pälli <tapani.palli at nokia.com> wrote:
>>>>     - Is it possible to force such a window into fullscreen? I don't
>>>>       care if it needs to be done manually. For example, is it
>>>>       possible to have a program that takes whatever window is
>>>>       currently on top/in focus and makes it fullscreen?
>>>>   
>>>>       
>>> Yes, by giving hints to window manager. This can be achieved by setting
>>> _NET_WM_STATE to _NET_WM_STATE_FULLSCREEN.
>>>     
>>     Thanks! I found it easier to use gdk_window_foreign_new and then
>>     gdk_window_fullscreen. I've now got a semi-working hack using my
>>     powerlaunch program to force any window into fullscreen by
>>     pressing power,fullscreen.
>>     
>>     For example, I can now run NX in fullscreen and get a full KDE
>>     desktop on the N800:
>>     http://austinche.name/maemo/nx-fullscreen.png
>>     
>>     The one remaining issue I have is how to reliably get the ID of
>>     the top window or focused window. I'm using XQueryPointer to get
>>     the window under the pointer but it appears to sometimes give
>>     windows that no longer exist (cache?) and thereby giving BadWindow
>>     errors.
> 
> This sounds dirty. You could read root window property
> _NET_CLIENT_LIST_STACKING instead to get list of window id's (the last
> one is the topmost one).

And (of course) when dealing with windows from the other processes,
any actions on those windows should be protected by trapping the
X errors in case the window went away in the meanwhile.

(and one must not remember to do untrapping, otherwise there can
be strange problems later on.)


	- Eero

More information about the maemo-developers mailing list