move call of mg_AllocMsgQueueForThisThread for desktop message queue to init-lite.c

This commit is contained in:
Vincent Wei
2020-02-20 12:40:57 +08:00
parent c0abd545f6
commit a49cdd6ddc
2 changed files with 18 additions and 4 deletions
+2
View File
@@ -102,11 +102,13 @@ BOOL mg_InitDesktop (void)
int ret;
RECT rcScr = GetScreenRect();
#if 0 /* move to init-lite.c */
/* Since 5.0.0: allocate message queue for desktop thread */
if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread ()) ) {
_WRN_PRINTF ("failed to allocate message queue\n");
return FALSE;
}
#endif /* moved code */
/*
* Init ZOrderInfo here.
+16 -4
View File
@@ -377,6 +377,14 @@ int InitGUI (int argc, const char* agr[])
step++;
#endif
/* Since 5.0.0
allocate message queue for desktop thread before starting client. */
if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread ()) ) {
err_message (step, "Failed to allocate message queue!");
return step;
}
step++;
#ifdef _MGRM_PROCESSES
if (!_is_server) {
if (!client_ClientStartup ()) {
@@ -467,11 +475,14 @@ int InitGUI (int argc, const char* agr[])
*/
strncpy (SHAREDRES_VIDEO_ENGINE, engine, LEN_ENGINE_NAME);
strncpy (SHAREDRES_VIDEO_MODE, mode, LEN_VIDEO_MODE);
if (GetMgEtcValue (engine, "device", SHAREDRES_VIDEO_DEVICE, LEN_DEVICE_NAME) < 0)
if (GetMgEtcValue (engine, "device",
SHAREDRES_VIDEO_DEVICE, LEN_DEVICE_NAME) < 0)
*SHAREDRES_VIDEO_DEVICE = 0;
if (GetMgEtcValue (engine, "pixelformat", SHAREDRES_VIDEO_FOURCC, LEN_FOURCC_FORMAT) < 0)
if (GetMgEtcValue (engine, "pixelformat",
SHAREDRES_VIDEO_FOURCC, LEN_FOURCC_FORMAT) < 0)
*SHAREDRES_VIDEO_FOURCC = 0;
if (GetMgEtcValue (engine, "exdriver", SHAREDRES_VIDEO_EXDRIVER, LEN_EXDRIVER_NAME) < 0)
if (GetMgEtcValue (engine, "exdriver",
SHAREDRES_VIDEO_EXDRIVER, LEN_EXDRIVER_NAME) < 0)
*SHAREDRES_VIDEO_EXDRIVER = 0;
SHAREDRES_VIDEO_DPI = __gal_screen->dpi;
@@ -485,7 +496,8 @@ int InitGUI (int argc, const char* agr[])
}
else {
_DBG_PRINTF("Engien info from shared resource: %s %s %d\n",
SHAREDRES_VIDEO_ENGINE, SHAREDRES_VIDEO_MODE, SHAREDRES_VIDEO_DPI);
SHAREDRES_VIDEO_ENGINE,
SHAREDRES_VIDEO_MODE, SHAREDRES_VIDEO_DPI);
}
step++;