[GDI32] Use Gdi Flush for SetViewportOrgEx.
authorjimtabor <james.tabor@reactos.org>
Thu, 13 Feb 2020 23:05:38 +0000 (17:05 -0600)
committerjimtabor <james.tabor@reactos.org>
Thu, 13 Feb 2020 23:05:38 +0000 (17:05 -0600)
Fixes offset in combo texts and menu highlights. See CORE-16644 & CORE-16656.

win32ss/gdi/gdi32/objects/coord.c

index dd40889..b27711c 100644 (file)
@@ -458,7 +458,7 @@ GetWindowOrgEx(
 }
 
 /*
 }
 
 /*
- * @unimplemented
+ * @implemented
  */
 BOOL
 WINAPI
  */
 BOOL
 WINAPI
@@ -525,7 +525,7 @@ SetViewportExtEx(
 }
 
 /*
 }
 
 /*
- * @unimplemented
+ * @implemented
  */
 BOOL
 WINAPI
  */
 BOOL
 WINAPI
@@ -577,7 +577,7 @@ SetWindowOrgEx(
 }
 
 /*
 }
 
 /*
- * @unimplemented
+ * @implemented
  */
 BOOL
 WINAPI
  */
 BOOL
 WINAPI
@@ -648,7 +648,7 @@ SetWindowExtEx(
 }
 
 /*
 }
 
 /*
- * @unimplemented
+ * @implemented
  */
 BOOL
 WINAPI
  */
 BOOL
 WINAPI
@@ -669,7 +669,16 @@ SetViewportOrgEx(
         /* Do not set LastError here! */
         return FALSE;
     }
         /* Do not set LastError here! */
         return FALSE;
     }
-
+    //// HACK : XP+ doesn't do this. See CORE-16656 & CORE-16644.
+    if (NtCurrentTeb()->GdiTebBatch.HDC == hdc)
+    {
+        if (pdcattr->ulDirty_ & DC_MODE_DIRTY)
+        {
+            NtGdiFlush();
+            pdcattr->ulDirty_ &= ~DC_MODE_DIRTY;
+        }
+    }
+    ////
     if (lpPoint)
     {
         lpPoint->x = pdcattr->ptlViewportOrg.x;
     if (lpPoint)
     {
         lpPoint->x = pdcattr->ptlViewportOrg.x;