fix bug reported in Issue #116

This commit is contained in:
Vincent Wei
2023-05-08 19:34:43 +08:00
parent 517d74a2d2
commit 70705c7db0
2 changed files with 12 additions and 15 deletions
+12 -2
View File
@@ -141,6 +141,14 @@ BOOL mg_InitDesktop (void)
#include "debug.h"
static IDLEHANDLER std_idle_handler;
static BOOL idle_handler_for_desktop_thread (MSGQUEUE *msg_queue, BOOL wait)
{
__mg_update_tick_count (NULL);
return std_idle_handler (msg_queue, wait);
}
void* __kernel_desktop_main (void* data)
{
MSG Msg;
@@ -152,8 +160,10 @@ void* __kernel_desktop_main (void* data)
return NULL;
}
/* for threads mode, the idle handler for desktop thread is NULL */
__mg_dsk_msg_queue->OnIdle = NULL;
/* For bug reported in Issue #116, under threads mode, the idle handler
for the desktop thread should call __mg_update_tick_count () */
std_idle_handler = __mg_dsk_msg_queue->OnIdle;
__mg_dsk_msg_queue->OnIdle = idle_handler_for_desktop_thread;
/* init desktop window */
init_desktop_win ();
-13
View File
@@ -391,14 +391,6 @@ static BOOL InstallSEGVHandler (void)
#include <locale.h>
#endif
static IDLEHANDLER std_idle_handler;
static BOOL idle_handler_for_main_thread (MSGQUEUE *msg_queue, BOOL wait)
{
__mg_update_tick_count (NULL);
return std_idle_handler (msg_queue, wait);
}
int GUIAPI InitGUI (int args, const char *agr[])
{
char engine [LEN_ENGINE_NAME + 1];
@@ -583,11 +575,6 @@ int GUIAPI InitGUI (int args, const char *agr[])
goto failure;
}
/* for threads mode, the idle handler for the main threads should
call __mg_update_tick_count () */
std_idle_handler = msg_queue->OnIdle;
msg_queue->OnIdle = idle_handler_for_main_thread;
/* init timer for tick counter */
step++;
if (!mg_InitTimer (FALSE)) {