| Any help on this one? I have a customer waiting for an answer. I'll
file a QAR if need be, but I'm sure someone out there has played with
this. Here's a ridiculously simple code fragment:
main ()
{
static XSizeHints hints = {
PAspect,
0, 0,
100, 100,
100, 100,
500, 500,
100, 100,
{1, 2}, /* minimum aspect ratio */
{2, 1} /* maximum ascpet ratio */
};
/* open display, etc ... */
win = XCreateSimpleWindow(display, DefaultRootWindow(display),
0, 0, WIN_WIDTH, WIN_HEIGHT, BORDER_WIDTH, fg, bg);
XSetNormalHints(display, win, &hints);
XSelectInput(display, win, ExposureMask);
XMapWindow(display, win);
XWindowEvent(display, win, ExposureMask, &xev);
while (TRUE)
XNextEvent(display, &xev);
}
Am I doing something wrong??
|
| But wait a second - according to the documentation, the aspect ratios
in the size hints structure DO refer to the window, and not to the
display. To quote the VMS DECwindows Guide to XLIB, Table 3-10, "Size
Hints Data Structure Members":
"Setting the minimum and maximum aspects indicates the preferred
range of the size of a window...
"For example, if the minimum aspect of x is 1 and y is 2, and the
maximum aspect of x is 2 and y is 5, then the minimum window size
is a ratio of 1/2, and the maximum is a ratio of 2/5. In this case
a window could have a width of 300 pixels and a height of 600
pixels minimally, and maximally a width of 600 pixels and a height
of 1500 pixels."
This seems clear enough. As I said, the uwm window manager does pay
attention to these ratios, as reflected in the ghost resize grid,
even though it treats them as only a suggestion. (If you ask me,
this is inconsistent because the other size hints are treated as
absolute requirements.)
The above documentation seems to imply that the ratios are even more
than suggestions and are enforced.
So what's the deal??
|
| That a particular window manager `enforces' the hints, doesn't change the fact
that they are still hints. A window manager can ignore the hints either thru
policy or simple sloth.
My guess is that the DECwindows window manger ignores aspect ratio as policy
and uwm provides the aspect ratio as a guide to the user but as policy lets
the user decide.
To ensure that the customer gets an answer, you should submit an SPR on behalf
of the customer; that is the only official channel.
You should also keep in mind the pending changes as a result of Motif. You
may wish to raise this issue in the Motif conference to see if anyone knows
the current Motif policy on this particular hint.
BTW, I can't think of any particular case where I think that the aspect ratio
hint should be enforced and I can think of many cases where I wouldn't want one
enforced. You might want to put together an argument that explains why this
hint should be followed contrary to the user's preference, ie., under what
circumstances it is wrong for the user to always be in control.
|