#78 Reshape callback with wrong arguments etc.

open
nobody
None
5
2005-07-10
2005-07-10
No

Original bug is 1007994.
https://sourceforge.net/tracker/?func=detail&aid=1007994&group_id=1032&atid=101032

I cannot attach a test program in the original bug so I
created this bug.

Problem description (duplicated from original bug):
* The reshape callback is invoked with wrong (not
actual) size in special case.
Some window managers prohibit very small window size.
* The reshape callback is invoked twice.
First invoked with glutReshapeWindow(), second
invoked in ConfigureNotify.
* The reshape callback is not invoked upon window
creation on Linux with no window manager.

Here is a test program (1007994reshapebug.c). This
program trys to change the window size 200x200 -
300x300 - 1x1.
Please press any key three times on the window and
compare outputs.
Expected output:
----- begin
reshape callback called: 200 x 200 - actual size 200 x 200
reshape callback called: 300 x 300 - actual size 300 x 300
reshape callback called: 200 x 50 - actual size 200 x 50
----- end
On my freeglut 2.4.0:
----- begin
reshape callback called: 200 x 200 - actual size 200 x 200
reshape callback called: 300 x 300 - actual size 200 x 200
reshape callback called: 300 x 300 - actual size 300 x 300
reshape callback called: 1 x 1 - actual size 200 x 50
reshape callback called: 200 x 50 - actual size 200 x 50
----- end
Line 2 and 4 are added and wrong. If you have no window
manager you cannot get the first callback.

Discussion

  • Richard Rauch

    Richard Rauch - 2005-07-29

    Logged In: YES
    user_id=854844

    Hi.

    I've been working on the codebase for close to two years
    (though a little over a year ago, I found it necessary to
    take part in a fork in order to extend the codebase).

    On my own copy of the code base, here are the results. I get
    these same results in both twm (as shipped with XFree86 4.2
    or so) and "without any [external] window manager" (using the
    wm built into the X server):

    Press any key three times on the window to continue.
    Following is the expected output.
    NOTE: Last size may vary according to your window manager.
    ----- begin
    reshape callback called: 200 x 200 - actual size 200 x 200
    reshape callback called: 300 x 300 - actual size 300 x 300
    reshape callback called: 200 x 50 - actual size 200 x 50
    ----- end
    reshape callback called: 200 x 200 - actual size 200 x 200
    reshape callback called: 300 x 300 - actual size 300 x 300
    reshape callback called: 1 x 1 - actual size 1 x 1

    I cannot speak for freeglut proper, but can you compare your
    results under, specifically, twm? And/or specify which
    window managers you've used besides the "none" case?

    This will probably help freeglut developers as well as
    myself. Thanks.

     
  • Takeshi Nishimura

    Logged In: YES
    user_id=1121281

    Sorry, I've forgotten to write about my machine.
    Problems are found on SUSE Linux 9.1 / KDE 3.2.

     
  • Richard Rauch

    Richard Rauch - 2005-08-01

    Logged In: YES
    user_id=854844

    With KDE 3.4.1nb1 (3.4.1 with a pkgsrc local patch level 1), here is the
    result of your program, compiled against my codebase:

    Press any key three times on the window to continue.
    Following is the expected output.
    NOTE: Last size may vary according to your window manager.
    ----- begin
    reshape callback called: 200 x 200 - actual size 200 x 200
    reshape callback called: 300 x 300 - actual size 300 x 300
    reshape callback called: 200 x 50 - actual size 200 x 50
    ----- end
    reshape callback called: 200 x 200 - actual size 200 x 200
    reshape callback called: 300 x 300 - actual size 300 x 300
    reshape callback called: 141 x 48 - actual size 141 x 48

    ...so, either this is a new bug introduced in freeglut in the past 18
    months, or it is something that I fixed since that time.

    I suspect the latter, as the freeglut window reshape code is really
    horrible, and I've re-examined it at least once or twice since I was a
    freeglut developer.

    One thing, if you have not noticed, is that (at least originally) freeglut
    handled reshapes *very* differently in WIN32 and UNIX_X11, as I recall.
    It is pretty twisted code.

     
  • Diederick C. Niehorster

    reshapes (and callbacks therefore) are handled in very straightforward way nowadays, does either of you have interest in retesting and seeing if you can break it? (Note: Gamemode on X11 does have trouble, you can leave that out of the tests...)

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks