fix conditional compilation errors and tune

This commit is contained in:
Vincent Wei
2020-02-19 22:12:54 +08:00
parent d24788134f
commit ab1dbb767a
6 changed files with 41 additions and 17 deletions
+15 -5
View File
@@ -182,26 +182,36 @@ static int dskAddNewMainWindow (PMAINWIN pWin)
}
/* Since 5.0.0: handle window style if failed to allocate znode
for fixed ones */
for special main window */
if (pWin->dwExStyle & WS_EX_WINTYPE_MASK) {
ZORDERNODE* nodes = GET_ZORDERNODE(__mg_zorder_info);
pWin->dwExStyle &= ~WS_EX_WINTYPE_MASK;
switch (nodes [pWin->idx_znode].flags & ZOF_TYPE_MASK) {
case ZOF_TYPE_TOOLTIP:
pWin->dwExStyle |= WS_EX_WINTYPE_TOOLTIP;
break;
case ZOF_TYPE_GLOBAL:
pWin->dwExStyle |= WS_EX_WINTYPE_GLOBAL;
break;
case ZOF_TYPE_SCREENLOCK:
pWin->dwExStyle |= WS_EX_WINTYPE_SCREENLOCK;
break;
case ZOF_TYPE_DOCKER:
pWin->dwExStyle |= WS_EX_WINTYPE_DOCKER;
break;
case ZOF_TYPE_LAUNCHER:
pWin->dwExStyle |= WS_EX_WINTYPE_LAUNCHER;
break;
case ZOF_TYPE_TOPMOST:
pWin->dwExStyle |= WS_EX_WINTYPE_HIGHER;
pWin->dwExStyle |= WS_EX_TOPMOST;
break;
case ZOF_TYPE_NORMAL:
pWin->dwExStyle |= WS_EX_WINTYPE_NORMAL;
break;
case ZOF_TYPE_LAUNCHER:
pWin->dwExStyle |= WS_EX_WINTYPE_LAUNCHER;
break;
default:
assert(0);
break;
}
}
@@ -1871,7 +1881,7 @@ static int dskDesktopCommand (HMENU hDesktopMenu, int id)
else if (id == IDM_CLOSEALLWIN) {
PMAINWIN pWin;
for (level = 0; level < NR_ZORDER_LEVELS; level < 0) {
for (level = 0; level < NR_ZORDER_LEVELS; level++) {
slot = __mg_zorder_info->first_in_levels[level];
for (; slot > 0; slot = nodes[slot].next) {
pWin = (PMAINWIN)(nodes[slot].hwnd);
+13 -3
View File
@@ -2026,20 +2026,30 @@ static int dskAddNewMainWindow (PMAINWIN pWin, const COMPOSITINGINFO* ct_info)
pWin->dwExStyle &= ~WS_EX_WINTYPE_MASK;
switch (nodes [pWin->idx_znode].flags & ZOF_TYPE_MASK) {
case ZOF_TYPE_TOOLTIP:
pWin->dwExStyle |= WS_EX_WINTYPE_TOOLTIP;
break;
case ZOF_TYPE_GLOBAL:
pWin->dwExStyle |= WS_EX_WINTYPE_GLOBAL;
break;
case ZOF_TYPE_SCREENLOCK:
pWin->dwExStyle |= WS_EX_WINTYPE_SCREENLOCK;
break;
case ZOF_TYPE_DOCKER:
pWin->dwExStyle |= WS_EX_WINTYPE_DOCKER;
break;
case ZOF_TYPE_LAUNCHER:
pWin->dwExStyle |= WS_EX_WINTYPE_LAUNCHER;
break;
case ZOF_TYPE_TOPMOST:
pWin->dwExStyle |= WS_EX_WINTYPE_HIGHER;
pWin->dwExStyle |= WS_EX_TOPMOST;
break;
case ZOF_TYPE_NORMAL:
pWin->dwExStyle |= WS_EX_WINTYPE_NORMAL;
break;
case ZOF_TYPE_LAUNCHER:
pWin->dwExStyle |= WS_EX_WINTYPE_LAUNCHER;
break;
default:
assert(0);
break;
}
}
+5 -7
View File
@@ -2165,7 +2165,7 @@ static int AllocZOrderNodeEx (ZORDERINFO* zi, int cli, HWND hwnd, HWND main_win,
if (zi->first_launcher > 0 &&
nodes [zi->first_launcher].cli != cli) {
flags &= ~ZOF_TYPE_MASK;
flags |= ZOF_TYPE_TOPMOST;
flags |= ZOF_TYPE_NORMAL;
}
break;
@@ -2263,10 +2263,8 @@ static int AllocZOrderNodeEx (ZORDERINFO* zi, int cli, HWND hwnd, HWND main_win,
/* lock zi for change */
lock_zi_for_change (zi);
/* the slot must be larger than zero */
if (free_slot == -1) {
/* Since 5.0.0: tune code to avoid potential errors */
/* Since 5.0.0: tune code to avoid potential errors */
{
int len_bmp_specials = LEN_USAGE_BMP_SPECIAL(zi);
if (IS_TYPE_SPECIAL (type)) {
@@ -2295,7 +2293,7 @@ static int AllocZOrderNodeEx (ZORDERINFO* zi, int cli, HWND hwnd, HWND main_win,
if (-1 == free_slot) {
/* unlock zorderinfo for change. */
unlock_zi_for_change (zi);
_ERR_PRINTF ("Cann't find unused slot. \n");
_WRN_PRINTF ("cannot allocate slot for new znode\n");
return -1;
}
@@ -2325,7 +2323,7 @@ static int AllocZOrderNodeEx (ZORDERINFO* zi, int cli, HWND hwnd, HWND main_win,
if (flags & ZOF_TW_TROUNDCNS || flags & ZOF_TW_BROUNDCNS) {
RECT cli_rect;
SetRect(&cli_rect, 0, 0, RECTW(nodes[free_slot].rc),
SetRect (&cli_rect, 0, 0, RECTW(nodes[free_slot].rc),
RECTH(nodes[free_slot].rc));
alloc_mask_rects_for_round_corners (__mg_zorder_info,
&nodes[free_slot], flags, &cli_rect);