Re: how to determine maximum possible window size?

On Tue, 2008-02-05 at 20:40 -0800, Chris MacGregor wrote:

> So I would think it appropriate that it (GDK, I guess) provide (instead of or 
> in addition to those functions) functions that return the *available* screen 
> size after deducting whatever the underlying window system is providing that 
> semi-permanently occupies screen real estate, such as panels/taskbars/etc.  It 
> doesn't really make sense to me that the answer is "no, portable GTK-based 
> apps must (unportably!!) go around the portability library layers and talk 
> directly to the underlying window system to try to figure that out".  

This is the direct opposite of what I was saying. Or almost the
opposite. My point is that GDK & GTK can tell you (easily) about what
the backend window system will allow/can do etc etc. You want the screen
width? Not a problem. 

However, GDK & GTK are not desktop systems themselves. So they have a
much harder time (maybe an impossible time) telling you what the desktop
system that the user has in front of them has done with all that
(physical) screen real estate. Has the desktop put a panel at the bottom
of the screen? Is it set to "autohide" ? Is there some kind of "top menu
bar" visible all the time? GTK doesn't know the answers to these
questions. It *could* contain code to discover it, but AFAICT, that code
should be a higher-level library than GTK, which is why I mentioned
GNOME. Problem is, even then its not exactly standard. Your GTK app
could run on a KDE desktop that behaves entirely differently to a GNOME
desktop. AFAIK, has not yet provided any APIs to
generically check with the desktop system and find out the answers that
you are seeking. I am not even sure that they ever will.

Note that although its an edge case, there are also regular window
managers for plain old X11 that use a tiled window policy. Your
computation of "how much screen real estate is available" will almost
certainly break on such systems. I know these are rare these days, but I
just wanted to mention it to show that its not just caused by
cross-platform issues.


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