From 371038040fb73077b313ca248f3e76fcbb4f969e Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Mon, 20 Jan 2020 18:36:30 +0800 Subject: [PATCH] add changes to ZNODEHEADER and init it to zero when allocating a new znode --- include/minigui.h | 2 +- src/kernel/desktop.c | 21 ++++----------------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/include/minigui.h b/include/minigui.h index 8b5a00b8..937f77dc 100644 --- a/include/minigui.h +++ b/include/minigui.h @@ -1148,6 +1148,7 @@ typedef struct _ZNODEHEADER { /** The window handle of the znode if it is a window. */ HWND hwnd; + /** * The window handle of the znode's main window if it is a control * with WS_EX_CTRLASMAINWIN style. @@ -1166,7 +1167,6 @@ typedef struct _ZNODEHEADER { #ifdef _MGSCHEMA_COMPOSITING /** The count for changes of content */ unsigned int changes; - /** * The compositing type for this znode. * For more information, see \a SetMainWindowCompositing. diff --git a/src/kernel/desktop.c b/src/kernel/desktop.c index 6723a587..9d6c41bc 100644 --- a/src/kernel/desktop.c +++ b/src/kernel/desktop.c @@ -1530,8 +1530,10 @@ static int srvStartTrackPopupMenu (int cli, const RECT* rc, HWND ptmi, menu_nodes [zi->nr_popupmenus].rc = *rc; menu_nodes [zi->nr_popupmenus].hwnd = ptmi; #ifdef _MGSCHEMA_COMPOSITING - menu_nodes [zi->nr_popupmenus].mem_dc = memdc; + menu_nodes [zi->nr_popupmenus].changes = 0; menu_nodes [zi->nr_popupmenus].ct = CT_OPAQUE; + menu_nodes [zi->nr_popupmenus].ct_arg = 0; + menu_nodes [zi->nr_popupmenus].mem_dc = memdc; #endif if (zi->cli_trackmenu == -1) @@ -2326,23 +2328,8 @@ static int FreeZOrderNodeEx (ZORDERINFO* zi, int idx_znode, HDC* memdc) } /* Free round corners mask rect. */ - if (type & ZOF_TW_TROUNDCNS || - type & ZOF_TW_BROUNDCNS) { - -#if 0 - int tmp, idx = nodes[idx_znode].idx_mask_rect; - MASKRECT * first = GET_MASKRECT(zi); - - while (idx) { - __mg_slot_clear_use ((unsigned char*)GET_MASKRECT_USAGEBMP(zi), idx); - tmp = (first+idx)->next; - (first+idx)->next = 0; - (first+idx)->prev = 0; - idx = tmp; - } -#else + if (type & ZOF_TW_TROUNDCNS || type & ZOF_TW_BROUNDCNS) { clean_znode_maskrect (zi, nodes, idx_znode); -#endif } #ifndef _MGSCHEMA_COMPOSITING