Re: XForms: Problems resizing form containing a gl_canvas

From: David Scriven (davidwriter@yahoo.com)
Date: Fri Mar 08 2002 - 19:29:41 EST


Thanks for your comments - I've deleted the double
display statements but unfortunately it doesn't help.
The ConfigureNotify event is not sent when the image
is reduced - squeeze in my onscreen menu. Zooming
works perfectly -it always has - its only when
reducing the size that I have problems. The sequence
for me is Zoom to x2 - OK - Zoom to x3 - OK - Squeeze
to x2 - only see top half of blue & white square in
bottom half of screen - Squeeze to x1 - black screen -
Zoom to x2 only see top half of square - Zoom to x3 -
OK, etc.

See the attached file for a sample text output.
Note that once the ConfigureNotify disappears it does
not reappear.

If I manually extend the window in Y I find that the
Zoom x 2 picture has been drawn correctly, but 200
pixels below the correct position. The Zoom x1 picture
is found 400 pixels below the correct position. Its
almost as if the height is stuck at 600 pixels
internally even though it reports otherwise.

If I zoom to 4x before I contract the image, it acts
as if the 'virtual window' is 800 pixels high - ie.
the actual canvas size seems to be stuck at the
maximum it is sized to, even though it reports its
size as being the same as the window.
 
I don't think this has anything to do with
ConfigureNotify since in an earlier version of the
program from which this code is extracted I ignored
this event and just redrew on Zoom - still had the
same result.

Further, if I comment out the glRasterPos statement
the origin seems to drift to the right.

--- spl@ncmir.ucsd.edu wrote:
> # To subscribers of the xforms list from
> spl@ncmir.ucsd.edu :
>
> > Here is some test code that displays the problem
> > I see. I have checked this with both KDE and Gnome
> > window managers and it shows up in both - so I
> wonder
> > again if the problem is related to the Linux
> version
> > of the form library.
>
> In this particular case the ConfigureNotify event is
> getting delivered
> but appears that there's an extraneous call to your
> function
> DisplayImage():
>
> void ChgSize::OnZoom()
> {
> nXSize = nZoom*200;
> nYSize = nZoom*200;
> fprintf( stderr, "Zoom = %d\n", nZoom );
> fl_freeze_form(Form());
> int cx, cy, cw, ch;
> fl_get_wingeometry(window,&cx, &cy, &cw, &ch);
> fprintf( stderr,
> "Window geometry before Zoom: x = %d, y = %d,
> w = %d, h = %d\n",
> cx, cy, cw, ch );
> fl_get_object_geometry(chgsize->canvas,&cx,
> &cy, &cw, &ch);
> fprintf( stderr,
> "Canvas geometry before Zoom: x = %d, y = %d,
> w = %d, h = %d\n",
> cx, cy, cw, ch);
> fl_set_form_size( Form(), nXSize, nYSize);
> fl_get_wingeometry(window,&cx, &cy, &cw, &ch);
> fl_unfreeze_form(Form());
> bZoom = true;
> // glViewport(0, 0, nXSize -1 , nYSize -1);
> // DisplayImage();
> }
>
> Commenting it out makes the problem go away.
>
 
> spl
> _________________________________________________
> To unsubscribe, send the message "unsubscribe" to
> xforms-request@bob.usuhs.mil or see
> http://bob.usuhs.mil/mailserv/xforms.html
> XForms Home Page: http://world.std.com/~xforms
> List Archive:
> http://bob.usuhs.mil/mailserv/list-archives/
>

______________________________________________________________________
Find, Connect, Date! http://personals.yahoo.ca

 Zoom = 1
Window geometry before Zoom : x = 416 y = 304 w = 200 h = 200
Canvas geometry before Zoom : x = 0 y = 0 w = 200 h = 200
 Zoom = 2
Window geometry before Zoom : x = 416 y = 304 w = 200 h = 200
Canvas geometry before Zoom : x = 0 y = 0 w = 200 h = 200
ConfigureNotify sent
Canvas geometry after Zoom : x = 0 y = 0 w = 400 h = 400
Window geometry after Zoom : x = 416 y = 304 w = 400 h = 400
 Zoom = 3
Window geometry before Zoom : x = 416 y = 304 w = 400 h = 400
Canvas geometry before Zoom : x = 0 y = 0 w = 400 h = 400
ConfigureNotify sent
Canvas geometry after Zoom : x = 0 y = 0 w = 600 h = 600
Window geometry after Zoom : x = 416 y = 304 w = 600 h = 600
 Zoom = 4
Window geometry before Zoom : x = 338 y = 139 w = 600 h = 600
Canvas geometry before Zoom : x = 0 y = 0 w = 600 h = 600
ConfigureNotify sent
Canvas geometry after Zoom : x = 0 y = 0 w = 800 h = 800
Window geometry after Zoom : x = 338 y = 139 w = 800 h = 800
 Zoom = 3
Window geometry before Zoom : x = 338 y = 139 w = 800 h = 800
Canvas geometry before Zoom : x = 0 y = 0 w = 800 h = 800
 Zoom = 2
Window geometry before Zoom : x = 338 y = 139 w = 600 h = 600
Canvas geometry before Zoom : x = 0 y = 0 w = 600 h = 600
 Zoom = 1
Window geometry before Zoom : x = 338 y = 139 w = 400 h = 400
Canvas geometry before Zoom : x = 0 y = 0 w = 400 h = 400
 Zoom = 2
Window geometry before Zoom : x = 338 y = 139 w = 200 h = 200
Canvas geometry before Zoom : x = 0 y = 0 w = 200 h = 200
 Zoom = 3
Window geometry before Zoom : x = 338 y = 139 w = 400 h = 400
Canvas geometry before Zoom : x = 0 y = 0 w = 400 h = 400
 Zoom = 4
Window geometry before Zoom : x = 338 y = 139 w = 600 h = 600
Canvas geometry before Zoom : x = 0 y = 0 w = 600 h = 600

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://world.std.com/~xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/



This archive was generated by hypermail 2b29 : Wed May 01 2002 - 13:54:16 EDT