From d6b8ce782d8f2f40418ddb571e34329ea7a8f35d Mon Sep 17 00:00:00 2001 From: Dimitris Panokostas Date: Fri, 1 May 2026 10:57:43 +0200 Subject: [PATCH] fix(backfill): gate MUI 3.x equality guard on muimaster lib_Version Commit 6e678e4 removed the long-standing "stuntzi" early-return guard in the MUIM_Backfill handler so MUI 4/5 would stop rendering as a blue checkerboard. That regressed MUI 3.8 / 3.9, which need the guard to avoid painting outside the gadget bounds. Restore the guard but only apply it when MUIMasterBase->lib_Version <= 20 (MUI 3.9 = v20, MUI 3.8 = v19). MUI 4+ (v21+) keeps the unguarded path introduced for the checkerboard fix. Verified working on both MUI 3.8 and MUI 5. --- mcc/Dispatcher.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/mcc/Dispatcher.cpp b/mcc/Dispatcher.cpp index 31064b6..c20fcb7 100644 --- a/mcc/Dispatcher.cpp +++ b/mcc/Dispatcher.cpp @@ -581,6 +581,23 @@ CPPDISPATCHER(_Dispatcher) b = bmsg->bottom; if (l>r || t>b) return 0; + + /* MUI 3.x (muimaster.library v20 = MUI 3.9, v19 = MUI 3.8) calls + ** MUIM_Backfill with bounds that can extend outside the gadget, + ** which makes us paint over our siblings ("stuntzi hack"). + ** MUI 4+ (v21+) calls Backfill correctly with partial regions + ** inside the gadget; applying the equality guard there would + ** skip every render and produce the blue checkerboard pattern. + */ + if (MUIMasterBase->lib_Version <= 20) + { + if (!(l==_mleft(obj) && t==_mtop(obj) && r==_mright(obj) && b==_mbottom(obj))) + { + D(DBF_ALWAYS, "HTMLview: %ld %ld, %ld %ld, %ld %ld, %ld %ld", + l,_mleft(obj),t,_mtop(obj),r,_mright(obj),b,_mbottom(obj)); + return 0; + } + } } struct RastPort *rp = _rp(obj);