mark a window as TODEL after calling ThrowAwayMessages; tune name of some internal inline functions

This commit is contained in:
Vincent Wei
2020-03-05 13:04:31 +08:00
parent 5812c11f7c
commit 283c4e4bc4
7 changed files with 114 additions and 62 deletions
+14 -3
View File
@@ -226,7 +226,7 @@ struct _MSGQUEUE
// moved from window structures since 5.0.0.
pthread_mutex_t lock; // lock
sem_t wait; // the semaphore for wait message
sem_t sync_msg; // the semaphore for sync message
//sem_t sync_msg; // the semaphore for sync message; deprecated
#endif
DWORD dwState; // message queue states
@@ -692,14 +692,14 @@ extern pthread_mutex_t __mg_gdilock, __mg_mouselock;
if (!(condition)) return
/* check whether hWnd is a main window and return the pointer to it. */
static inline PMAINWIN checkAndGetMainWindowPtrOfMainWin (HWND hWnd)
static inline PMAINWIN checkAndGetMainWinIfMainWin (HWND hWnd)
{
MG_CHECK_RET (MG_IS_NORMAL_MAIN_WINDOW (hWnd), NULL);
return MG_GET_WINDOW_PTR (hWnd);
}
/* return main window contains a control. */
static inline PMAINWIN checkAndGetMainWindowPtrOfControl (HWND hWnd)
static inline PMAINWIN checkAndGetMainWinIfWindow (HWND hWnd)
{
PMAINWIN pWin;
@@ -709,6 +709,17 @@ static inline PMAINWIN checkAndGetMainWindowPtrOfControl (HWND hWnd)
return pWin->pMainWin;
}
/* return main window contains a control. */
static inline PMAINWIN checkAndGetMainWindowIfControl (HWND hWnd)
{
PMAINWIN pWin;
MG_CHECK_RET (MG_IS_CONTROL_WINDOW(hWnd), NULL);
pWin = MG_GET_WINDOW_PTR (hWnd);
return pWin->pMainWin;
}
/* get main window pointer of a window, including desktop window */
static inline PMAINWIN getMainWindowPtr (HWND hWnd)
{