From dcb79f71d284c616bb4ea2b7b983070f356bdffa Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Wed, 5 Feb 2020 11:06:31 +0800 Subject: [PATCH] disable field age of ZORDERNODE for compositing schema --- src/include/zorder.h | 2 +- src/kernel/desktop-procs.c | 6 +++++- src/kernel/desktop.c | 41 +++++++++++++++++++------------------- src/server/layer.c | 15 ++++++++++++++ 4 files changed, 42 insertions(+), 22 deletions(-) diff --git a/src/include/zorder.h b/src/include/zorder.h index d7737034..cf981623 100644 --- a/src/include/zorder.h +++ b/src/include/zorder.h @@ -76,7 +76,6 @@ typedef struct _ZORDERNODE { RECT rc; /* rect on the screen */ int cli; /* which client? */ - unsigned int age; /* znode age */ #ifdef _MGSCHEMA_COMPOSITING unsigned int changes; /* count for changes of content */ @@ -87,6 +86,7 @@ typedef struct _ZORDERNODE { int nr_dirty_rcs; /* the number of dirty rects */ const RECT* dirty_rcs; /* the pointer to the dirty rectangles */ #else /* defined _MGSCHEMA_COMPOSITING */ + unsigned int age; /* znode age */ RECT dirty_rc; /* dirty rect */ #endif /* not defined _MGSCHEMA_COMPOSITING */ diff --git a/src/kernel/desktop-procs.c b/src/kernel/desktop-procs.c index 563e22d7..c5853a96 100644 --- a/src/kernel/desktop-procs.c +++ b/src/kernel/desktop-procs.c @@ -1655,7 +1655,9 @@ int __mg_do_change_topmost_layer (void) ZORDERINFO* old_zorder_info = __mg_zorder_info; ZORDERNODE *new_nodes, *old_nodes; unsigned char *old_use_bmp, *new_use_bmp; +#ifndef _MGSCHEMA_COMPOSITING int i; +#endif #ifdef _MGHAVE_MENU srvForceCloseMenu (0); @@ -1681,14 +1683,16 @@ int __mg_do_change_topmost_layer (void) memcpy (new_nodes, old_nodes, (old_zorder_info->max_nr_globals)*sizeof(ZORDERNODE)); +#ifndef _MGSCHEMA_COMPOSITING for (i = old_zorder_info->max_nr_globals; i <= old_zorder_info->max_nr_globals + old_zorder_info->max_nr_topmosts + old_zorder_info->max_nr_normals; i++) { new_nodes [i].age = old_nodes [i].age + 1; } - new_nodes [0].age = old_nodes [0].age + 1; +#endif /* not defined _MGSCHEMA_COMPOSITING */ + unlock_zi_for_change (__mg_zorder_info); /* Since 4.2.0: check clients which created fixed znodes */ diff --git a/src/kernel/desktop.c b/src/kernel/desktop.c index 001de48c..1319e9cc 100644 --- a/src/kernel/desktop.c +++ b/src/kernel/desktop.c @@ -122,16 +122,7 @@ typedef struct _DEF_CONTEXT int x, y; } DEF_CONTEXT; -#ifdef _MGSCHEMA_COMPOSITING -unsigned int kernel_GetWndAge (HWND hWnd) -{ - PMAINWIN mainwin = ((PMAINWIN)hWnd)->pMainWin; - const ZORDERNODE* nodes; - - nodes = GET_ZORDERNODE(__mg_zorder_info); - return nodes[mainwin->idx_znode].age; -} -#else /* not defined _MGSCHEMA_COMPOSITING */ +#ifndef _MGSCHEMA_COMPOSITING PGCRINFO kernel_GetGCRgnInfo (HWND hWnd) { return ((PMAINWIN)hWnd)->pGCRInfo; @@ -1956,12 +1947,10 @@ static int AllocZOrderNodeEx (ZORDERINFO* zi, int cli, HWND hwnd, HWND main_win, { DWORD type = flags & ZOF_TYPE_MASK; int *first = NULL, *nr_nodes = NULL; - int free_slot = -1, slot, old_first; + int free_slot = -1, old_first; ZORDERNODE* nodes; - RECT rc_screen; nodes = GET_ZORDERNODE(zi); - rc_screen = GetScreenRect(); /* Since 4.2.0: check fixed znode type first */ switch (type) { @@ -2059,7 +2048,6 @@ static int AllocZOrderNodeEx (ZORDERINFO* zi, int cli, HWND hwnd, HWND main_win, nodes [free_slot].flags = flags; nodes [free_slot].rc = *rc; - nodes [free_slot].age = 1; nodes [free_slot].cli = cli; nodes [free_slot].hwnd = hwnd; nodes [free_slot].main_win = main_win; @@ -2069,6 +2057,12 @@ static int AllocZOrderNodeEx (ZORDERINFO* zi, int cli, HWND hwnd, HWND main_win, nodes [free_slot].ct_arg = ct_arg; nodes [free_slot].mem_dc = mem_dc; nodes [free_slot].dirty_rcs = NULL; +#else + nodes [free_slot].age = 1; + nodes [free_slot].dirty_rc.left = 0; + nodes [free_slot].dirty_rc.top = 0; + nodes [free_slot].dirty_rc.right = 0; + nodes [free_slot].dirty_rc.bottom = 0; #endif nodes [free_slot].idx_mask_rect = 0; nodes [free_slot].priv_data = NULL; @@ -2126,8 +2120,12 @@ static int AllocZOrderNodeEx (ZORDERINFO* zi, int cli, HWND hwnd, HWND main_win, /* check influenced zorder nodes */ if (flags & ZOF_VISIBLE) { /* Since 4.2.0 */ +#ifndef _MGSCHEMA_COMPOSITING + int slot; + RECT rc_screen = GetScreenRect(); + if (type >= ZOF_TYPE_LAUNCHER) { - int slot = ZNIDX_LAUNCHER; + slot = ZNIDX_LAUNCHER; if (nodes [slot].flags & ZOF_VISIBLE && DoesIntersect (&nodes [free_slot].rc, &nodes [slot].rc)) { nodes [slot].age ++; @@ -2165,7 +2163,7 @@ static int AllocZOrderNodeEx (ZORDERINFO* zi, int cli, HWND hwnd, HWND main_win, } if (type >= ZOF_TYPE_DOCKER) { - int slot = ZNIDX_DOCKER; + slot = ZNIDX_DOCKER; if (nodes [slot].flags & ZOF_VISIBLE && DoesIntersect (&nodes [free_slot].rc, &nodes [slot].rc)) { nodes [slot].age ++; @@ -2173,7 +2171,7 @@ static int AllocZOrderNodeEx (ZORDERINFO* zi, int cli, HWND hwnd, HWND main_win, } if (type >= ZOF_TYPE_SCREENLOCK) { - int slot = ZNIDX_SCREENLOCK; + slot = ZNIDX_SCREENLOCK; if (nodes [slot].flags & ZOF_VISIBLE && DoesIntersect (&nodes [free_slot].rc, &nodes [slot].rc)) { nodes [slot].age ++; @@ -2184,9 +2182,12 @@ static int AllocZOrderNodeEx (ZORDERINFO* zi, int cli, HWND hwnd, HWND main_win, if (DoesIntersect (&nodes [free_slot].rc, &rc_screen)) { nodes [0].age ++; } +#else /* not defined _MGSCHEMA_COMPOSITING */ + DO_COMPSOR_OP_ARGS (on_showing_win, + __mg_get_layer_from_zi(zi), free_slot); +#endif /* defined _MGSCHEMA_COMPOSITING */ } - #if 1 /* Since 4.2.0. Support for always top znode. */ if (first) { // not a fixed znode @@ -2970,9 +2971,10 @@ static int dskMove2Top (int cli, int idx_znode) #ifdef _MGSCHEMA_COMPOSITING DO_COMPSOR_OP_ARGS (on_raising_win, get_layer_from_client (cli), idx_znode); +#else + nodes [idx_znode].age ++; #endif - nodes [idx_znode].age ++; /* unlock zi for change */ unlock_zi_for_change (zi); @@ -3605,7 +3607,6 @@ static int dskMoveWindow (int cli, int idx_znode, const RECT* rcWin) get_layer_from_client (cli), idx_znode, rcWin); nodes [idx_znode].rc = *rcWin; - nodes [idx_znode].age ++; unlock_zi_for_change (zi); #endif /* defined _MGSCHEMA_COMPOSITING */ diff --git a/src/server/layer.c b/src/server/layer.c index aec83a16..5428960e 100644 --- a/src/server/layer.c +++ b/src/server/layer.c @@ -177,13 +177,20 @@ static BOOL do_alloc_layer (MG_Layer* layer, const char* name, znodes = GET_ZORDERNODE(zi); znodes [0].flags = ZOF_TYPE_DESKTOP | ZOF_VISIBLE; znodes [0].rc = g_rcScr; +#ifndef _MGSCHEMA_COMPOSITING znodes [0].age = 0; + znodes [0].dirty_rc.left = 0; + znodes [0].dirty_rc.top = 0; + znodes [0].dirty_rc.right = 0; + znodes [0].dirty_rc.bottom = 0; +#endif znodes [0].cli = 0; znodes [0].hwnd = HWND_DESKTOP; znodes [0].next = 0; znodes [0].prev = 0; /*for mask rect.*/ znodes [0].idx_mask_rect = 0; + znodes [0].priv_data = NULL; __mg_slot_set_use ((unsigned char*)(zi + 1), 0); __mg_slot_set_use ((unsigned char*)(maskrect_usage_bmp), 0); @@ -196,12 +203,20 @@ static BOOL do_alloc_layer (MG_Layer* layer, const char* name, for (i = 0; i < TABLESIZE (fixed_ztypes); i++) { znodes [i + ZNIDX_SCREENLOCK].flags = fixed_ztypes [i]; +#ifndef _MGSCHEMA_COMPOSITING znodes [i + ZNIDX_SCREENLOCK].age = 0; + znodes [i + ZNIDX_SCREENLOCK].dirty_rc.left = 0; + znodes [i + ZNIDX_SCREENLOCK].dirty_rc.top = 0; + znodes [i + ZNIDX_SCREENLOCK].dirty_rc.right = 0; + znodes [i + ZNIDX_SCREENLOCK].dirty_rc.bottom = 0; +#endif znodes [i + ZNIDX_SCREENLOCK].cli = -1; znodes [i + ZNIDX_SCREENLOCK].hwnd = HWND_NULL; znodes [i + ZNIDX_SCREENLOCK].next = 0; znodes [i + ZNIDX_SCREENLOCK].prev = 0; znodes [i + ZNIDX_SCREENLOCK].idx_mask_rect = 0; + znodes [i + ZNIDX_SCREENLOCK].priv_data = NULL; + SetRectEmpty (&znodes [i + ZNIDX_SCREENLOCK].rc); __mg_slot_set_use ((unsigned char*)(zi + 1), i + ZNIDX_SCREENLOCK); }