Bug fix for GUI initialization with a specified game on the command line. Sometimes the X-server needs a little more time to initialize the window. Added a short 0.1 sec usleep at startup to give X the time it needs. A few more cppcheck warning fixes made as well.

This commit is contained in:
Matthew Budd 2020-05-23 15:08:03 -04:00
parent 04a4b6de74
commit 6947f2bd05
4 changed files with 7 additions and 8 deletions

View File

@ -116,9 +116,6 @@ struct memViewWin_t
int selRomAddr;
int jumpAddr;
int jumpDelay;
int row_vis_start;
int row_vis_end;
int row_vis_center;
int dialog_op;
int mode;
int evntSrcID;
@ -145,9 +142,6 @@ struct memViewWin_t
addr_entry = NULL;
selCellLabel = NULL;
ivbar = NULL;
row_vis_start = 0;
row_vis_end = 64;
row_vis_center= 32;
selAddr = 0;
selRomAddr = -1;
jumpAddr = -1;

View File

@ -216,7 +216,7 @@ int FCEUD_GetDataFromServer(uint8 *data)
}
}
if(SDLNet_SocketReady(UDPSocket)
if(SDLNet_SocketReady(UDPSocket))
{

View File

@ -445,12 +445,12 @@ InitVideo(FCEUGI *gi)
// }
//#endif
}
s_curbpp = s_screen->format->BitsPerPixel;
if(!s_screen) {
FCEUD_PrintError(SDL_GetError());
KillVideo();
return -1;
}
s_curbpp = s_screen->format->BitsPerPixel;
#if 0
// XXX soules - this would be creating a surface on the video

View File

@ -861,6 +861,11 @@ int main(int argc, char *argv[])
InitGTKSubsystem(argc, argv);
while(gtk_events_pending())
gtk_main_iteration_do(FALSE);
// Ensure that the GUI has fully initialized.
// Give the X-server a small amount of time to init.
usleep(100000);
while(gtk_events_pending())
gtk_main_iteration_do(FALSE);
}
#endif