Re: how to check the widget is really visible or not ?



On 2011-06-28 at 16:12, KC wrote:
Hi,

I did a very simple test (see attachment).
Create a window and add a timeout callback to check if the
window is visible.

When I run the example, the window popup and callback will
print "win ...... VISIBLE", so far so good.

Then, I deiconify the window; move the window to other desktop workspace;
use other application to cover the window completely ....
No matter what I do, I still got the window is visible !!!!

What's wrong with my code ?  Thanks a lot.

you're assuming that the visibility flag has anything to do with the
actual exposed area of the window. that is *not* the case, as you have
discovered.

the visible flag means only that you have requested that the window
should be shown; the mapped flag is the flag that lets you know if the
window is in fact being shown by the windowing system. on the other
hand, there is no way for you to know whether the whole window is
effectively visible or it's being covered (partially or wholly) by
another window. on X11 it can be effectively impossible to know that,
even if you start traversing the window tree from the root window: the
whole scene coule be composited â hence your window could be displayed
fully by the compositor, and yet be underneath the the compositing
surfaces owned by the compositor itself.

ciao,
 Emmanuele.

-- 
W: http://www.emmanuelebassi.name
B: http://blogs.gnome.org/ebassi



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