Ghosting issue in MUI with Update 3

A forum for general AmigaOS 4.x support questions that are not platform-specific
Post Reply
User avatar
ChrisH
Beta Tester
Beta Tester
Posts: 915
Joined: Mon Dec 20, 2010 9:09 pm
Contact:

Ghosting issue in MUI with Update 3

Post by ChrisH »

MUI is not correctly ghosting images inside a ghosted group. Please see the attached picture, taken from my (unreleased) AmiSystemRestore program... but basically it is ghosting the whole group AND ghosting the embedded image, leading to a "double ghosted" effect.

If it make any difference, each button is constructed using the following MUI code:

Code: Select all

Child, GroupObject,
	MUIA_Background,MUII_ButtonBack, MUIA_Frame,MUIV_Frame_Button, MUIA_InputMode,MUIV_InputMode_RelVerify,
	Child, GroupObject, MUIA_Group_Horiz,MUI_TRUE,
		MUIA_Frame,MUIV_Frame_None,
		Child, DtpicObject, MUIA_Dtpic_Name, "some pic", End,
		Child, FreeLabel("some label"),
		Child, RectangleObject, MUIA_InnerLeft,0, MUIA_InnerRight,0, MUIA_InnerTop,0, MUIA_InnerBottom,0, End,
	End,
End
BTW, I had to define my own Dtpic macros, since they are missing from the current SDK:

Code: Select all

#define DtpicObject MUI_NewObject(MUIC_Dtpic
#define MUIA_Dtpic_Name 0x80423d72 /* V18 isg STRPTR */
(Hopefully I converted this correctly to C, from my actual E code.)
Attachments
MUI_bug.png
MUI_bug.png (12.53 KiB) Viewed 3077 times

User avatar
tboeckel
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 68
Joined: Mon Jun 20, 2011 8:56 am
Contact:

Re: Ghosting issue in MUI with Update 3

Post by tboeckel »

This is not really a bug, since several other attributes absolutely require forwarding of these attrbutes to the embedded child objects upon OM_SET. Hence MUIA_Disabled is of course set for the group object as well as for all embedded child objects.

If this is not desireable then use MUIA_Group_Forward,FALSE right ahead of those attributes which must not be forwarded to the embedded objects.

User avatar
tboeckel
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 68
Joined: Mon Jun 20, 2011 8:56 am
Contact:

Re: Ghosting issue in MUI with Update 3

Post by tboeckel »

BTW, all previous MUI releases behaved the same way. Thus is issue is nothing new.

User avatar
ChrisH
Beta Tester
Beta Tester
Posts: 915
Joined: Mon Dec 20, 2010 9:09 pm
Contact:

Re: Ghosting issue in MUI with Update 3

Post by ChrisH »

tboeckel wrote:BTW, all previous MUI releases behaved the same way. Thus is issue is nothing new.
I did not notice this issue before Update 3.

Of course it is possible that the ghosting of the image was aligned with the group's ghosting, making the "double ghosting" invisible. This could have been accidental, but perhaps it was intentional (and was broken by Update 3)?

Another (less likely) alternative is that images previously (intentionally) ignored ghosting requests, but the newer one doesn't?
This is not really a bug, since several other attributes absolutely require forwarding of these attrbutes to the embedded child objects upon OM_SET. Hence MUIA_Disabled is of course set for the group object as well as for all embedded child objects.
I am still not entirely convinced it's not a bug, since it does NOT (appear to) happen with text objects.
If this is not desireable then use MUIA_Group_Forward,FALSE right ahead of those attributes which must not be forwarded to the embedded objects.
Thanks for this work-around. But MUIA_Group_Forward doesn't seem to be documented, so I am not clear when it's effect finishes.

User avatar
tboeckel
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 68
Joined: Mon Jun 20, 2011 8:56 am
Contact:

Re: Ghosting issue in MUI with Update 3

Post by tboeckel »

ChrisH wrote:Of course it is possible that the ghosting of the image was aligned with the group's ghosting, making the "double ghosting" invisible. This could have been accidental, but perhaps it was intentional (and was broken by Update 3)?
ChrisH wrote:I am still not entirely convinced it's not a bug, since it does NOT (appear to) happen with text objects.
Text.mui definitely draws the disabled pattern for disabled objects. Maybe here again the pattern offsets coincide with the group's disabled pattern, while the image's dont. MUI does a simple SetAfPt() followed by a RectFill() to draw that pattern. Nothing really fancy.
ChrisH wrote:Another (less likely) alternative is that images previously (intentionally) ignored ghosting requests, but the newer one doesn't?
No, I just checked with the oldest revision of the source I have (dated June 2008) and Image.mui does draw the disabled pattern. And Group.mui also forwarded MUIA_Disabled to all its children.
ChrisH wrote:Thanks for this work-around. But MUIA_Group_Forward doesn't seem to be documented, so I am not clear when it's effect finishes.
The effect finishes either at the end of the list of attributes being set with one call to SetAttrs() or at the next MUIA_Group_Forward,TRUE.

Checking the source again I noticed that MUIA_Disabled is always forwarded to the children, no matter if MUIA_Group_Forward is used or not. Thus the workaround will not work as expected as the embedded image object always become disabled and hence draw their own disabled pattern. I think I'll have to modify MUI to correctly handle nested embedded disabled objects.

User avatar
ChrisH
Beta Tester
Beta Tester
Posts: 915
Joined: Mon Dec 20, 2010 9:09 pm
Contact:

Re: Ghosting issue in MUI with Update 3

Post by ChrisH »

tboeckel wrote:Checking the source again I noticed that MUIA_Disabled is always forwarded to the children, no matter if MUIA_Group_Forward is used or not. Thus the workaround will not work as expected as the embedded image object always become disabled and hence draw their own disabled pattern. I think I'll have to modify MUI to correctly handle nested embedded disabled objects.
Ah, that explains why I couldn't get it to work :-/

User avatar
ChrisH
Beta Tester
Beta Tester
Posts: 915
Joined: Mon Dec 20, 2010 9:09 pm
Contact:

Re: Ghosting issue in MUI with Update 3

Post by ChrisH »

tboeckel wrote:Checking the source again I noticed that MUIA_Disabled is always forwarded to the children, no matter if MUIA_Group_Forward is used or not. Thus the workaround will not work as expected as the embedded image object always become disabled and hence draw their own disabled pattern. I think I'll have to modify MUI to correctly handle nested embedded disabled objects.
This may have been intentional (?), because if I clear MUIA_Disabled on the image itself (after setting it for the whole group), then the image (still appears double-ghosted - until a refresh when it) does not appear ghosted at all.

OTOH, this may be a drawing bug in MUI (as suggested by the refresh issue), where the ghosting pattern is being drawn at the wrong time, or else is being unintentionally drawn twice (at a slightly different position).

In any case, it looks like you need to carefully test any "fixes" you make, to check for unintended side-effects.

Post Reply