GDI: fix window not responding, but menu corruption still happens if set_gdi_pixel_format is called

This commit is contained in:
Brad Parker 2017-01-10 23:46:12 -05:00
parent bdc68e679f
commit 6c62901ae5
3 changed files with 29 additions and 11 deletions

View File

@ -521,19 +521,20 @@ LRESULT CALLBACK WndProcGDI(HWND hwnd, UINT message,
switch (message)
{
case WM_PAINT:
{
PAINTSTRUCT ps;
//case WM_PAINT:
//{
/*PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
// All painting occurs here, between BeginPaint and EndPaint.
//FillRect(hdc, &ps.rcPaint, (HBRUSH) (COLOR_WINDOW+1));
FillRect(hdc, &ps.rcPaint, (HBRUSH) (COLOR_WINDOW+1));
EndPaint(hwnd, &ps);
return 0;
break;
}
EndPaint(hwnd, &ps);*/
//return DefWindowProc(hwnd, message, wparam, lparam);
//return 0;
//break;
//}
case WM_DROPFILES:
case WM_SYSCOMMAND:
case WM_CHAR:

View File

@ -354,8 +354,25 @@ static void gdi_gfx_set_nonblock_state(void *data, bool toggle)
static bool gdi_gfx_alive(void *data)
{
(void)data;
video_driver_set_size(&gdi_video_width, &gdi_video_height);
gfx_ctx_size_t size_data;
unsigned temp_width = 0;
unsigned temp_height = 0;
bool quit = false;
bool resize = false;
/* Needed because some context drivers don't track their sizes */
video_driver_get_size(&temp_width, &temp_height);
size_data.quit = &quit;
size_data.resize = &resize;
size_data.width = &temp_width;
size_data.height = &temp_height;
video_context_driver_check_window(&size_data);
if (temp_width != 0 && temp_height != 0)
video_driver_set_size(&temp_width, &temp_height);
return true;
}

View File

@ -298,7 +298,7 @@ void create_gdi_context(HWND hwnd, bool *quit)
(void)quit;
win32_gdi_hdc = GetDC(hwnd);
setup_gdi_pixel_format(win32_gdi_hdc);
//setup_gdi_pixel_format(win32_gdi_hdc);
g_inited = true;
}