Commit 72337011 authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Create a dummy window surface for windows that shouldn't be painted to.

parent 81525453
......@@ -191,12 +191,9 @@ static void reset_dce_attrs( struct dce *dce )
*/
static void release_dce( struct dce *dce )
{
RECT vis_rect;
if (!dce->hwnd) return; /* already released */
vis_rect = get_virtual_screen_rect();
__wine_set_visible_region( dce->hdc, 0, &vis_rect, &vis_rect, NULL );
__wine_set_visible_region( dce->hdc, 0, &dummy_surface.rect, &dummy_surface.rect, &dummy_surface );
USER_Driver->pReleaseDC( dce->hwnd, dce->hdc );
if (dce->clip_rgn) DeleteObject( dce->clip_rgn );
......
......@@ -487,6 +487,67 @@ BOOL is_desktop_window( HWND hwnd )
/*******************************************************************
* Dummy window surface for windows that shouldn't get painted.
*/
static void dummy_surface_lock( struct window_surface *window_surface )
{
/* nothing to do */
}
static void dummy_surface_unlock( struct window_surface *window_surface )
{
/* nothing to do */
}
static void *dummy_surface_get_bitmap_info( struct window_surface *window_surface, BITMAPINFO *info )
{
static DWORD dummy_data;
info->bmiHeader.biSize = sizeof( info->bmiHeader );
info->bmiHeader.biWidth = dummy_surface.rect.right;
info->bmiHeader.biHeight = dummy_surface.rect.bottom;
info->bmiHeader.biPlanes = 1;
info->bmiHeader.biBitCount = 32;
info->bmiHeader.biCompression = BI_RGB;
info->bmiHeader.biSizeImage = 0;
info->bmiHeader.biXPelsPerMeter = 0;
info->bmiHeader.biYPelsPerMeter = 0;
info->bmiHeader.biClrUsed = 0;
info->bmiHeader.biClrImportant = 0;
return &dummy_data;
}
static RECT *dummy_surface_get_bounds( struct window_surface *window_surface )
{
static RECT dummy_bounds;
return &dummy_bounds;
}
static void dummy_surface_flush( struct window_surface *window_surface )
{
/* nothing to do */
}
static void dummy_surface_destroy( struct window_surface *window_surface )
{
/* nothing to do */
}
static const struct window_surface_funcs dummy_surface_funcs =
{
dummy_surface_lock,
dummy_surface_unlock,
dummy_surface_get_bitmap_info,
dummy_surface_get_bounds,
dummy_surface_flush,
dummy_surface_destroy
};
struct window_surface dummy_surface = { &dummy_surface_funcs, { NULL, NULL }, 1, { 0, 0, 1, 1 } };
/*******************************************************************
* register_window_surface
*
* Register a window surface in the global list, possibly replacing another one.
......@@ -495,8 +556,8 @@ void register_window_surface( struct window_surface *old, struct window_surface
{
if (old == new) return;
EnterCriticalSection( &surfaces_section );
if (old) list_remove( &old->entry );
if (new) list_add_tail( &window_surfaces, &new->entry );
if (old && old != &dummy_surface) list_remove( &old->entry );
if (new && new != &dummy_surface) list_add_tail( &window_surfaces, &new->entry );
LeaveCriticalSection( &surfaces_section );
}
......
......@@ -80,6 +80,7 @@ typedef struct tagWND
/* Window functions */
extern HWND get_hwnd_message_parent(void) DECLSPEC_HIDDEN;
extern BOOL is_desktop_window( HWND hwnd ) DECLSPEC_HIDDEN;
extern struct window_surface dummy_surface DECLSPEC_HIDDEN;
extern void register_window_surface( struct window_surface *old, struct window_surface *new ) DECLSPEC_HIDDEN;
extern void flush_window_surfaces( BOOL idle ) DECLSPEC_HIDDEN;
extern WND *WIN_GetPtr( HWND hwnd ) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment