diff --git a/src/kernel/desktop-comm.c b/src/kernel/desktop-comm.c index 2c428b19..317e8897 100644 --- a/src/kernel/desktop-comm.c +++ b/src/kernel/desktop-comm.c @@ -562,159 +562,6 @@ static void dskEnableWindow (PMAINWIN pWin, int flags) } } -#if 0 -static int dskScrollMainWindow (PMAINWIN pWin, PSCROLLWINDOWINFO pswi) -{ - HDC hdc; - RECT rcClient, rcScreen, rcInvalid; - BOOL inved = FALSE; - PCLIPRECT pcrc; - PINVRGN pInvRgn; - - lock_zi_for_read (__mg_zorder_info); - dskClientToScreen (pWin, pswi->rc1, &rcScreen); - - //BUGFIX: if the MainWindow is AutoSecondaryDC, the secondaryDC and - //client dc would be diffirent, so we must get the scondaryDC, - //the update to client dc (dongjunjie 2010/7/28) - //hdc = GetClientDC ((HWND)pWin); - hdc = get_effective_dc(pWin, TRUE); - - pcrc = pWin->pGCRInfo->crgn.head; - while (pcrc) { - RECT rcMove; - - if (!IntersectRect (&rcMove, &pcrc->rc, &rcScreen)) { - pcrc = pcrc->next; - continue; - } - - dskScreenToClient (pWin, &rcMove, &rcMove); - if (!IntersectRect (&rcMove, &rcMove, pswi->rc1)) { - pcrc = pcrc->next; - continue; - } - - if (pWin->dwExStyle & WS_EX_TRANSPARENT) { - /* set invalidate rect. */ - InvalidateRect ((HWND)pWin, &rcMove, TRUE); - inved = TRUE; - } - else { - dskRecalcRect (pWin, &rcMove); - - SelectClipRect (hdc, &rcMove); - - BitBlt (hdc, rcMove.left, rcMove.top, - rcMove.right - rcMove.left, - rcMove.bottom - rcMove.top, - hdc, pswi->iOffx + rcMove.left, pswi->iOffy + rcMove.top, 0); - } - - pcrc = pcrc->next; - } - //ReleaseDC (hdc); - //BUGFIXED: we must update the secondaryDC to clientDC, to ensure - //the secondaryDC and clientDC are same (dongjunjie 2010/07/08) - if(pWin->pMainWin->secondaryDC){ - HDC real_dc = GetClientDC((HWND)pWin->pMainWin); - __mg_update_secondary_dc(pWin, hdc, real_dc, pswi->rc1, HT_CLIENT); - ReleaseDC (real_dc); - } - release_effective_dc(pWin, hdc); - - - GetClientRect((HWND)pWin, &rcClient); - - pInvRgn = &pWin->InvRgn; - if (!pInvRgn->frozen) { -#ifdef _MGRM_THREADS - pthread_mutex_lock (&pInvRgn->lock); -#endif - /*scroll whole screen, offset invalid region*/ - if (EqualRect (pswi->rc1, &rcClient)) - OffsetRegion (&(pInvRgn->rgn), pswi->iOffx, pswi->iOffy); - else - OffsetRegionEx (&(pInvRgn->rgn), &rcClient, - pswi->rc1, pswi->iOffx, pswi->iOffy); -#ifdef _MGRM_THREADS - pthread_mutex_unlock (&pInvRgn->lock); -#endif - } - - pcrc = pWin->pGCRInfo->crgn.head; - while (pcrc) { - BOOL bNeedInvalidate = FALSE; - RECT rcMove; - if (!IntersectRect (&rcMove, &pcrc->rc, &rcScreen)) { - pcrc = pcrc->next; - continue; - } - - dskScreenToClient (pWin, &rcMove, &rcMove); - - dskRecalcRect (pWin, &rcMove); - - rcInvalid = rcMove; - - if (pswi->iOffx < 0) { - rcInvalid.left = rcInvalid.right + pswi->iOffx; - bNeedInvalidate = TRUE; - } - else if (pswi->iOffx > 0) { - rcInvalid.right = rcInvalid.left + pswi->iOffx; - bNeedInvalidate = TRUE; - } - - /* - * BUGFIXED: offx and offy would make the two diffrent areas invalidate - * we should invalid both them (dongjunjie) 2010/07/30 - * - * content - * --------------------------- - * |//: offX | - * |//: | - * |//: View | - * |//: | - * |//: | - * |/////////////////////////| offY - * --------------------------- - * // - represent area need the Need invalidate - * see the to area must be invalidate - */ - if (bNeedInvalidate) { - InvalidateRect ((HWND)pWin, &rcInvalid, TRUE); - rcInvalid = rcMove; //restore the invalidate area - bNeedInvalidate = FALSE; //resotre the inved value - inved = TRUE; - } - - if (pswi->iOffy < 0) { - rcInvalid.top = rcInvalid.bottom + pswi->iOffy; - bNeedInvalidate = TRUE; - } - else if (pswi->iOffy > 0) { - rcInvalid.bottom = rcInvalid.top + pswi->iOffy; - bNeedInvalidate = TRUE; - } - - if (bNeedInvalidate) { - InvalidateRect ((HWND)pWin, &rcInvalid, TRUE); - inved = TRUE; - } - - pcrc = pcrc->next; - } - - unlock_zi_for_read (__mg_zorder_info); - if (inved) { - PostMessage ((HWND)pWin, MSG_PAINT, 0, 0); - } - - return 0; -} -#endif - static int dskMoveMainWindow (PMAINWIN pWin, const RECT* prcExpect) { RECT rcResult; diff --git a/src/kernel/desktop-procs.c b/src/kernel/desktop-procs.c index 89dd31c2..05aee600 100644 --- a/src/kernel/desktop-procs.c +++ b/src/kernel/desktop-procs.c @@ -1609,205 +1609,6 @@ int __mg_remove_all_znodes_of_client (int cli) } } -#if 0 /* deprecated code */ - /* handle screen lock znode */ - if (nodes [ZNIDX_SCREENLOCK].cli == cli && nodes [ZNIDX_SCREENLOCK].hwnd) { - DWORD flags = nodes [ZNIDX_SCREENLOCK].flags; - if (flags & ZOF_VISIBLE) { -#ifndef _MGSCHEMA_COMPOSITING - do_for_all_znodes (nodes + ZNIDX_SCREENLOCK, zi, - _cb_intersect_rc_no_cli, ZT_DOCKER); - do_for_all_znodes (nodes + ZNIDX_SCREENLOCK, zi, - _cb_intersect_rc_no_cli, ZT_GLOBAL); - do_for_all_znodes (nodes + ZNIDX_SCREENLOCK, zi, - _cb_intersect_rc_no_cli, ZT_TOPMOST); - do_for_all_znodes (nodes + ZNIDX_SCREENLOCK, zi, - _cb_intersect_rc_no_cli, ZT_NORMAL); - do_for_all_znodes (nodes + ZNIDX_SCREENLOCK, zi, - _cb_intersect_rc_no_cli, ZT_LAUNCHER); -#else /* defined _MGSCHEMA_COMPOSITING */ - DO_COMPSOR_OP_ARGS (on_hiding_win, layer, ZNIDX_SCREENLOCK); -#endif /* defined _MGSCHEMA_COMPOSITING */ - } - - clean_znode_maskrect (zi, nodes, ZNIDX_SCREENLOCK); - nodes [ZNIDX_SCREENLOCK].cli = -1; - nodes [ZNIDX_SCREENLOCK].hwnd = HWND_NULL; - -#ifdef _MGSCHEMA_COMPOSITING - if (flags & ZOF_VISIBLE) { - DO_COMPSOR_OP_ARGS (on_dirty_screen, layer, - flags & ZOF_TYPE_FLAG_MASK, &nodes [ZNIDX_SCREENLOCK].rc); - } -#endif /* defined _MGSCHEMA_COMPOSITING */ - } - - /* handle docker znode */ - if (nodes [ZNIDX_DOCKER].cli == cli && nodes [ZNIDX_DOCKER].hwnd) { - DWORD flags = nodes [ZNIDX_DOCKER].flags; - if (flags & ZOF_VISIBLE) { -#ifndef _MGSCHEMA_COMPOSITING - do_for_all_znodes (nodes + ZNIDX_DOCKER, zi, - _cb_intersect_rc_no_cli, ZT_GLOBAL); - do_for_all_znodes (nodes + ZNIDX_DOCKER, zi, - _cb_intersect_rc_no_cli, ZT_TOPMOST); - do_for_all_znodes (nodes + ZNIDX_DOCKER, zi, - _cb_intersect_rc_no_cli, ZT_NORMAL); - do_for_all_znodes (nodes + ZNIDX_SCREENLOCK, zi, - _cb_intersect_rc_no_cli, ZT_LAUNCHER); -#else /* defined _MGSCHEMA_COMPOSITING */ - DO_COMPSOR_OP_ARGS (on_hiding_win, layer, ZNIDX_DOCKER); -#endif /* defined _MGSCHEMA_COMPOSITING */ - } - - clean_znode_maskrect (zi, nodes, ZNIDX_DOCKER); - nodes [ZNIDX_DOCKER].cli = -1; - nodes [ZNIDX_DOCKER].hwnd = HWND_NULL; - -#ifdef _MGSCHEMA_COMPOSITING - if (flags & ZOF_VISIBLE) { - DO_COMPSOR_OP_ARGS (on_dirty_screen, layer, - flags & ZOF_TYPE_FLAG_MASK, &nodes [ZNIDX_DOCKER].rc); - } -#endif /* defined _MGSCHEMA_COMPOSITING */ - } - - /* skip global ones */ - - /* handle topmosts */ - slot = zi->first_topmost; - for (; slot > 0; slot = nodes [slot].next) { - if (nodes [slot].cli == cli) { - DWORD flags = nodes [slot].flags; - if (flags & ZOF_VISIBLE) { -#ifndef _MGSCHEMA_COMPOSITING - SetClipRgn (&sg_UpdateRgn, &nodes [slot].rc); - GetBoundRect (&rc_bound, &rc_bound, &nodes [slot].rc); - - slot2 = nodes [slot].next; - for (; slot2 > 0; slot2 = nodes [slot2].next) { - if (nodes [slot2].cli != cli && - nodes [slot2].flags & ZOF_VISIBLE && - subtract_rgn_by_node(&sg_UpdateRgn, - zi, &nodes [slot2])) { - - nodes [slot2].age ++; - nodes [slot2].flags |= ZOF_IF_REFERENCE; - } - } - - do_for_all_znodes (nodes + slot, zi, - _cb_intersect_rc_no_cli, ZT_NORMAL); - do_for_all_znodes (nodes + slot, zi, - _cb_intersect_rc_no_cli, ZT_LAUNCHER); - - if (!(nodes [0].flags & ZOF_IF_REFERENCE) && - SubtractClipRect (&sg_UpdateRgn, &rcScr)) { - nodes [0].age ++; - nodes [0].flags |= ZOF_IF_REFERENCE; - } -#else /* defined _MGSCHEMA_COMPOSITING */ - DO_COMPSOR_OP_ARGS (on_hiding_win, layer, slot); -#endif /* defined _MGSCHEMA_COMPOSITING */ - } - - unchain_znode ((unsigned char *)(zi+1), nodes, slot); - clean_znode_maskrect (zi, nodes, slot); - - if (zi->first_topmost == slot) { - zi->first_topmost = nodes [slot].next; - } - zi->nr_topmosts--; - -#ifdef _MGSCHEMA_COMPOSITING - if (flags & ZOF_VISIBLE) { - DO_COMPSOR_OP_ARGS (on_dirty_screen, layer, - flags & ZOF_TYPE_FLAG_MASK, &nodes [slot].rc); - } -#endif /* defined _MGSCHEMA_COMPOSITING */ - } - } - - /* handle normals */ - slot = zi->first_normal; - for (; slot > 0; slot = nodes [slot].next) { - if (nodes [slot].cli == cli) { - DWORD flags = nodes [slot].flags; - if (flags & ZOF_VISIBLE) { -#ifndef _MGSCHEMA_COMPOSITING - SetClipRgn (&sg_UpdateRgn, &nodes [slot].rc); - GetBoundRect (&rc_bound, &rc_bound, &nodes [slot].rc); - - slot2 = nodes [slot].next; - for (; slot2 > 0; slot2 = nodes [slot2].next) { - if (nodes [slot2].cli != cli && - nodes [slot2].flags & ZOF_VISIBLE && - subtract_rgn_by_node(&sg_UpdateRgn, - zi, &nodes [slot2])) { - - nodes [slot2].age ++; - nodes [slot2].flags |= ZOF_IF_REFERENCE; - } - } - - do_for_all_znodes (nodes + slot, zi, - _cb_intersect_rc_no_cli, ZT_LAUNCHER); - - if (!(nodes [0].flags & ZOF_IF_REFERENCE) && - SubtractClipRect (&sg_UpdateRgn, &rcScr)) { - nodes [0].age ++; - nodes [0].flags |= ZOF_IF_REFERENCE; - } -#else /* defined _MGSCHEMA_COMPOSITING */ - DO_COMPSOR_OP_ARGS (on_hiding_win, layer, slot); -#endif /* defined _MGSCHEMA_COMPOSITING */ - } - - unchain_znode ((unsigned char *)(zi+1), nodes, slot); - clean_znode_maskrect (zi, nodes, slot); - - if (zi->first_normal == slot) { - zi->first_normal = nodes [slot].next; - } - zi->nr_normals --; - -#ifdef _MGSCHEMA_COMPOSITING - if (flags & ZOF_VISIBLE) { - DO_COMPSOR_OP_ARGS (on_dirty_screen, layer, - flags & ZOF_TYPE_FLAG_MASK, &nodes [slot].rc); - } -#endif /* defined _MGSCHEMA_COMPOSITING */ - } - } - - /* handle launcher znode */ - if (nodes [ZNIDX_LAUNCHER].cli == cli && nodes [ZNIDX_LAUNCHER].hwnd) { - DWORD flags = nodes [ZNIDX_LAUNCHER].flags; - if (flags & ZOF_VISIBLE) { -#ifndef _MGSCHEMA_COMPOSITING - if (!(nodes [0].flags & ZOF_IF_REFERENCE) && - SubtractClipRect (&sg_UpdateRgn, &rcScr)) { - nodes [0].age ++; - nodes [0].flags |= ZOF_IF_REFERENCE; - } -#else /* defined _MGSCHEMA_COMPOSITING */ - DO_COMPSOR_OP_ARGS(on_hiding_win, layer, ZNIDX_LAUNCHER); -#endif /* defined _MGSCHEMA_COMPOSITING */ - } - - clean_znode_maskrect (zi, nodes, ZNIDX_LAUNCHER); - nodes [ZNIDX_LAUNCHER].cli = -1; - nodes [ZNIDX_LAUNCHER].hwnd = HWND_NULL; - -#ifdef _MGSCHEMA_COMPOSITING - if (flags & ZOF_VISIBLE) { - DO_COMPSOR_OP_ARGS (on_dirty_screen, layer, - flags & ZOF_TYPE_FLAG_MASK, &nodes [ZNIDX_LAUNCHER].rc); - } -#endif /* defined _MGSCHEMA_COMPOSITING */ - } -#endif /* deprecated code */ - old_active = zi->active_win; if (nodes [old_active].cli == cli) zi->active_win = 0; /* set the active_win to desktop temp */ @@ -2538,162 +2339,6 @@ static void dskEnableWindow (PMAINWIN pWin, int flags) } } -#if 0 -static int dskScrollMainWindow (PMAINWIN pWin, PSCROLLWINDOWINFO pswi) -{ - HDC hdc; - RECT rcClient, rcScreen, rcInvalid; - BOOL inved = FALSE; - PCLIPRECT pcrc; - PINVRGN pInvRgn; - - if (!(pWin->dwStyle & WS_VISIBLE)) - return 0; - - lock_zi_for_read (__mg_zorder_info); - - dskClientToScreen (pWin, pswi->rc1, &rcScreen); - - //BUGFIX: if the MainWindow is AutoSecondaryDC, the secondaryDC and - //client dc would be diffirent, so we must get the scondaryDC, - //the update to client dc (dongjunjie 2010/7/28) - hdc = get_effective_dc(pWin, TRUE); - - pcrc = pWin->pGCRInfo->crgn.head; - while (pcrc) { - RECT rcMove; - - if (!IntersectRect (&rcMove, &pcrc->rc, &rcScreen)) { - pcrc = pcrc->next; - continue; - } - - dskScreenToClient (pWin, &rcMove, &rcMove); - if (!IntersectRect (&rcMove, &rcMove, pswi->rc1)) { - pcrc = pcrc->next; - continue; - } - - if (pWin->dwExStyle & WS_EX_TRANSPARENT) { - /* set invalidate rect. */ - InvalidateRect ((HWND)pWin, &rcMove, TRUE); - inved = TRUE; - } - else { - dskRecalcRect (pWin, &rcMove); - - SelectClipRect (hdc, &rcMove); - - BitBlt (hdc, rcMove.left, rcMove.top, - rcMove.right - rcMove.left, - rcMove.bottom - rcMove.top, - hdc, pswi->iOffx + rcMove.left, pswi->iOffy + rcMove.top, 0); - } - pcrc = pcrc->next; - } - //BUGFIXED: we must update the secondaryDC to clientDC, to ensure - //the secondaryDC and clientDC are same (dongjunjie 2010/07/08) - if(pWin->pMainWin->secondaryDC){ - HDC real_dc = GetClientDC((HWND)pWin->pMainWin); - __mg_update_secondary_dc(pWin, hdc, real_dc, pswi->rc1, HT_CLIENT); - ReleaseDC (real_dc); - } - release_effective_dc(pWin, hdc); - - GetClientRect((HWND)pWin, &rcClient); - - pInvRgn = &pWin->InvRgn; - if (!pInvRgn->frozen) { -#ifdef _MGRM_THREADS - pthread_mutex_lock (&pInvRgn->lock); -#endif - /*scroll whole screen, offset invalid region*/ - if (EqualRect (pswi->rc1, &rcClient)) - OffsetRegion (&(pInvRgn->rgn), pswi->iOffx, pswi->iOffy); - else - OffsetRegionEx (&(pInvRgn->rgn), &rcClient, - pswi->rc1, pswi->iOffx, pswi->iOffy); -#ifdef _MGRM_THREADS - pthread_mutex_unlock (&pInvRgn->lock); -#endif - } - - pcrc = pWin->pGCRInfo->crgn.head; - while (pcrc) { - BOOL bNeedInvalidate = FALSE; - RECT rcMove; - if (!IntersectRect (&rcMove, &pcrc->rc, &rcScreen)) { - pcrc = pcrc->next; - continue; - } - - dskScreenToClient (pWin, &rcMove, &rcMove); - - dskRecalcRect (pWin, &rcMove); - - rcInvalid = rcMove; - - if (pswi->iOffx < 0) { - rcInvalid.left = rcInvalid.right + pswi->iOffx; - InvalidateRect ((HWND)pWin, &rcInvalid, TRUE); - inved = TRUE; - } - else if (pswi->iOffx > 0) { - rcInvalid.right = rcInvalid.left + pswi->iOffx; - InvalidateRect ((HWND)pWin, &rcInvalid, TRUE); - inved = TRUE; - } - - /* - * BUGFIXED: offx and offy would make the two diffrent areas invalidate - * we should invalid both them (dongjunjie) 2010/07/30 - * - * content - * --------------------------- - * |//: offX | - * |//: | - * |//: View | - * |//: | - * |//: | - * |/////////////////////////| offY - * --------------------------- - * // - represent area need the Need invalidate - * see the to area must be invalidate - */ - if(bNeedInvalidate) - { - InvalidateRect ((HWND)pWin, &rcInvalid, TRUE); - rcInvalid = rcMove; //restore the invalidate area - bNeedInvalidate = FALSE; //resotre the inved value - inved = TRUE; - } - - if (pswi->iOffy < 0) { - rcInvalid.top = rcInvalid.bottom + pswi->iOffy; - bNeedInvalidate = TRUE; - } - else if (pswi->iOffy > 0) { - rcInvalid.bottom = rcInvalid.top + pswi->iOffy; - bNeedInvalidate = TRUE; - } - - if (bNeedInvalidate) { - InvalidateRect ((HWND)pWin, &rcInvalid, TRUE); - inved = TRUE; - } - - pcrc = pcrc->next; - } - - unlock_zi_for_read (__mg_zorder_info); - - if (inved) - PostMessage ((HWND)pWin, MSG_PAINT, 0, 0); - - return 0; -} -#endif /* disabled code */ - static inline HWND dskGetCaptureWindow (void) { return __mg_captured_wnd; diff --git a/src/kernel/desktop.c b/src/kernel/desktop.c index 602d57f1..d128994b 100644 --- a/src/kernel/desktop.c +++ b/src/kernel/desktop.c @@ -743,7 +743,7 @@ static int dskScrollMainWindow (PMAINWIN pWin, PSCROLLWINDOWINFO pswi) //BUGFIXED: we must update the secondaryDC to clientDC, to ensure //the secondaryDC and clientDC are same (dongjunjie 2010/07/08) if (pWin->pMainWin->secondaryDC) { - HDC real_dc = GetClientDC((HWND)pWin->pMainWin); + HDC real_dc = GetClientDC ((HWND)pWin->pMainWin); __mg_update_secondary_dc(pWin, hdc, real_dc, pswi->rc1, HT_CLIENT); ReleaseDC (real_dc); }