[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

2796.0. "Help setting aspect ratio hints" by CIMFIE::TRAGESER (Creeping Elegance) Mon May 21 1990 17:34

    I don't know if this is an X question or a window manager problem...

    I want to enforce the minimum and maximum aspect ratios on a simple
    window.  I've tried setting the window manager hints via
    XSetNormalHints or XSetSizeHints with no luck.  I can successfully
    control all the other size properties (min/max width/height, resize
    increments, etc.), but not the aspect ratio.

    When I run under the DECWindows window manager, it lets me resize the
    window without regard to aspect ratio.  When I run under 'uwm', the
    window manager seems to know about aspect ratio - the ghost window grid
    that appears during resize conforms to the min and max ratios - but it
    still lets me resize the window to any shape.

    Is this a known window manager feature?

    Does anyone know how to enforce aspect ratio, short of doing it yourself?

    Thanks.
T.RTitleUserPersonal
Name
DateLines
2796.1Any help out there?CIMFIE::TRAGESERCreeping EleganceThu May 24 1990 11:5138
    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??
    
2796.2PSW::WINALSKICareful with that VAX, EugeneThu May 24 1990 15:226
RE: .1

Given that this is a customer problem, you should file a SPR, not a QAR, unless
it's for a field test version of software.

--PSW
2796.3Dreaming up new features all the timeTOOLEY::B_WACKERThu May 24 1990 15:3113
The aspect parameters as mentioned on 4-17 of the new programming supplement 
are DISPLAY parameters.  As I told a customer (probably the same one) there 
is nothing in the documentation to indicate anything automatic about maintaining
WINDOW aspect ratio.

Aspect ratio of the display can be used to customize graphics so you put the 
correct number of pixels on the sides of a square so that it appears square.

If you want to maintain some dimensional ratio in a window then I think you
have to do it yourself.  Besides, theres nowhere to tell it whether to adjust
vertical to match horizontal or vice versa.

Bruce
2796.4Not according to the docs...CIMNET::TRAGESERCreeping EleganceWed May 30 1990 16:2026
    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??
    
2796.5They're only hints....CVG::PETTENGILLmulpThu May 31 1990 23:1020
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.