Re: how to determine maximum possible window size?
- From: Chris MacGregor <chris-gtk-list bouncingdog com>
- To: paul linuxaudiosystems com, "'gtk-list gnome org'" <gtk-list gnome org>
- Subject: Re: how to determine maximum possible window size?
- Date: Tue, 05 Feb 2008 21:27:55 -0800
On 02/05/2008 09:03 PM, Paul Davis wrote:
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, Freedesktop.org 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.
I guess I see what you're getting at, although it's certainly not the answer I
wanted. Thanks for your patience in getting the point across. Part of the
problem is that I was a little fuzzy on the line between GTK and GNOME.
(Things were simpler back when it was just bare X and only fancy commercial
apps used Motif - Xt and Xaw were enough for everyone else. Ah, the ... old
I maintain that it's useful information (and in practice much more useful than
gdk_screen_get_width/height()), but I do recognize that GTK/GDK could only
provide the infomation if it was available from the underlying window system
and/or desktop system, and that it would need to be available from all the
systems GNOME, KDE, MS Windows, etc.) that might be that underlying system,
and that that probably isn't going to happen any time soon. Ugh.
Given all that, any suggestion how I could get the info I'm looking for in at
least the case of GTK-on-GNOME? That's the platform most used by the folks
I'm doing this work for, and it would be nice to make at least that one work
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
Yes, back in 1990 or so I worked with a fellow who was hooked on awm (the
Andrew window manager - he was a CMU grad), and I had to admit it looked
pretty cool, though it would have driven me absolutely nuts if I'd had to
actually use it. But yes, I know exactly what you're talking about, and I've
seen what it does to apps that aren't expecting to have their (invalid)
assumptions violated that way. :-)
] [Thread Prev