[0.4.13][WIN32SS] Repaint the whole window frame on some style bits set (#3199) CORE...
authorJoachim Henze <Joachim.Henze@reactos.org>
Fri, 11 Mar 2022 02:20:06 +0000 (03:20 +0100)
committerJoachim Henze <Joachim.Henze@reactos.org>
Fri, 11 Mar 2022 02:20:06 +0000 (03:20 +0100)
This fixes the ReactOS Calculator buttons disappearing in CORE-16827

It once regressed by 0.4.13-dev-221-g 2161dd85dc743462916487366783389633a5a8f2
which did aim to fix CORE-15934.
Noteworthy that releases/0.4.12 was never affected although I fixed CORE-15934
there as well, but *not* with the fix that went into master later!

fix picked from commit 0.4.15-dev-1197-g 8081ba93321e04916f854ba85f3ab512254c1b04

For the record: We know that what we do commit here for the time being is a workaround just,
and we will most likely replace it later with a proper patch from CORE18072.
But only after that one settled down for a while. Until then, this thing here will mitigate.

win32ss/user/ntuser/winpos.c

index 8c6682a..5413ce6 100644 (file)
@@ -2113,13 +2113,25 @@ co_WinPosSetWindowPos(
 
                     if ( !(pwnd->style & WS_CHILD) )
                     {
-                        HRGN DcRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
-                        PREGION DcRgnObj = REGION_LockRgn(DcRgn);
-                        TRACE("SWP_FRAMECHANGED win %p hRgn %p\n",pwnd, DcRgn);
-                        IntGdiCombineRgn(DcRgnObj, VisBefore, NULL, RGN_COPY);
-                        REGION_UnlockRgn(DcRgnObj);
-                        ForceNCPaintErase(pwnd, DcRgn, DcRgnObj);
-                        GreDeleteObject(DcRgn);
+                        /*
+                         * Check if we have these specific windows style bits set/reset.
+                         * FIXME: There may be other combinations of styles that need this handling as well.
+                         * This fixes the ReactOS Calculator buttons disappearing in CORE-16827.
+                         */
+                        if ((Window->style & WS_CLIPSIBLINGS) && !(Window->style & (WS_POPUP | WS_CLIPCHILDREN | WS_SIZEBOX)))
+                        {
+                            IntSendNCPaint(pwnd, HRGN_WINDOW); // Paint the whole frame.
+                        }
+                        else  // Use region handling
+                        {
+                            HRGN DcRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
+                            PREGION DcRgnObj = REGION_LockRgn(DcRgn);
+                            TRACE("SWP_FRAMECHANGED win %p hRgn %p\n",pwnd, DcRgn);
+                            IntGdiCombineRgn(DcRgnObj, VisBefore, NULL, RGN_COPY);
+                            REGION_UnlockRgn(DcRgnObj);
+                            ForceNCPaintErase(pwnd, DcRgn, DcRgnObj);
+                            GreDeleteObject(DcRgn);
+                        }
                     }
                 }
              }