From f59fe557f3c93cc5e7a3e40de70d4dee44a2bb31 Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Tue, 25 Feb 2020 19:07:45 +0800 Subject: [PATCH] cleanup --- cleanup-code.sh | 2 ++ src/client/client.c | 10 +++++++--- src/kernel/desktop-procs.c | 12 ++++++------ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/cleanup-code.sh b/cleanup-code.sh index d4cf0be6..a04581bd 100755 --- a/cleanup-code.sh +++ b/cleanup-code.sh @@ -147,4 +147,6 @@ tab2space() { # sed -i 's/\/GetHostedById/g' `grep '\' -rl include/ src/` +sed -i 's/\<__mg_os_start_time_ms\>/__mg_os_start_time/g' `grep '\<__mg_os_start_time_ms\>' -rl include/ src/` + exit 0 diff --git a/src/client/client.c b/src/client/client.c index cefb05dc..0e88a82b 100644 --- a/src/client/client.c +++ b/src/client/client.c @@ -152,6 +152,8 @@ int GUIAPI GetSockFD2Server (void) return conn_fd; } +#include "debug.h" + static void process_socket_message (MSG *msg) { if (msg->message == MSG_UPDATECLIWIN && @@ -161,8 +163,9 @@ static void process_socket_message (MSG *msg) LOSWORD(msg->lParam), HISWORD(msg->lParam)); } else { - if (msg->hwnd == 0) { + if (msg->hwnd == HWND_NULL) { msg->hwnd = HWND_DESKTOP; + //dump_message (msg, __func__); QueueDeskMessage (msg); } else if (__mg_client_check_hwnd (msg->hwnd, __mg_client_id)) { @@ -468,8 +471,9 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait) msg.lParam = MAKELONG(mouse_x, mouse_y); kernel_QueueMessage (msg_queue, &msg); n++; - } + //dump_message (&msg, __func__); + } } /* Since 5.0.0: always check timer */ @@ -499,7 +503,7 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait) else { /* process event from server */ if (OnTrylockClientReq && OnUnlockClientReq) OnUnlockClientReq(); - process_socket_message(&Msg); + process_socket_message (&Msg); } } diff --git a/src/kernel/desktop-procs.c b/src/kernel/desktop-procs.c index feb03288..9b20c79d 100644 --- a/src/kernel/desktop-procs.c +++ b/src/kernel/desktop-procs.c @@ -3462,7 +3462,7 @@ static int srvPreMouseMessageHandler (UINT message, WPARAM flags, int x, int y) if (Msg.message == MSG_MOUSEMOVE) { LOCK_MOUSEMOVE_SEM(); SHAREDRES_MOUSEMOVECLIENT = target_client; - ++ SHAREDRES_MOUSEMOVESERIAL; + SHAREDRES_MOUSEMOVESERIAL++; UNLOCK_MOUSEMOVE_SEM(); } else { @@ -4540,8 +4540,11 @@ static LRESULT DesktopWinProc (HWND hWnd, UINT message, dskMouseMessageHandler (message, flags, x, y); } #ifdef _MGHAVE_MENU - else if (sg_ptmi) - PopupMenuTrackProc (sg_ptmi, message, x, y); + else if (sg_ptmi) { + if (PopupMenuTrackProc (sg_ptmi, message, x, y) == 0) + return 0; + dskMouseMessageHandler (message, flags, x, y); + } #endif else dskMouseMessageHandler (message, flags, x, y); @@ -4707,9 +4710,6 @@ static LRESULT DesktopWinProc (HWND hWnd, UINT message, } #endif /* deprecated code */ - _WRN_PRINTF ("got MSG_TIMER message for desktop (%lu)\n", - __mg_tick_counter); - dskOnTimer (); break; }