Implementation of ReleaseDC(), works for now but could be made more efficient
authorGé van Geldorp <ge@gse.nl>
Fri, 3 Oct 2003 18:04:37 +0000 (18:04 +0000)
committerGé van Geldorp <ge@gse.nl>
Fri, 3 Oct 2003 18:04:37 +0000 (18:04 +0000)
svn path=/trunk/; revision=6219

reactos/subsys/win32k/ntuser/windc.c
reactos/subsys/win32k/objects/dc.c

index e1d6c74..b6c4320 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: windc.c,v 1.25 2003/09/26 20:58:05 gvg Exp $
+/* $Id: windc.c,v 1.26 2003/10/03 18:04:37 gvg Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -227,7 +227,6 @@ DceReleaseDC(DCE* dce)
       return 0;
     }
 
-#if 0
   /* restore previous visible region */
 
   if ((dce->DCXFlags & (DCX_INTERSECTRGN | DCX_EXCLUDERGN)) &&
@@ -252,7 +251,6 @@ DceReleaseDC(DCE* dce)
          dce->DCXFlags |= DCX_DCEEMPTY;
        }
     }
-#endif
 
   return 1;
 }
@@ -362,7 +360,9 @@ NtUserGetDCEx(HWND hWnd, HANDLE ClipRegion, ULONG Flags)
              else if (Dce->hwndCurrent == hWnd &&
                       ((Dce->DCXFlags & DCX_CACHECOMPAREMASK) == DcxFlags))
                {
+#if 0 /* FIXME */
                  UpdateVisRgn = FALSE;
+#endif
                  UpdateClipOrigin = TRUE;
                  break;
                }
index cfe65ab..2960908 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: dc.c,v 1.83 2003/09/26 20:58:06 gvg Exp $
+/* $Id: dc.c,v 1.84 2003/10/03 18:04:37 gvg Exp $
  *
  * DC.C - Device context functions
  *
@@ -884,7 +884,9 @@ NtGdiSetDCState ( HDC hDC, HDC hDCSave )
          dc->w.hClipRgn = 0;
        }
        CLIPPING_UpdateGCRegion( dc );
+       DC_UnlockDc ( hDC );
 #else
+       DC_UnlockDc ( hDC );
        NtGdiSelectClipRgn(hDC, dcs->w.hClipRgn);
 #endif
 
@@ -898,11 +900,13 @@ NtGdiSetDCState ( HDC hDC, HDC hDCSave )
 #if 0
        GDISelectPalette16( hDC, dcs->w.hPalette, FALSE );
 #endif
+      } else {
+       DC_UnlockDc(hDC);      
       }
-
       DC_UnlockDc ( hDCSave );
+    } else {
+      DC_UnlockDc ( hDC );
     }
-    DC_UnlockDc ( hDC );
   }
 }