[comp.sys.amiga.programmer] 1.3 -> 2.0 Windowing Problem

bneal@umaxc.weeg.uiowa.edu (Brian Neal) (05/08/91)

	I have this application that opens a window on the workbench.
It sits there as nothing more than a title bar.  When the window is
active and the user clicks the right mouse button, the window changes
sizes revealing gadgets and such (ala VirusX).  Internally, my program
waits at the window's IDCMP port.  When it gets a MENUDOWN hit it makes
a call to SizeWindow and goes back to sleep.  When my program gets a 
NEWSIZE message from Intuition, then it adds all the gadgets and text
and stuff.
	This works beautifully under 1.3.  However, 2.0 gives me fits.
It works just fine as long as I don't drag the window.  If I drag the
expanded window, the window moves to the new position and when I release
the left mouse button the window unexpectedly shrinks back to title
bar size.  If I click the mouse my machine locks up.
	Please help!  I thought I was following the rules, but apparently
something new is going on I don't know about in 2.0.
	Thanks!

Brian

peter@cbmvax.commodore.com (Peter Cherna) (05/08/91)

In article <5944@ns-mx.uiowa.edu> bneal@umaxc.weeg.uiowa.edu (Brian Neal) writes:
>	This works beautifully under 1.3.  However, 2.0 gives me fits.
>It works just fine as long as I don't drag the window.  If I drag the
>expanded window, the window moves to the new position and when I release
>the left mouse button the window unexpectedly shrinks back to title
>bar size.  If I click the mouse my machine locks up.

Well, what kind of IntuiMessages are you receiving?  Figure out what
code of yours is being executed when you release the mouse.  Perhaps
it's you that's calling SizeWindow() when you shouldn't be.

Also, what version of 2.0 are you running (type "version" in the Shell)?

Is there anything else unusual you're doing, such as writing into
the Window structure?

>Brian

     Peter
--
Peter Cherna, Operating Systems Development Group, Commodore-Amiga, Inc.
{uunet|rutgers}!cbmvax!peter    peter@cbmvax.commodore.com
My opinions do not necessarily represent the opinions of my employer.
"If all you have is a hammer, everything looks like a nail."

bneal@umaxc.weeg.uiowa.edu (Brian Neal) (05/09/91)

From article <21382@cbmvax.commodore.com>, by peter@cbmvax.commodore.com (Peter Cherna):
> 
> Well, what kind of IntuiMessages are you receiving?  Figure out what
> code of yours is being executed when you release the mouse.  Perhaps
> it's you that's calling SizeWindow() when you shouldn't be.
> 
	I sprinkled some puts's in my event handling code.  Apparently
my program is sleeping during the lockup.  I put puts's for each case
in a switch statement (in the IntuiMessage decoding part of the code).
Nothing gets output to the screen prior to the lockup.

> Also, what version of 2.0 are you running (type "version" in the Shell)?
> 
	Kickstart 36.143	Workbench 36.68

> Is there anything else unusual you're doing, such as writing into
> the Window structure?
> 
	No, I am not writing into the window structure.  I am however
drawing into the titlebar region of the window via PrintIText().
Perhaps this is the culprit?  I will test this hypothesis...

> 
>      Peter

	Thanks for your interest.
	Brian

peter@cbmvax.commodore.com (Peter Cherna) (05/09/91)

In article <5965@ns-mx.uiowa.edu> bneal@umaxc.weeg.uiowa.edu (Brian Neal) writes:
>	Kickstart 36.143	Workbench 36.68

This version of Kickstart has bug where if you call SizeWindow(), you
don't get sent a NEWSIZE event.  1.3 would send you a NEWSIZE
event, and more recent versions of Kickstart 2.0 send NEWSIZE as well.

For arcane reasons, the minimum and maximum limits on window dimensions
(MinWidth, MinHeight, MaxWidth, MaxHeight) are supposed to be ignored
for windows that have no sizing gadget. However, there was a bug where
if you used SizeWindow() to make a window's size exceed its specified
limits, it would "snap back" to "legal" when you drag it.  That would
explain why the window snaps.  I can't remember if that was fixed
before 36.143 or soon after (it certainly is fixed in 2.02 and higher).

You should contact your dealer and update to 2.03, which consists
of Kickstart 36.209 and Workbench 36.102, or if he only has 2.02,
take that (Kickstart 36.207, WB 36.69) and see to it that he
receives 2.03 soon.

>	Thanks for your interest.
>	Brian

     Peter
--
Peter Cherna, Operating Systems Development Group, Commodore-Amiga, Inc.
{uunet|rutgers}!cbmvax!peter    peter@cbmvax.commodore.com
My opinions do not necessarily represent the opinions of my employer.
"If all you have is a hammer, everything looks like a nail."