https://bugs.winehq.org/show_bug.cgi?id=54271
--- Comment #6 from 399989567@qq.com --- (In reply to Bartosz from comment #1)
How I could reproduce the issue? Please provide step by step instruction.
A relatively new clue: I commented out everything in get_gif_background_color and used the following writeup, and the background color no longer shows up as solid black (or various other strange colors)
Is there a problem with reading in the data
'''
/* Get window handle by pid */ HWND GetHwndByPid(DWORD dwProcessID) { HWND h = GetTopWindow(0); HWND retHwnd = NULL; while (h) { DWORD pid = 0; DWORD dwTheardId = GetWindowThreadProcessId(h, &pid); if (dwTheardId != 0) if (pid == dwProcessID && GetParent(h) == NULL && IsWindowVisible(h)) retHwnd = h; h = GetNextWindow(h, GW_HWNDNEXT); } return retHwnd; }
/* Get the default background color of the window */ static DWORD get_win_default_background_color(void) { DWORD pid = GetCurrentProcessId(); if(pid) { HWND hwnd = GetHwndByPid(pid); if(hwnd) return GetClassLongW(hwnd,GCLP_HBRBACKGROUND); } return 0xffffffff; }
static DWORD get_gif_background_color(GpBitmap *bitmap) { BYTE bgcolor_idx = 0; UINT i;
// for(i=0; i<bitmap->prop_count; i++) { // if(bitmap->prop_item[i].id == PropertyTagIndexBackground) { // bgcolor_idx = *(BYTE*)bitmap->prop_item[i].value; // break; // } // } // // for(i=0; i<bitmap->prop_count; i++) { // if(bitmap->prop_item[i].id == PropertyTagIndexTransparent) { // BYTE transparent_idx; // transparent_idx = *(BYTE*)bitmap->prop_item[i].value; // // if(transparent_idx == bgcolor_idx) // return 0; // } // } // // for(i=0; i<bitmap->prop_count; i++) { // if(bitmap->prop_item[i].id == PropertyTagGlobalPalette) { // if(bitmap->prop_item[i].length/3 > bgcolor_idx) { // BYTE *color = ((BYTE*)bitmap->prop_item[i].value)+bgcolor_idx*3; // return color[2] + (color[1]<<8) + (color[0]<<16) + (0xffu<<24); // } // break; // } // }
FIXME("can't get gif background color\n"); return get_win_default_background_color(); }
'''