diff --git a/include/minigui.h b/include/minigui.h index c0f4cd86..ba63e141 100644 --- a/include/minigui.h +++ b/include/minigui.h @@ -896,61 +896,124 @@ MG_EXPORT BOOL GUIAPI ServerDeleteLayer (MG_Layer* layer); MG_EXPORT int GUIAPI ServerGetNextZNode (MG_Layer* layer, int idx_znode, int* cli); -#define ZNIT_DESKTOP 0x50000000 +#define ZOF_STATUS_MASK 0x0000000F +#define ZOF_VISIBLE 0x00000001 +#define ZOF_DISABLED 0x00000002 +#define ZOF_MAXIMIZED 0x00000004 /* Since 4.2.0 */ +#define ZOF_MINIMIZED 0x00000008 /* Since 4.2.0 */ -#define ZNIT_GLOBAL_MAINWIN 0x31000000 -#define ZNIT_GLOBAL_TOOLWIN 0x32000000 -#define ZNIT_GLOBAL_CONTROL 0x30000000 +/* Since 4.2.0 */ +#define ZOF_COMPOSITING_MASK 0x000000F0 +#define ZOF_COMPOS_OPAQUE 0x00000000 +#define ZOF_COMPOS_COLORKEY 0x00000010 +#define ZOF_COMPOS_ALPHACHANNEL 0x00000020 +#define ZOF_COMPOS_ALPHAPIXEL 0x00000030 +#define ZOF_COMPOS_BLURRED 0x00000040 -#define ZNIT_TOPMOST_MAINWIN 0x21000000 -#define ZNIT_TOPMOST_TOOLWIN 0x22000000 -#define ZNIT_TOPMOST_CONTROL 0x20000000 +/* Since 4.2.0; The alpha channel value or the radius of blur in pixels */ +#define ZOF_ALPHA_BLUR_MASK 0x0000FF00 -#define ZNIT_NORMAL_MAINWIN 0x11000000 -#define ZNIT_NORMAL_TOOLWIN 0x12000000 -#define ZNIT_NORMAL_CONTROL 0x10000000 +/* Since 4.2.0 */ +#define ZOF_INTERNAL_FLAGS_MASK 0X000F0000 +#define ZOF_IF_REFERENCE 0x00010000 +#define ZOF_IF_ALWAYSTOP 0x00020000 -#define ZNIT_NULL 0x00000000 +#define ZOF_TW_FLAG_MASK 0x00F00000 +#define ZOF_TW_TROUNDCNS 0x00100000 +#define ZOF_TW_BROUNDCNS 0x00200000 +#define ZOF_TW_TBROUNDCNS 0x00300000 -#define ZNIF_VISIBLE 0x00000002 -#define ZNIF_DISABLED 0x00000004 +#define ZOF_TYPE_FLAG_MASK 0xFF000000 + +#define ZOF_TYPE_MASK 0xF0000000 +#define ZOF_TYPE_NULL 0x00000000 +#define ZOF_TYPE_POPUPMENU 0x10000000 +#define ZOF_TYPE_SCREENLOCK 0x20000000 /* Since 4.2.0; fixed and only one */ +#define ZOF_TYPE_DOCKER 0x30000000 /* Since 4.2.0; fixed and only one */ +#define ZOF_TYPE_GLOBAL 0x40000000 +#define ZOF_TYPE_TOPMOST 0x50000000 +#define ZOF_TYPE_NORMAL 0x60000000 +#define ZOF_TYPE_LAUNCHER 0x70000000 /* Since 4.2.0; fixed and only one */ +#define ZOF_TYPE_DESKTOP 0x80000000 /* fixed and only one */ + +#define ZOF_TF_FLAG_MASK 0x0F000000 +#define ZOF_TF_CONTROL 0x00000000 +#define ZOF_TF_MAINWIN 0x01000000 +#define ZOF_TF_TOOLWIN 0x02000000 + +#define ZNIT_NULL (ZOF_TYPE_NULL) +#define ZNIT_POPUPMENU (ZOF_TYPE_POPUPMENU) +#define ZNIT_SCREENLOCK (ZOF_TYPE_SCREENLOCK) +#define ZNIT_DESKTOP (ZOF_TYPE_DESKTOP) +#define ZNIT_LAUNCHER (ZOF_TYPE_LAUNCHER) +#define ZNIT_DESKTOP (ZOF_TYPE_DESKTOP) + +#define ZNIT_GLOBAL_MAINWIN (ZOF_TYPE_GLOBAL | ZOF_TF_MAINWIN) +#define ZNIT_GLOBAL_TOOLWIN (ZOF_TYPE_GLOBAL | ZOF_TF_TOOLWIN) +#define ZNIT_GLOBAL_CONTROL (ZOF_TYPE_GLOBAL | ZOF_TF_CONTROL) + +#define ZNIT_TOPMOST_MAINWIN (ZOF_TYPE_TOPMOST | ZOF_TF_MAINWIN) +#define ZNIT_TOPMOST_TOOLWIN (ZOF_TYPE_TOPMOST | ZOF_TF_TOOLWIN) +#define ZNIT_TOPMOST_CONTROL (ZOF_TYPE_TOPMOST | ZOF_TF_CONTROL) + +#define ZNIT_NORMAL_MAINWIN (ZOF_TYPE_NORMAL | ZOF_TF_MAINWIN) +#define ZNIT_NORMAL_TOOLWIN (ZOF_TYPE_NORMAL | ZOF_TF_TOOLWIN) +#define ZNIT_NORMAL_CONTROL (ZOF_TYPE_NORMAL | ZOF_TF_CONTROL) + +#define ZNIF_VISIBLE (ZOF_VISIBLE) +#define ZNIF_DISABLED (ZOF_DISABLED) +#define ZNIF_MAXIMIZED (ZOF_MAXIMIZED) /* Since 4.2.0 */ +#define ZNIF_MINIMIZED (ZOF_MINIMIZED) /* Since 4.2.0 */ /** Z-node information structure */ -typedef struct _ZNODEINFO -{ +typedef struct _ZNODEINFO { /** * The type of the znode, can be one of the following values: - * - ZNIT_GLOBAL_MAINWIN\n - * a global main window. - * - ZNIT_GLOBAL_TOOLWIN\n - * a global tool window. - * - ZNIT_GLOBAL_CONTROL\n - * a global control with WS_EX_CTRLASMAINWIN style. - * - ZNIT_TOPMOST_MAINWIN\n - * a topmost main window. - * - ZNIT_TOPMOST_TOOLWIN\n - * a topmost tool window. - * - ZNIT_TOPMOST_CONTROL\n - * a topmost control with WS_EX_CTRLASMAINWIN style. - * - ZNIT_NORMAL_MAINWIN\n - * a normal main window. - * - ZNIT_NORMAL_TOOLWIN\n - * a normal tool window. - * - ZNIT_NORMAL_CONTROL\n - * a normal control with WS_EX_CTRLASMAINWIN style. - * - ZNIT_DESKTOP\n - * the desktop. - * - ZNIT_NULL\n - * a null and not-used z-node which does not refer to any window. + * - ZNIT_POPUPMENU\n + * a popup menu. + * - ZNIT_SCREENLOCK\n + * the screen lock. + * - ZNIT_DOCKER\n + * the docker. + * - ZNIT_LAUNCHER\n + * the launcher. + * - ZNIT_DESKTOP\n + * the desktop. + * - ZNIT_GLOBAL_MAINWIN\n + * a global main window. + * - ZNIT_GLOBAL_TOOLWIN\n + * a global tool window. + * - ZNIT_GLOBAL_CONTROL\n + * a global control with WS_EX_CTRLASMAINWIN style. + * - ZNIT_TOPMOST_MAINWIN\n + * a topmost main window. + * - ZNIT_TOPMOST_TOOLWIN\n + * a topmost tool window. + * - ZNIT_TOPMOST_CONTROL\n + * a topmost control with WS_EX_CTRLASMAINWIN style. + * - ZNIT_NORMAL_MAINWIN\n + * a normal main window. + * - ZNIT_NORMAL_TOOLWIN\n + * a normal tool window. + * - ZNIT_NORMAL_CONTROL\n + * a normal control with WS_EX_CTRLASMAINWIN style. + * - ZNIT_DESKTOP\n + * the desktop. + * - ZNIT_NULL\n + * a null and not-used z-node which does not refer to any window/popupmenu. */ DWORD type; /** * The flags of the znode, can be OR'd with the following values: - * - ZNIF_VISIBLE\n - * a visible window. - * - ZNIF_DISABLED\n - * a disabled window. + * - ZNIF_VISIBLE\n + * a visible window. + * - ZNIF_DISABLED\n + * a disabled window. + * - ZNIF_MAXIMIZED\n + * a maximized window. + * - ZNIF_MINIMIZED\n + * a minimized window. * Note that the flags are only applied to window. */ DWORD flags; diff --git a/src/include/zorder.h b/src/include/zorder.h index d82b601c..344011e5 100644 --- a/src/include/zorder.h +++ b/src/include/zorder.h @@ -67,44 +67,6 @@ typedef struct _MASKRECT { } MASKRECT; typedef MASKRECT* PMASKRECT; -#define ZOF_FLAG_MASK 0x0000000F -#define ZOF_REFERENCE 0x00000001 -#define ZOF_VISIBLE 0x00000002 -#define ZOF_DISABLED 0x00000004 - -/* Since 4.2.0 */ -#define ZOF_COMPOSITING_MASK 0x000000F0 -#define ZOF_COMPOS_OPAQUE 0x00000000 -#define ZOF_COMPOS_COLORKEY 0x00000010 -#define ZOF_COMPOS_ALPHACHANNEL 0x00000020 -#define ZOF_COMPOS_ALPHAPIXEL 0x00000030 -#define ZOF_COMPOS_BLURRED 0x00000040 - -/* Since 4.2.0; The alpha channel value or the radius of blur in pixels */ -#define ZOF_ALPHA_BLUR_MASK 0x0000FF00 - -#define ZOF_TYPE_FLAG_MASK 0xFFF00000 - -#define ZOF_TYPE_MASK 0xF0000000 -#define ZOF_TYPE_MENU 0x10000000 -#define ZOF_TYPE_SCREENLOCK 0x20000000 /* Since 4.2.0; fixed and only one */ -#define ZOF_TYPE_DOCKER 0x30000000 /* Since 4.2.0; fixed and only one */ -#define ZOF_TYPE_GLOBAL 0x40000000 -#define ZOF_TYPE_TOPMOST 0x50000000 -#define ZOF_TYPE_NORMAL 0x60000000 -#define ZOF_TYPE_LAUNCHER 0x70000000 /* Since 4.2.0; fixed and only one */ -#define ZOF_TYPE_DESKTOP 0x80000000 /* fixed and only one */ - -#define ZOF_TF_FLAG_MASK 0x0F000000 -#define ZOF_TF_MAINWIN 0x01000000 -#define ZOF_TF_TOOLWIN 0x02000000 -#define ZOF_TF_ALWAYSTOP 0x04000000 - -#define ZOF_TW_FLAG_MASK 0x00F00000 -#define ZOF_TW_TBROUNDCNS 0x00300000 -#define ZOF_TW_BROUNDCNS 0x00200000 -#define ZOF_TW_TROUNDCNS 0x00100000 - typedef struct _ZORDERNODE { DWORD flags; @@ -115,7 +77,7 @@ typedef struct _ZORDERNODE { unsigned int age; int cli; /* which client? */ - HWND fortestinghwnd; /* which window of the client? */ + HWND hwnd; /* which window of the client? */ HWND main_win; /* handle to the main window */ #ifdef _MGSCHEMA_COMPOSITING HDC mem_dc; /* The memory DC for this znode. */ diff --git a/src/kernel/desktop-comm.c b/src/kernel/desktop-comm.c index caad5c9e..c296c531 100644 --- a/src/kernel/desktop-comm.c +++ b/src/kernel/desktop-comm.c @@ -129,7 +129,7 @@ static PMAINWIN dskGetActiveWindow (void) nodes = GET_ZORDERNODE(__mg_zorder_info); - return (PMAINWIN)nodes[__mg_zorder_info->active_win].fortestinghwnd; + return (PMAINWIN)nodes[__mg_zorder_info->active_win].hwnd; } static PMAINWIN dskSetActiveWindow (PMAINWIN pWin) @@ -286,7 +286,7 @@ static void dskHideGlobalControl (PMAINWIN pWin, int reason, LPARAM lParam) && (nodes [first].flags & ZOF_VISIBLE)) { RECT rc = nodes [first].rc; - PMAINWIN pCurTop = (PMAINWIN) nodes [first].fortestinghwnd; + PMAINWIN pCurTop = (PMAINWIN) nodes [first].hwnd; pCurTop->dwStyle &= ~WS_VISIBLE; dskHideWindow (0, pCurTop->idx_znode); @@ -752,7 +752,7 @@ PMAINWIN gui_GetMainWindowPtrUnderPoint (int x, int y) if (slot == 0) return NULL; else - return (PMAINWIN)(nodes[slot].fortestinghwnd); + return (PMAINWIN)(nodes[slot].hwnd); } static int HandleSpecialKey (int scancode) @@ -1165,7 +1165,7 @@ static void lock_zorder_info (void) slot = __mg_zorder_info->first_topmost; for (; slot > 0; slot = nodes[slot].next) { - pWin = (PMAINWIN)(nodes[slot].fortestinghwnd); + pWin = (PMAINWIN)(nodes[slot].hwnd); if (pWin) pthread_mutex_lock (&pWin->pGCRInfo->lock); } @@ -1173,7 +1173,7 @@ static void lock_zorder_info (void) slot = __mg_zorder_info->first_normal; for (; slot > 0; slot = nodes[slot].next) { - pWin = (PMAINWIN)(nodes[slot].fortestinghwnd); + pWin = (PMAINWIN)(nodes[slot].hwnd); if (pWin) pthread_mutex_lock (&pWin->pGCRInfo->lock); } @@ -1188,7 +1188,7 @@ static void unlock_zorder_info (void) slot = __mg_zorder_info->first_topmost; for (; slot > 0; slot = nodes[slot].next) { - pWin = (PMAINWIN)(nodes[slot].fortestinghwnd); + pWin = (PMAINWIN)(nodes[slot].hwnd); if (pWin) pthread_mutex_unlock (&pWin->pGCRInfo->lock); } @@ -1196,7 +1196,7 @@ static void unlock_zorder_info (void) slot = __mg_zorder_info->first_normal; for (; slot > 0; slot = nodes[slot].next) { - pWin = (PMAINWIN)(nodes[slot].fortestinghwnd); + pWin = (PMAINWIN)(nodes[slot].hwnd); if (pWin) pthread_mutex_unlock (&pWin->pGCRInfo->lock); } @@ -1501,7 +1501,7 @@ static LRESULT WindowMessageHandler(UINT message, PMAINWIN pWin, LPARAM lParam) } } - hWnd = nodes[slot].fortestinghwnd; + hWnd = nodes[slot].hwnd; if (0 || !hWnd || !(pWin = gui_CheckAndGetMainWindowPtr (hWnd)) @@ -1634,9 +1634,9 @@ static void dskUpdateDesktopMenu (HMENU hDesktopMenu) slot = __mg_zorder_info->first_topmost; for (; slot > 0; slot = nodes[slot].next) { - pWin = (PMAINWIN)(nodes[slot].fortestinghwnd); + pWin = (PMAINWIN)(nodes[slot].hwnd); if (pWin && pWin->WinType == TYPE_MAINWIN && - !(nodes[slot].flags & ZOF_TF_ALWAYSTOP)) { + !(nodes[slot].flags & ZOF_IF_ALWAYSTOP)) { if (pWin->dwStyle & WS_VISIBLE) mii.state = MFS_ENABLED; else @@ -1667,7 +1667,7 @@ static void dskUpdateDesktopMenu (HMENU hDesktopMenu) slot = __mg_zorder_info->first_normal; for (; slot > 0; slot = nodes[slot].next) { - pWin = (PMAINWIN)(nodes[slot].fortestinghwnd); + pWin = (PMAINWIN)(nodes[slot].hwnd); if (pWin && pWin->WinType == TYPE_MAINWIN) { if (pWin->dwStyle & WS_VISIBLE) mii.state = MFS_ENABLED; @@ -1708,7 +1708,7 @@ static int dskDesktopCommand (HMENU hDesktopMenu, int id) slot = __mg_zorder_info->first_topmost; for (; slot > 0; slot = nodes[slot].next) { - pWin = (PMAINWIN)(nodes[slot].fortestinghwnd); + pWin = (PMAINWIN)(nodes[slot].hwnd); if (pWin && (pWin->WinType != TYPE_CONTROL) #ifndef _MGRM_THREADS && (pWin->pHosting == __mg_dsk_win) @@ -1722,7 +1722,7 @@ static int dskDesktopCommand (HMENU hDesktopMenu, int id) slot = __mg_zorder_info->first_normal; for (; slot > 0; slot = nodes[slot].next) { - pWin = (PMAINWIN)(nodes[slot].fortestinghwnd); + pWin = (PMAINWIN)(nodes[slot].hwnd); if (pWin && (pWin->WinType == TYPE_MAINWIN) #ifndef _MGRM_THREADS && (pWin->pHosting == __mg_dsk_win) @@ -1867,7 +1867,7 @@ static BOOL _cb_refresh_znode (void* context, REFRESH_INFO* info = (REFRESH_INFO*) context; - pTemp = (PMAINWIN)node->fortestinghwnd; + pTemp = (PMAINWIN)node->hwnd; if (pTemp && ((pTemp->WinType == TYPE_CONTROL && (pTemp->dwExStyle & WS_EX_CTRLASMAINWIN)) @@ -2299,7 +2299,7 @@ static LRESULT DesktopWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lP /* XXX: wake up other theads */ for (slot=__mg_zorder_info->first_topmost; slot > 0; slot = nodes[slot].next) { - pWin = (PMAINWIN)(nodes[slot].fortestinghwnd); + pWin = (PMAINWIN)(nodes[slot].hwnd); if (pWin && (pWin->WinType != TYPE_CONTROL) && (pWin->pHosting == NULL)) { if ((pMsgQueue = kernel_GetMsgQueue((HWND)pWin))) { POST_MSGQ(pMsgQueue); @@ -2307,7 +2307,7 @@ static LRESULT DesktopWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lP } } for (slot = __mg_zorder_info->first_normal; slot > 0; slot = nodes[slot].next) { - pWin = (PMAINWIN)(nodes[slot].fortestinghwnd); + pWin = (PMAINWIN)(nodes[slot].hwnd); if (pWin && (pWin->WinType == TYPE_MAINWIN) && (pWin->pHosting == NULL)){ if ((pMsgQueue = kernel_GetMsgQueue((HWND)pWin))) { POST_MSGQ(pMsgQueue); diff --git a/src/kernel/desktop-procs.c b/src/kernel/desktop-procs.c index 0c9110c9..e07400bf 100644 --- a/src/kernel/desktop-procs.c +++ b/src/kernel/desktop-procs.c @@ -795,8 +795,8 @@ static BOOL _cb_update_cli_znode (void* context, RECT rcScr = GetScreenRect (); int cli = (int)(intptr_t)context; - if (znode->cli == cli && znode->flags & ZOF_VISIBLE && znode->fortestinghwnd) { - MSG msg = {znode->fortestinghwnd, MSG_UPDATECLIWIN, 0, 0, __mg_timer_counter}; + if (znode->cli == cli && znode->flags & ZOF_VISIBLE && znode->hwnd) { + MSG msg = {znode->hwnd, MSG_UPDATECLIWIN, 0, 0, __mg_timer_counter}; if (!IsRectEmpty(&(znode->dirty_rc))) { @@ -940,7 +940,7 @@ static int srvStartDragWindow (int cli, int idx_znode, _dd_info.cli = cli; _dd_info.idx_znode = idx_znode; - _dd_info.hwnd = nodes [idx_znode].fortestinghwnd; + _dd_info.hwnd = nodes [idx_znode].hwnd; _dd_info.zi = zi; _dd_info.rc = nodes [idx_znode].rc; @@ -1257,7 +1257,7 @@ static BOOL _cb_intersect_rc_no_cli (void* context, //SubtractClipRect (&sg_UpdateRgn, &node->rc)) { subtract_rgn_by_node(&sg_UpdateRgn, zi, node)) { node->age ++; - node->flags |= ZOF_REFERENCE; + node->flags |= ZOF_IF_REFERENCE; return TRUE; } @@ -1273,7 +1273,7 @@ static BOOL _cb_update_rc_nocli (void* context, //SubtractClipRect (&sg_UpdateRgn, &node->rc)) { subtract_rgn_by_node(&sg_UpdateRgn, zi, node)) { node->age ++; - node->flags |= ZOF_REFERENCE; + node->flags |= ZOF_IF_REFERENCE; return TRUE; } @@ -1310,7 +1310,7 @@ int __mg_remove_all_znodes_of_client (int cli) if (SubtractClipRect (&sg_UpdateRgn, &rcScr)) { nodes [0].age ++; - nodes [0].flags |= ZOF_REFERENCE; + nodes [0].flags |= ZOF_IF_REFERENCE; } zi->cli_trackmenu = -1; @@ -1339,17 +1339,17 @@ int __mg_remove_all_znodes_of_client (int cli) subtract_rgn_by_node(&sg_UpdateRgn, zi, &nodes [slot2])) { nodes [slot2].age ++; - nodes [slot2].flags |= ZOF_REFERENCE; + nodes [slot2].flags |= ZOF_IF_REFERENCE; } } do_for_all_znodes (nodes + slot, zi, _cb_intersect_rc_no_cli, ZT_NORMAL); - if (!(nodes [0].flags & ZOF_REFERENCE) && + if (!(nodes [0].flags & ZOF_IF_REFERENCE) && SubtractClipRect (&sg_UpdateRgn, &rcScr)) { nodes [0].age ++; - nodes [0].flags |= ZOF_REFERENCE; + nodes [0].flags |= ZOF_IF_REFERENCE; } } @@ -1379,13 +1379,13 @@ int __mg_remove_all_znodes_of_client (int cli) subtract_rgn_by_node(&sg_UpdateRgn, zi, &nodes [slot2])) { nodes [slot2].age ++; - nodes [slot2].flags |= ZOF_REFERENCE; + nodes [slot2].flags |= ZOF_IF_REFERENCE; } } - if (!(nodes [0].flags & ZOF_REFERENCE) && + if (!(nodes [0].flags & ZOF_IF_REFERENCE) && SubtractClipRect (&sg_UpdateRgn, &rcScr)) { nodes [0].age ++; - nodes [0].flags |= ZOF_REFERENCE; + nodes [0].flags |= ZOF_IF_REFERENCE; } } @@ -1409,10 +1409,10 @@ int __mg_remove_all_znodes_of_client (int cli) /* update all znode if it's dirty */ do_for_all_znodes (&rc_bound, zi, _cb_update_znode, ZT_ALL); - if (nodes [0].flags & ZOF_REFERENCE) { + if (nodes [0].flags & ZOF_IF_REFERENCE) { SendMessage (HWND_DESKTOP, MSG_ERASEDESKTOP, 0, (WPARAM)&rc_bound); - nodes [0].flags &= ~ZOF_REFERENCE; + nodes [0].flags &= ~ZOF_IF_REFERENCE; } /* if active_win belongs to the client, change it */ @@ -1481,7 +1481,7 @@ static HWND dskGetActiveWindow (int* cli) if (__mg_zorder_info->active_win) { active_cli = nodes [__mg_zorder_info->active_win].cli; if (active_cli == __mg_client_id) - active = nodes [__mg_zorder_info->active_win].fortestinghwnd; + active = nodes [__mg_zorder_info->active_win].hwnd; else active = HWND_OTHERPROC; @@ -1649,7 +1649,7 @@ static void dskHideGlobalControl (PMAINWIN pWin, int reason, LPARAM lParam) if (nodes [first].cli == __mg_client_id) { RECT rc = nodes [first].rc; - PMAINWIN pCurTop = (PMAINWIN) nodes [first].fortestinghwnd; + PMAINWIN pCurTop = (PMAINWIN) nodes [first].hwnd; pCurTop->dwStyle &= ~WS_VISIBLE; cliHideWindow (pCurTop); @@ -2123,7 +2123,7 @@ static HWND dskGetNextMainWindow (PMAINWIN pWin) } } - hWnd = nodes[slot].fortestinghwnd; + hWnd = nodes[slot].hwnd; if (0 || !hWnd @@ -2369,14 +2369,14 @@ BOOL __mg_client_check_hwnd (HWND hwnd, int cli) slot = zi->first_topmost; for (; slot > 0; slot = nodes [slot].next) { - if (hwnd == nodes [slot].fortestinghwnd && cli == nodes [slot].cli) { + if (hwnd == nodes [slot].hwnd && cli == nodes [slot].cli) { goto ret_true; } } slot = zi->first_normal; for (; slot > 0; slot = nodes [slot].next) { - if (hwnd == nodes [slot].fortestinghwnd && cli == nodes [slot].cli) { + if (hwnd == nodes [slot].hwnd && cli == nodes [slot].cli) { goto ret_true; } } @@ -2506,7 +2506,7 @@ int __mg_get_znode_at_point (const ZORDERINFO* zi, int x, int y, HWND* hwnd) if (slot == 0) return -1; - if (hwnd) *hwnd = nodes [slot].fortestinghwnd; + if (hwnd) *hwnd = nodes [slot].hwnd; return nodes [slot].cli; } @@ -2526,7 +2526,7 @@ int __mg_handle_normal_mouse_move (const ZORDERINFO* zi, int x, int y) if (old_slot != cur_slot) { if (old_slot > 0 && nodes [old_slot].cli == old_cli && - nodes [old_slot].fortestinghwnd == old_hwnd) { + nodes [old_slot].hwnd == old_hwnd) { post_msg_by_znode_p (zi, nodes + old_slot, MSG_MOUSEMOVEIN, FALSE, 0); @@ -2571,7 +2571,7 @@ int __mg_handle_normal_mouse_move (const ZORDERINFO* zi, int x, int y) old_slot = cur_slot; if (cur_slot > 0) { old_cli = nodes [cur_slot].cli; - old_hwnd = nodes [cur_slot].fortestinghwnd; + old_hwnd = nodes [cur_slot].hwnd; } else { old_cli = -1; @@ -3061,7 +3061,7 @@ static BOOL _cb_update_dskmenu (void* context, UPDATA_DSKMENU_INFO* info = (UPDATA_DSKMENU_INFO*) context; if (node->flags & ZOF_TF_MAINWIN - && !(node->flags & ZOF_TF_ALWAYSTOP)) { + && !(node->flags & ZOF_IF_ALWAYSTOP)) { if (node->flags & ZOF_VISIBLE) info->mii.state = MFS_ENABLED; else @@ -3284,7 +3284,7 @@ static BOOL _cb_refresh_znode (void* context, REFRESH_INFO* info = (REFRESH_INFO*) context; if (node->cli == __mg_client_id) { - pTemp = (PMAINWIN)node->fortestinghwnd; + pTemp = (PMAINWIN)node->hwnd; if (pTemp && pTemp->WinType != TYPE_CONTROL && pTemp->dwStyle & WS_VISIBLE) { @@ -3373,7 +3373,7 @@ static void srvSaveScreen (BOOL active) if (__mg_zorder_info->active_win) { cliActive = nodes [__mg_zorder_info->active_win].cli; - hwndActive = nodes [__mg_zorder_info->active_win].fortestinghwnd; + hwndActive = nodes [__mg_zorder_info->active_win].hwnd; rcActive = nodes [__mg_zorder_info->active_win].rc; } } diff --git a/src/kernel/desktop.c b/src/kernel/desktop.c index 3fd4a953..2e478268 100644 --- a/src/kernel/desktop.c +++ b/src/kernel/desktop.c @@ -428,10 +428,10 @@ static int update_client_window (ZORDERNODE* znode, const RECT* rc) #endif { if (rc) - __mg_update_window (znode->fortestinghwnd, rc->left, rc->top, + __mg_update_window (znode->hwnd, rc->left, rc->top, rc->right, rc->bottom); else - __mg_update_window (znode->fortestinghwnd, 0, 0, 0, 0); + __mg_update_window (znode->hwnd, 0, 0, 0, 0); } return 0; @@ -443,9 +443,9 @@ static BOOL _cb_update_znode (void* context, { const RECT* rc = (RECT*)context; - if (znode->flags & ZOF_VISIBLE && znode->flags & ZOF_REFERENCE) { + if (znode->flags & ZOF_VISIBLE && znode->flags & ZOF_IF_REFERENCE) { update_client_window (znode, rc); - znode->flags &= ~ZOF_REFERENCE; + znode->flags &= ~ZOF_IF_REFERENCE; return TRUE; } @@ -473,7 +473,7 @@ static BOOL _cb_update_rc (void* context, if (node->flags & ZOF_VISIBLE && subtract_rgn_by_node(cliprgn, zi, node)) { node->age ++; - node->flags |= ZOF_REFERENCE; + node->flags |= ZOF_IF_REFERENCE; return TRUE; } @@ -1125,7 +1125,7 @@ static int srvForceCloseMenu (int cli) rc_screen = GetScreenRect (); if (SubtractClipRect (&sg_UpdateRgn, &rc_screen)) { win_nodes [0].age ++; - win_nodes [0].flags |= ZOF_REFERENCE; + win_nodes [0].flags |= ZOF_IF_REFERENCE; } #if defined(_MGRM_PROCESSES) @@ -1140,10 +1140,10 @@ static int srvForceCloseMenu (int cli) /* update all znode if it's dirty */ do_for_all_znodes (&rc_bound, zi, _cb_update_znode, ZT_ALL); - if (win_nodes [0].flags & ZOF_REFERENCE) { + if (win_nodes [0].flags & ZOF_IF_REFERENCE) { SendMessage (HWND_DESKTOP, MSG_ERASEDESKTOP, 0, (LPARAM)&rc_bound); - win_nodes [0].flags &= ~ZOF_REFERENCE; + win_nodes [0].flags &= ~ZOF_IF_REFERENCE; } /* notify the client to close the menu */ @@ -1224,7 +1224,7 @@ static int srvStartTrackPopupMenu (int cli, const RECT* rc, HWND ptmi, } menu_nodes [zi->nr_popupmenus].rc = *rc; - menu_nodes [zi->nr_popupmenus].fortestinghwnd = ptmi; + menu_nodes [zi->nr_popupmenus].hwnd = ptmi; #ifdef _MGSCHEMA_COMPOSITING menu_nodes [zi->nr_popupmenus].mem_dc = memdc; #endif @@ -1269,7 +1269,7 @@ static int srvEndTrackPopupMenu (int cli, int idx_znode) rc_screen = GetScreenRect(); if (SubtractClipRect (&sg_UpdateRgn, &rc_screen)) { win_nodes [0].age ++; - win_nodes [0].flags |= ZOF_REFERENCE; + win_nodes [0].flags |= ZOF_IF_REFERENCE; } zi->nr_popupmenus --; @@ -1282,10 +1282,10 @@ static int srvEndTrackPopupMenu (int cli, int idx_znode) /* update all znode if it's dirty */ do_for_all_znodes (&rc, zi, _cb_update_znode, ZT_ALL); - if (win_nodes [0].flags & ZOF_REFERENCE) { + if (win_nodes [0].flags & ZOF_IF_REFERENCE) { SendMessage (HWND_DESKTOP, MSG_ERASEDESKTOP, 0, (LPARAM)&rc); - win_nodes [0].flags &= ~ZOF_REFERENCE; + win_nodes [0].flags &= ~ZOF_IF_REFERENCE; } return 0; @@ -1398,7 +1398,7 @@ static HWND dskSetActiveZOrderNode (int cli, int idx_znode) if (old_active) { if (nodes [old_active].cli == cli) { - old_hwnd = nodes [old_active].fortestinghwnd; + old_hwnd = nodes [old_active].hwnd; } else old_hwnd = HWND_OTHERPROC; @@ -1406,7 +1406,7 @@ static HWND dskSetActiveZOrderNode (int cli, int idx_znode) if (idx_znode) { if (nodes [idx_znode].cli == cli) { - new_hwnd = nodes [idx_znode].fortestinghwnd; + new_hwnd = nodes [idx_znode].hwnd; } else new_hwnd = HWND_OTHERPROC; @@ -1696,7 +1696,7 @@ static int AllocZOrderNode (int cli, HWND hwnd, HWND main_win, nodes [free_slot].rc = *rc; nodes [free_slot].age = 1; nodes [free_slot].cli = cli; - nodes [free_slot].fortestinghwnd = hwnd; + nodes [free_slot].hwnd = hwnd; nodes [free_slot].main_win = main_win; #ifdef _MGSCHEMA_COMPOSITING nodes [free_slot].mem_dc = mem_dc; @@ -1782,7 +1782,7 @@ static int AllocZOrderNode (int cli, HWND hwnd, HWND main_win, /* Since 4.2.0. Support for always top znode. * defined(_MG_ENABLE_SCREENSAVER) || defined(_MG_ENABLE_WATERMARK) */ if (*first == 0 - || (nodes [*first].flags & ZOF_TF_ALWAYSTOP) != ZOF_TF_ALWAYSTOP) + || (nodes [*first].flags & ZOF_IF_ALWAYSTOP) != ZOF_IF_ALWAYSTOP) { old_first = *first; nodes [old_first].prev = free_slot; @@ -1792,7 +1792,7 @@ static int AllocZOrderNode (int cli, HWND hwnd, HWND main_win, else { int pre_idx = *first; while (*first) { - if ((nodes [*first].flags & ZOF_TF_ALWAYSTOP) == ZOF_TF_ALWAYSTOP) { + if ((nodes [*first].flags & ZOF_IF_ALWAYSTOP) == ZOF_IF_ALWAYSTOP) { pre_idx = *first; first = &nodes[*first].next; } @@ -1918,7 +1918,7 @@ static int FreeZOrderNode (int cli, int idx_znode, HDC* memdc) if (nodes [slot].flags & ZOF_VISIBLE && subtract_rgn_by_node(&sg_UpdateRgn, zi, &nodes[slot])) { nodes [slot].age ++; - nodes [slot].flags |= ZOF_REFERENCE; + nodes [slot].flags |= ZOF_IF_REFERENCE; } } if (type > ZOF_TYPE_TOPMOST) { @@ -1927,7 +1927,7 @@ static int FreeZOrderNode (int cli, int idx_znode, HDC* memdc) if (nodes [slot].flags & ZOF_VISIBLE && subtract_rgn_by_node(&sg_UpdateRgn, zi, &nodes[slot])) { nodes [slot].age ++; - nodes [slot].flags |= ZOF_REFERENCE; + nodes [slot].flags |= ZOF_IF_REFERENCE; } } } @@ -1937,20 +1937,20 @@ static int FreeZOrderNode (int cli, int idx_znode, HDC* memdc) if (nodes [slot].flags & ZOF_VISIBLE && subtract_rgn_by_node(&sg_UpdateRgn, zi, &nodes[slot])) { nodes [slot].age ++; - nodes [slot].flags |= ZOF_REFERENCE; + nodes [slot].flags |= ZOF_IF_REFERENCE; } } } if (SubtractClipRect (&sg_UpdateRgn, &rc_screen)) { nodes [0].age ++; - nodes [0].flags |= ZOF_REFERENCE; + nodes [0].flags |= ZOF_IF_REFERENCE; } } /* unchain it */ unchain_znode ((unsigned char*)(zi+1), nodes, idx_znode); - nodes [idx_znode].fortestinghwnd = 0; + nodes [idx_znode].hwnd = 0; if (*first == idx_znode) { *first = nodes [idx_znode].next; @@ -1967,10 +1967,10 @@ static int FreeZOrderNode (int cli, int idx_znode, HDC* memdc) /* update all znode if it's dirty */ do_for_all_znodes (&rc, zi, _cb_update_znode, ZT_ALL); - if (nodes [0].flags & ZOF_REFERENCE) { + if (nodes [0].flags & ZOF_IF_REFERENCE) { SendMessage (HWND_DESKTOP, MSG_ERASEDESKTOP, 0, (WPARAM)&rc); - nodes [0].flags &= ~ZOF_REFERENCE; + nodes [0].flags &= ~ZOF_IF_REFERENCE; } /* if active_win is this window, change it */ @@ -2223,7 +2223,7 @@ static int dskDestroyTopZOrderNode (int cli, int idx_znode) /* lock zi for change */ lock_zi_for_change (zi); - nodes[idx_znode].flags |= ZOF_TF_ALWAYSTOP; + nodes[idx_znode].flags |= ZOF_IF_ALWAYSTOP; /* unlock zi for change */ unlock_zi_for_change (zi); @@ -2356,7 +2356,7 @@ static int dskMove2Top (int cli, int idx_znode) /* Since 4.2.0. Support for stuck znode. * defined(_MG_ENABLE_SCREENSAVER) || defined(_MG_ENABLE_WATERMARK) */ if (!(*first) || - ((nodes [*first].flags & ZOF_TF_ALWAYSTOP) != ZOF_TF_ALWAYSTOP)) { + ((nodes [*first].flags & ZOF_IF_ALWAYSTOP) != ZOF_IF_ALWAYSTOP)) { nodes [idx_znode].prev = nodes[*first].prev; nodes [idx_znode].next = *first; nodes [*first].prev = idx_znode; @@ -2364,7 +2364,7 @@ static int dskMove2Top (int cli, int idx_znode) else { int pre_idx = *first; while (*first) { - if ((nodes [*first].flags & ZOF_TF_ALWAYSTOP) == ZOF_TF_ALWAYSTOP) { + if ((nodes [*first].flags & ZOF_IF_ALWAYSTOP) == ZOF_IF_ALWAYSTOP) { pre_idx = *first; first = &nodes[*first].next; } @@ -2393,9 +2393,9 @@ static int dskMove2Top (int cli, int idx_znode) /* unlock zi for change */ unlock_zi_for_change (zi); - if ((nodes [idx_znode].flags & ZOF_VISIBLE) && nodes [idx_znode].fortestinghwnd) { + if ((nodes [idx_znode].flags & ZOF_VISIBLE) && nodes [idx_znode].hwnd) { update_client_window_rgn (nodes [idx_znode].cli, - nodes [idx_znode].fortestinghwnd); + nodes [idx_znode].hwnd); } @@ -2531,7 +2531,7 @@ static int dskHideWindow (int cli, int idx_znode) if (nodes [slot].flags & ZOF_VISIBLE && subtract_rgn_by_node(&sg_UpdateRgn, zi, &nodes[slot])) { nodes [slot].age ++; - nodes [slot].flags |= ZOF_REFERENCE; + nodes [slot].flags |= ZOF_IF_REFERENCE; } } if (type > ZOF_TYPE_TOPMOST) { @@ -2542,7 +2542,7 @@ static int dskHideWindow (int cli, int idx_znode) } if (SubtractClipRect (&sg_UpdateRgn, &rcScr)) { nodes [0].age ++; - nodes [0].flags |= ZOF_REFERENCE; + nodes [0].flags |= ZOF_IF_REFERENCE; } } @@ -2568,10 +2568,10 @@ static int dskHideWindow (int cli, int idx_znode) /* update all znode if it's dirty */ do_for_all_znodes (&nodes [idx_znode].rc, zi, _cb_update_znode, ZT_ALL); - if (nodes [0].flags & ZOF_REFERENCE) { + if (nodes [0].flags & ZOF_IF_REFERENCE) { SendMessage (HWND_DESKTOP, MSG_ERASEDESKTOP, 0, (WPARAM)&nodes [idx_znode].rc); - nodes [0].flags &= ~ZOF_REFERENCE; + nodes [0].flags &= ~ZOF_IF_REFERENCE; } return 0; @@ -2685,10 +2685,10 @@ static int dskMoveWindow (int cli, int idx_znode, const RECT* rcWin) slot = nodes [idx_znode].next; for (; slot > 0; slot = nodes [slot].next) { if (nodes [slot].flags & ZOF_VISIBLE && - !(nodes [slot].flags & ZOF_REFERENCE) && + !(nodes [slot].flags & ZOF_IF_REFERENCE) && subtract_rgn_by_node(&sg_UpdateRgn, zi, &nodes[slot])) { nodes [slot].age ++; - nodes [slot].flags |= ZOF_REFERENCE; + nodes [slot].flags |= ZOF_IF_REFERENCE; } } @@ -2696,10 +2696,10 @@ static int dskMoveWindow (int cli, int idx_znode, const RECT* rcWin) slot = zi->first_topmost; for (; slot > 0; slot = nodes [slot].next) { if (nodes [slot].flags & ZOF_VISIBLE && - !(nodes [slot].flags & ZOF_REFERENCE) && + !(nodes [slot].flags & ZOF_IF_REFERENCE) && subtract_rgn_by_node(&sg_UpdateRgn, zi, &nodes[slot])) { nodes [slot].age ++; - nodes [slot].flags |= ZOF_REFERENCE; + nodes [slot].flags |= ZOF_IF_REFERENCE; } } } @@ -2708,18 +2708,18 @@ static int dskMoveWindow (int cli, int idx_znode, const RECT* rcWin) slot = zi->first_normal; for (; slot > 0; slot = nodes [slot].next) { if (nodes [slot].flags & ZOF_VISIBLE && - !(nodes [slot].flags & ZOF_REFERENCE) && + !(nodes [slot].flags & ZOF_IF_REFERENCE) && subtract_rgn_by_node(&sg_UpdateRgn, zi, &nodes[slot])) { nodes [slot].age ++; - nodes [slot].flags |= ZOF_REFERENCE; + nodes [slot].flags |= ZOF_IF_REFERENCE; } } } - if (!(nodes [0].flags & ZOF_REFERENCE) && + if (!(nodes [0].flags & ZOF_IF_REFERENCE) && SubtractClipRect (&sg_UpdateRgn, &rcScr)) { nodes [0].age ++; - nodes [0].flags |= ZOF_REFERENCE; + nodes [0].flags |= ZOF_IF_REFERENCE; } rcOld = nodes [idx_znode].rc; @@ -2792,7 +2792,7 @@ static int dskMoveWindow (int cli, int idx_znode, const RECT* rcWin) ExcludeClipRect (HDC_SCREEN_SYS, &nodes [slot].rc); } else { RECT rc; - GetWindowRect(nodes [slot].fortestinghwnd, &rc); + GetWindowRect(nodes [slot].hwnd, &rc); firstmaskrect = GET_MASKRECT(zi); idx = nodes [slot].idx_mask_rect; while (idx) { @@ -2859,10 +2859,10 @@ static int dskMoveWindow (int cli, int idx_znode, const RECT* rcWin) } do_for_all_znodes (&rcOld, zi, _cb_update_znode, ZT_ALL); - if (nodes [0].flags & ZOF_REFERENCE) { + if (nodes [0].flags & ZOF_IF_REFERENCE) { SendMessage (HWND_DESKTOP, MSG_ERASEDESKTOP, 0, (LPARAM)&rcOld); - nodes [0].flags &= ~ZOF_REFERENCE; + nodes [0].flags &= ~ZOF_IF_REFERENCE; } OffsetRegion (&sg_UpdateRgn, @@ -2870,7 +2870,7 @@ static int dskMoveWindow (int cli, int idx_znode, const RECT* rcWin) rcWin->top - rcOld.top); update_client_window_rgn (nodes [idx_znode].cli, - nodes [idx_znode].fortestinghwnd); + nodes [idx_znode].hwnd); } else { lock_zi_for_change (zi); @@ -3197,7 +3197,7 @@ static BOOL _cb_bcast_msg (void* context, #if defined(_MGRM_PROCESSES) if (node->cli == __mg_client_id) { #endif - pWin = (PMAINWIN)node->fortestinghwnd; + pWin = (PMAINWIN)node->hwnd; if (pWin && pWin->WinType != TYPE_CONTROL) { PostMessage ((HWND)pWin, pMsg->message, pMsg->wParam, pMsg->lParam); return TRUE; diff --git a/src/kernel/zorder.c b/src/kernel/zorder.c index ba69ed6c..89af0edc 100644 --- a/src/kernel/zorder.c +++ b/src/kernel/zorder.c @@ -178,7 +178,7 @@ int kernel_alloc_z_order_info (int nr_topmosts, int nr_normals) znodes [0].rc = g_rcScr; znodes [0].age = 0; znodes [0].cli = 0; - znodes [0].fortestinghwnd = HWND_DESKTOP; + znodes [0].hwnd = HWND_DESKTOP; znodes [0].next = 0; znodes [0].prev = 0; znodes [0].idx_mask_rect = 0; @@ -302,7 +302,7 @@ ZORDERINFO* kernel_alloc_z_order_info (int nr_topmosts, int nr_normals) znodes [0].rc = g_rcScr; znodes [0].age = 0; znodes [0].cli = 0; - znodes [0].fortestinghwnd = HWND_DESKTOP; + znodes [0].hwnd = HWND_DESKTOP; znodes [0].next = 0; znodes [0].prev = 0; znodes [0].idx_mask_rect = 0; diff --git a/src/server/layer.c b/src/server/layer.c index 9816b61d..03980355 100644 --- a/src/server/layer.c +++ b/src/server/layer.c @@ -180,7 +180,7 @@ static BOOL do_alloc_layer (MG_Layer* layer, const char* name, znodes [0].rc = g_rcScr; znodes [0].age = 0; znodes [0].cli = 0; - znodes [0].fortestinghwnd = HWND_DESKTOP; + znodes [0].hwnd = HWND_DESKTOP; znodes [0].next = 0; znodes [0].prev = 0; /*for mask rect.*/ @@ -715,12 +715,15 @@ BOOL GUIAPI ServerGetZNodeInfo (MG_Layer* layer, int idx_znode, nodes = (ZORDERNODE*) ((char*)(zi + 1) + zi->size_usage_bmp + sizeof (ZORDERNODE) * DEF_NR_POPUPMENUS); znode_info->type = (nodes [idx_znode].flags & ZOF_TYPE_FLAG_MASK); - znode_info->flags = (nodes [idx_znode].flags & ZOF_FLAG_MASK); + znode_info->flags = nodes [idx_znode].flags; znode_info->caption = nodes [idx_znode].caption; znode_info->rc = nodes [idx_znode].rc; znode_info->cli = nodes [idx_znode].cli; - znode_info->hwnd = nodes [idx_znode].fortestinghwnd; + znode_info->hwnd = nodes [idx_znode].hwnd; znode_info->main_win = nodes [idx_znode].main_win; +#ifdef _MGSCHEMA_COMPOSITING + znode_info->mem_dc = nodes [idx_znode].mem_dc; +#endif return TRUE; }