From: Toni Wilen Date: Sat, 15 Apr 2023 18:07:34 +0000 (+0300) Subject: Fix invisible initial ROM scan window X-Git-Tag: 5.0.0~78 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=b459f80ffb86938a5f21887c82d685a4787b0037;p=francis%2Fwinuae.git Fix invisible initial ROM scan window --- diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index ce7d7dd6..79ad3eea 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -5116,7 +5116,7 @@ static void romlist_add2 (const TCHAR *path, struct romdata *rd) } extern int scan_roms (HWND, int); -void read_rom_list (void) +void read_rom_list(bool initial) { TCHAR tmp2[1000]; int idx, idx2; @@ -5130,6 +5130,9 @@ void read_rom_list (void) if (fkey == NULL) return; if (!exists || forceroms) { + if (initial) { + scaleresource_init(NULL, 0); + } load_keyring (NULL, NULL); scan_roms (NULL, forceroms ? 0 : 1); } @@ -5750,7 +5753,7 @@ static void WIN32_HandleRegistryStuff (void) regclosetree (read_disk_history (HISTORY_FLOPPY)); regclosetree (read_disk_history (HISTORY_CD)); associate_init_extensions (); - read_rom_list (); + read_rom_list(true); load_keyring (NULL, NULL); target_load_debugger_config(); } diff --git a/od-win32/win32.h b/od-win32/win32.h index 7cebecce..e2259957 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -149,7 +149,7 @@ void exit_gui (int); void fetch_path (const TCHAR *name, TCHAR *out, int size); void set_path (const TCHAR *name, TCHAR *path); void set_path (const TCHAR *name, TCHAR *path, pathtype); -void read_rom_list (void); +void read_rom_list(bool); void associate_file_extensions (void); #define WIN32_PLUGINDIR _T("plugins\\") diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index b75a68f2..87d419f4 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -1759,22 +1759,6 @@ static INT_PTR CALLBACK InfoBoxDialogProc (HWND hDlg, UINT msg, WPARAM wParam, L DestroyWindow (hDlg); infoboxdialogstate = false; return TRUE; - case WM_INITDIALOG: - { - HWND owner = GetParent (hDlg); - if (!owner) { - owner = GetDesktopWindow (); - RECT ownerrc, merc; - GetWindowRect (owner, &ownerrc); - GetWindowRect (hDlg, &merc); - SetWindowPos (hDlg, NULL, - ownerrc.left + ((ownerrc.right - ownerrc.left) - (merc.right - merc.left)) /2, - ownerrc.top + ((ownerrc.bottom - ownerrc.top) - (merc.bottom - merc.top)) / 2, - 0, 0, - SWP_NOSIZE); - } - return TRUE; - } case WM_COMMAND: switch (LOWORD (wParam)) { @@ -2116,7 +2100,7 @@ end: DispatchMessage (&msg); } } - read_rom_list (); + read_rom_list(false); if (show) show_rom_list (); @@ -22986,7 +22970,7 @@ int gui_init (void) { int ret; - read_rom_list(); + read_rom_list(false); prefs_to_gui(&changed_prefs); inputdevice_updateconfig(NULL, &workprefs); for (;;) { diff --git a/od-win32/win32gui_extra.cpp b/od-win32/win32gui_extra.cpp index da4063cc..122df259 100644 --- a/od-win32/win32gui_extra.cpp +++ b/od-win32/win32gui_extra.cpp @@ -611,7 +611,7 @@ static HWND DIALOG_CreateIndirect(HINSTANCE hInst, LPCVOID dlgTemplate, size.cx = rect.right - rect.left; size.cy = rect.bottom - rect.top; - if (!res->parent) { + if (!res->parent && res->width > 0 && res->height > 0) { size.cx = res->width; size.cy = res->height; } @@ -1203,8 +1203,10 @@ void scaleresource_init(const TCHAR *prefix, int fullscreen) setdeffont(); - regqueryfont (NULL, fontprefix, fontreg[0], fontname_gui, &fontsize_gui, &fontstyle_gui, &fontweight_gui); - regqueryfont (NULL, fontprefix, fontreg[1], fontname_list, &fontsize_list, &fontstyle_list, &fontweight_list); + if (fontprefix) { + regqueryfont (NULL, fontprefix, fontreg[0], fontname_gui, &fontsize_gui, &fontstyle_gui, &fontweight_gui); + regqueryfont (NULL, fontprefix, fontreg[1], fontname_list, &fontsize_list, &fontstyle_list, &fontweight_list); + } //write_log (_T("GUI font %s:%d:%d:%d\n"), fontname_gui, fontsize_gui, fontstyle_gui, fontweight_gui); //write_log (_T("List font %s:%d:%d:%d\n"), fontname_list, fontsize_list, fontstyle_list, fontweight_list);