On 15 May 2000, Alexandre Julliard wrote:
> Ove Kaaven <[EMAIL PROTECTED]> writes:
>
> > If I did, X11DRV_DIB_UpdateDIBSection would not be able to do its job; it
> > would be rather difficult to sync GDI access and surface access.
>
> You'd need to hack it a bit to locate the correct bitmap, but this
> seems to me less dangerous than messing with the DCE cache...
Well, the following is all the messing it takes; I'd just call this
DCE_Reinit() after installing (and removing) the display driver override.
Doesn't look dangerous to me. But I can probably investigate how difficult
it would be to get this working without memory DCs... although I have a
feeling doing it without might be even uglier and have more problems.
Index: include/dce.h
===================================================================
RCS file: /home/wine/wine/include/dce.h,v
retrieving revision 1.7
diff -u -r1.7 dce.h
--- include/dce.h 2000/03/08 18:26:57 1.7
+++ include/dce.h 2000/05/15 19:12:54
@@ -49,6 +49,7 @@
extern void DCE_Init(void);
+extern void DCE_Reinit(void);
extern DCE* DCE_AllocDCE( HWND hWnd, DCE_TYPE type );
extern DCE* DCE_FreeDCE( DCE *dce );
extern void DCE_FreeWindowDCE( struct tagWND* );
Index: windows/dce.c
===================================================================
RCS file: /home/wine/wine/windows/dce.c,v
retrieving revision 1.35
diff -u -r1.35 dce.c
--- windows/dce.c 2000/03/28 20:23:08 1.35
+++ windows/dce.c 2000/05/15 19:12:55
@@ -371,6 +371,31 @@
/***********************************************************************
+ * DCE_Reinit
+ */
+void DCE_Reinit(void)
+{
+ int i = 0;
+ DCE * dce;
+
+ for (dce = firstDCE; (dce);)
+ if ((dce->DCXflags & (DCX_CACHE | DCX_DCEBUSY)) == DCX_CACHE ) {
+ dce = DCE_FreeDCE( dce );
+ i++;
+ } else dce = dce->next;
+
+ DeleteDC( defaultDCstate );
+ defaultDCstate = 0;
+
+ while (i--)
+ {
+ if (!(dce = DCE_AllocDCE( 0, DCE_CACHE_DC ))) return;
+ if (!defaultDCstate) defaultDCstate = GetDCState16( dce->hDC );
+ }
+}
+
+
+/***********************************************************************
* DCE_GetVisRect
*
* Calculate the visible rectangle of a window (i.e. the client or