Re: Find out if a widget or window is actually visible?




Does Gtkmm/Gdkmm offer a nice and simple way to find out if a widget or window is actually visible to the user, i.e. is mapped *and not obscured
by another window*? I mean, .e.g Gdk::Window::is_viewable () and
Gdk::Window::is_visible ()/Gtk::Widget::is_visible() will answer only first half of that question, I believe, i.e. they will tell me whether the window/widget is mapped, but not check if it is covered by something
else.

- Toralf

I am not sure if it about GTKmm at all. The system manages windows
that represent a space for different applications. Each application
can be written using it's own GUI framework: GTKmm, Qt, Tkinter, and
so on. Thus maybe your question should be addressed to a "guy" that is
responsible for sending a sort of "REDRAW_WINDOW" signal whenever it
is needed and a part of window becomes visible. I guess that should be some kind of System GUI Manager that is definitely different in Linux,
Windows, Mac OS X, etc. Therefor the "guy" you are looking is System.
No, I don't think so. By that argument, Gdk::Window should never be
used. Or even be there in the first place. No, wait, you can make that
all of Gdk. And add the event handling infrastructure in Gtk. 'Cause the
job is done by the back-end GUI libs or windowing system, really...
But isn't one of the prime features of Gtk actually that it allows you
to interact with windows without having to worry about system details or
platform differences? It's a cross-platform toolkit, you see...

However, this question is "different". For one, the system may provide no means of finding out. And in some systems, "visible" may not be meaningful. There's an X server I've seen that renders everything, unobscured, offscreen, and then does some quite advanced and strange compositing. The question of "visibility" is next-to- meaningless in the context of that system.
True. Actually, in X, anything that involves interaction with the window manager is inaccurate as ultimately, the window manager may do as it pleases.

However, I don't agree that just because something can't be implemented on *some* system, it should be left out on *all* platforms. Actually, I'm sure that there is already functionality in Gtk/Gdk that won't work if, say, you use a weird X server or WM. But should that keep us from using it? I don't think so. We should just handle failure or missing information in a controlled manner. And I believe visibility is meaningful on *most* systems...

- Toralf



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