diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2015-03-24 00:55:09 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2015-03-24 00:55:09 +0000 |
commit | b2e1ec3eb79227ccea43e270d5ed1917cc0dcc53 (patch) | |
tree | daf3cd3ef42ada29a532713b53dff6c44b76e1ca | |
parent | ceb5a959c77bbfdb5f5054d6d694032aa323f674 (diff) |
* multiple WINE bug fixes over DeferWindowPos(), bug rep: https://bugs.winehq.org/show_bug.cgi?id=38275
git-svn-id: http://svn.miranda-ng.org/main/trunk@12488 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/AutoShutdown/src/frame.cpp | 9 | ||||
-rw-r--r-- | plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp | 13 | ||||
-rw-r--r-- | plugins/CrashDumper/src/ui.cpp | 2 | ||||
-rw-r--r-- | plugins/Exchange/src/dlg_handlers.cpp | 2 | ||||
-rw-r--r-- | plugins/FloatingContacts/src/thumbs.cpp | 4 | ||||
-rw-r--r-- | plugins/IEHistory/src/dlgHandlers.cpp | 5 | ||||
-rw-r--r-- | plugins/Scriver/src/msgdialog.cpp | 3 | ||||
-rw-r--r-- | plugins/Scriver/src/utils.cpp | 9 | ||||
-rw-r--r-- | plugins/SeenPlugin/src/history.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/buttonsbar.cpp | 23 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/window.cpp | 24 | ||||
-rw-r--r-- | plugins/TabSRMM/src/sidebar.cpp | 4 | ||||
-rw-r--r-- | plugins/TopToolBar/src/toolbar.cpp | 14 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/dlg_anniversarylist.cpp | 24 | ||||
-rw-r--r-- | plugins/WhenWasIt/src/dlg_handlers.cpp | 2 | ||||
-rw-r--r-- | plugins/YAPP/src/yapp_history_dlg.cpp | 2 | ||||
-rw-r--r-- | src/core/stdfile/src/ftmanager.cpp | 12 | ||||
-rw-r--r-- | src/modules/utils/resizer.cpp | 4 |
18 files changed, 101 insertions, 59 deletions
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp index 3b1ae22bfe..c9843510f0 100644 --- a/plugins/AutoShutdown/src/frame.cpp +++ b/plugins/AutoShutdown/src/frame.cpp @@ -254,11 +254,14 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA /* progress */
width=rc.right-GetSystemMetrics(SM_CXICON)-10;
height=rc.bottom-(GetSystemMetrics(SM_CYICON)/2)-5;
- hdwp=DeferWindowPos(hdwp,dat->hwndProgress,NULL,0,0,width,height,SWP_NOMOVE|defflg);
+ if (NULL != dat->hwndProgress) /* Wine fix. */
+ hdwp=DeferWindowPos(hdwp, dat->hwndProgress, NULL, 0, 0, width, height, SWP_NOMOVE|defflg);
/* desc */
- if (dat->hwndDesc != NULL) hdwp=DeferWindowPos(hdwp,dat->hwndDesc,NULL,GetSystemMetrics(SM_CXICON)+5,5+height,0,0,SWP_NOSIZE|defflg);
+ if (dat->hwndDesc != NULL) /* Wine fix. */
+ hdwp = DeferWindowPos(hdwp, dat->hwndDesc, NULL, GetSystemMetrics(SM_CXICON)+5, 5+height, 0, 0, SWP_NOSIZE|defflg);
/* time */
- hdwp=DeferWindowPos(hdwp,dat->hwndTime,NULL,GetSystemMetrics(SM_CXICON)+85,5+height,width-80,(GetSystemMetrics(SM_CXICON)/2),defflg);
+ if (NULL != dat->hwndTime) /* Wine fix. */
+ hdwp = DeferWindowPos(hdwp, dat->hwndTime, NULL, GetSystemMetrics(SM_CXICON)+85, 5+height, width-80, (GetSystemMetrics(SM_CXICON)/2),defflg);
EndDeferWindowPos(hdwp);
PostMessage(hwndFrame,M_CHECK_CLIPPED,0,0);
return 0;
diff --git a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp index 440cf7e4b4..f913c58767 100644 --- a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp @@ -2329,12 +2329,13 @@ int SizeFramesByWindowRect(RECT *r, HDWP * PosBatch, int mode) }
if (g_pfwFrames[i].OwnerWindow && (INT_PTR)(g_pfwFrames[i].OwnerWindow) != -2) {
if (!(mode & 2)) {
- HWND hwnd;
- hwnd = GetParent(g_pfwFrames[i].OwnerWindow);
- *PosBatch = DeferWindowPos(*PosBatch, g_pfwFrames[i].OwnerWindow, NULL, g_pfwFrames[i].wndSize.left + r->left, g_pfwFrames[i].wndSize.top + r->top,
- g_pfwFrames[i].wndSize.right - g_pfwFrames[i].wndSize.left, g_pfwFrames[i].wndSize.bottom - g_pfwFrames[i].wndSize.top, SWP_NOZORDER | SWP_NOACTIVATE);
- SetWindowPos(g_pfwFrames[i].hWnd, NULL, 0, 0,
- g_pfwFrames[i].wndSize.right - g_pfwFrames[i].wndSize.left, g_pfwFrames[i].wndSize.bottom - g_pfwFrames[i].wndSize.top, SWP_NOZORDER | SWP_NOACTIVATE/*|SWP_NOSENDCHANGING*/);
+ HWND hwnd = GetParent(g_pfwFrames[i].OwnerWindow);
+ if (NULL != g_pfwFrames[i].OwnerWindow) { /* Wine fix. */
+ *PosBatch = DeferWindowPos(*PosBatch, g_pfwFrames[i].OwnerWindow, NULL, g_pfwFrames[i].wndSize.left + r->left, g_pfwFrames[i].wndSize.top + r->top,
+ g_pfwFrames[i].wndSize.right - g_pfwFrames[i].wndSize.left, g_pfwFrames[i].wndSize.bottom - g_pfwFrames[i].wndSize.top, SWP_NOZORDER | SWP_NOACTIVATE);
+ SetWindowPos(g_pfwFrames[i].hWnd, NULL, 0, 0,
+ g_pfwFrames[i].wndSize.right - g_pfwFrames[i].wndSize.left, g_pfwFrames[i].wndSize.bottom - g_pfwFrames[i].wndSize.top, SWP_NOZORDER | SWP_NOACTIVATE/*|SWP_NOSENDCHANGING*/);
+ }
}
//Frame
if (g_pfwFrames[i].TitleBar.ShowTitleBar) {
diff --git a/plugins/CrashDumper/src/ui.cpp b/plugins/CrashDumper/src/ui.cpp index 546c94cab6..d5908043c3 100644 --- a/plugins/CrashDumper/src/ui.cpp +++ b/plugins/CrashDumper/src/ui.cpp @@ -23,6 +23,8 @@ extern HINSTANCE hInst; HDWP MyResizeWindow(HDWP hDwp, HWND hwndDlg, HWND hwndCtrl, int nHorizontalOffset, int nVerticalOffset, int nWidthOffset, int nHeightOffset)
{
+ if (NULL == hwndDlg) /* Wine fix. */
+ return hDwp;
// get current bounding rectangle
RECT rcinit;
GetWindowRect(hwndCtrl, &rcinit);
diff --git a/plugins/Exchange/src/dlg_handlers.cpp b/plugins/Exchange/src/dlg_handlers.cpp index 7e9fdb0754..1292a143aa 100644 --- a/plugins/Exchange/src/dlg_handlers.cpp +++ b/plugins/Exchange/src/dlg_handlers.cpp @@ -148,6 +148,8 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara void AddAnchorWindowToDeferList(HDWP &hdWnds, HWND window, RECT *rParent, WINDOWPOS *wndPos, int anchors)
{
+ if (NULL == window) /* Wine fix. */
+ return;
RECT rChild = AnchorCalcPos(window, rParent, wndPos, anchors);
hdWnds = DeferWindowPos(hdWnds, window, HWND_NOTOPMOST, rChild.left, rChild.top, rChild.right - rChild.left, rChild.bottom - rChild.top, SWP_NOZORDER);
}
diff --git a/plugins/FloatingContacts/src/thumbs.cpp b/plugins/FloatingContacts/src/thumbs.cpp index 058999a6ae..f63bc1cf54 100644 --- a/plugins/FloatingContacts/src/thumbs.cpp +++ b/plugins/FloatingContacts/src/thumbs.cpp @@ -63,8 +63,8 @@ void ThumbInfo::PositionThumb(int nX, int nY) ThumbInfo *pThumb = this;
while (pThumb) {
pThumb->PositionThumbWorker(pos.x, pos.y, &pos);
-
- DeferWindowPos(hdwp, pThumb->hwnd, HWND_TOPMOST, pos.x, pos.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
+ if (NULL != pThumb->hwnd) /* Wine fix. */
+ hdwp = DeferWindowPos(hdwp, pThumb->hwnd, HWND_TOPMOST, pos.x, pos.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
pThumb->ptPos = pos;
pos.x += pThumb->szSize.cx;
diff --git a/plugins/IEHistory/src/dlgHandlers.cpp b/plugins/IEHistory/src/dlgHandlers.cpp index ddee342acf..187dcd7bbe 100644 --- a/plugins/IEHistory/src/dlgHandlers.cpp +++ b/plugins/IEHistory/src/dlgHandlers.cpp @@ -344,6 +344,8 @@ int ScrollToBottom(HWND hWnd) void AddAnchorWindowToDeferList(HDWP &hdWnds, HWND window, RECT *rParent, WINDOWPOS *wndPos, int anchors) { + if (NULL == window) /* Wine fix. */
+ return;
RECT rChild = AnchorCalcPos(window, rParent, wndPos, anchors); hdWnds = DeferWindowPos(hdWnds, window, HWND_NOTOPMOST, rChild.left, rChild.top, rChild.right - rChild.left, rChild.bottom - rChild.top, SWP_NOZORDER); } @@ -433,7 +435,8 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara WINDOWPOS *wndPos = (WINDOWPOS *)lParam; GetWindowRect(hWnd, &rParent); - //hdWnds = DeferWindowPos(hdWnds, hStatusBar, HWND_NOTOPMOST, wndPos->x, wndPos->y + wndPos->cy - statusHeight, statusWidth, statusHeight, SWP_NOZORDER); + // if (NULL != hStatusBar) /* Wine fix. */ + // hdWnds = DeferWindowPos(hdWnds, hStatusBar, HWND_NOTOPMOST, wndPos->x, wndPos->y + wndPos->cy - statusHeight, statusWidth, statusHeight, SWP_NOZORDER); SendMessage(hStatusBar, WM_SIZE, 0, 0); if (wndPos->cx < MIN_HISTORY_WIDTH) wndPos->cx = MIN_HISTORY_WIDTH; diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index e40d7cf57d..a1e9dd0ec7 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -540,7 +540,8 @@ static void MessageDialogResize(HWND hwndDlg, SrmmWindowData *dat, int w, int h) logH = h - hSplitterPos - toolbarHeight - infobarInnerHeight;
HDWP hdwp = BeginDeferWindowPos(15);
- hdwp = DeferWindowPos(hdwp, dat->infobarData->hWnd, 0, 1, 0, w - 2, infobarInnerHeight - 2, SWP_NOZORDER);
+ if (NULL != dat->infobarData->hWnd) /* Wine fix. */
+ hdwp = DeferWindowPos(hdwp, dat->infobarData->hWnd, 0, 1, 0, w - 2, infobarInnerHeight - 2, SWP_NOZORDER);
hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_LOG), 0, 1, logY, w - 2, logH, SWP_NOZORDER);
hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_MESSAGE), 0, 1, h - hSplitterPos + SPLITTER_HEIGHT, messageEditWidth, hSplitterPos - SPLITTER_HEIGHT - 1, SWP_NOZORDER);
hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_AVATAR), 0, w - avatarWidth - 1, h - (avatarHeight + avatarWidth) / 2 - 1, avatarWidth, avatarWidth, SWP_NOZORDER);
diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp index 0ecbad553b..ec5c25b5e3 100644 --- a/plugins/Scriver/src/utils.cpp +++ b/plugins/Scriver/src/utils.cpp @@ -497,20 +497,25 @@ void SetToolTipRect(HWND hwndParent, HWND hwndTT, RECT* rect) HDWP ResizeToolbar(HWND hwnd, HDWP hdwp, int width, int vPos, int height, int cControls, const ToolbarButton * buttons, int controlVisibility)
{
+ HWND hCtrl;
int i;
int lPos = 0;
int rPos = width;
for (i = 0; i < cControls; i++) {
if (!buttons[i].alignment && (controlVisibility & (1 << i))) {
lPos += buttons[i].spacing;
- hdwp = DeferWindowPos(hdwp, GetDlgItem(hwnd, buttons[i].controlId), 0, lPos, vPos, buttons[i].width, height, SWP_NOZORDER);
+ hCtrl = GetDlgItem(hwnd, buttons[i].controlId);
+ if (NULL != hCtrl) /* Wine fix. */
+ hdwp = DeferWindowPos(hdwp, hCtrl, 0, lPos, vPos, buttons[i].width, height, SWP_NOZORDER);
lPos += buttons[i].width;
}
}
for (i = cControls - 1; i >= 0; i--) {
if (buttons[i].alignment && (controlVisibility & (1 << i))) {
rPos -= buttons[i].spacing + buttons[i].width;
- hdwp = DeferWindowPos(hdwp, GetDlgItem(hwnd, buttons[i].controlId), 0, rPos, vPos, buttons[i].width, height, SWP_NOZORDER);
+ hCtrl = GetDlgItem(hwnd, buttons[i].controlId);
+ if (NULL != hCtrl) /* Wine fix. */
+ hdwp = DeferWindowPos(hdwp, hCtrl, 0, rPos, vPos, buttons[i].width, height, SWP_NOZORDER);
}
}
return hdwp;
diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp index b14c59a970..2e6f647f8d 100644 --- a/plugins/SeenPlugin/src/history.cpp +++ b/plugins/SeenPlugin/src/history.cpp @@ -104,6 +104,8 @@ HDWP MyResizeWindow(HDWP hDwp, HWND hwndDlg, HWND hwndControl, POINT pt;
RECT rcinit;
+ if (NULL == hwndDlg) /* Wine fix. */
+ return hDwp;
// get current bounding rectangle
GetWindowRect(hwndControl, &rcinit);
@@ -130,6 +132,8 @@ HDWP MyHorizCenterWindow(HDWP hDwp, HWND hwndDlg, HWND hwndControl, POINT pt;
RECT rcinit;
+ if (NULL == hwndDlg) /* Wine fix. */
+ return hDwp;
// get current bounding rectangle
GetWindowRect(hwndControl, &rcinit);
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index 2ab2a65e7c..152e488718 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -561,11 +561,11 @@ BOOL TSAPI BB_SetButtonsPos(TWindowData *dat) bool showToolbar = !(dat->pContainer->dwFlags & CNT_HIDETOOLBAR); bool bBottomToolbar = (dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR) != 0; - HDWP hdwp = BeginDeferWindowPos(LButtonsList.getCount() + RButtonsList.getCount() + 1); - HWND hwndToggleSideBar = GetDlgItem(hwnd, dat->bType == SESSIONTYPE_IM ? IDC_TOGGLESIDEBAR : IDC_CHAT_TOGGLESIDEBAR); ShowWindow(hwndToggleSideBar, (showToolbar && dat->pContainer->SideBar->isActive()) ? SW_SHOW : SW_HIDE); + HDWP hdwp = BeginDeferWindowPos(LButtonsList.getCount() + RButtonsList.getCount() + 1); + mir_cslock lck(ToolBarCS); RECT rcSplitter; @@ -586,7 +586,8 @@ BOOL TSAPI BB_SetButtonsPos(TWindowData *dat) foravatar = dat->pic.cx + gap; if ((dat->pContainer->dwFlags & CNT_SIDEBAR) && (dat->pContainer->SideBar->getFlags() & CSideBar::SIDEBARORIENTATION_LEFT)) { - DeferWindowPos(hdwp, hwndToggleSideBar, NULL, 4, 2 + splitterY - iOff, 0, 0, SWP_NOZORDER | SWP_NOSIZE); + if (NULL != hwndToggleSideBar) /* Wine fix. */ + hdwp = DeferWindowPos(hdwp, hwndToggleSideBar, NULL, 4, 2 + splitterY - iOff, 0, 0, SWP_NOZORDER | SWP_NOSIZE); lwidth += 10; tempL -= 10; } @@ -598,7 +599,8 @@ BOOL TSAPI BB_SetButtonsPos(TWindowData *dat) if (!showToolbar) { ShowWindow(hwndBtn, SW_HIDE); - DeferWindowPos(hdwp, hwndBtn, NULL, lwidth, splitterY - iOff, 0, 0, SWP_NOZORDER | SWP_NOSIZE); + if (NULL != hwndBtn) /* Wine fix. */ + hdwp = DeferWindowPos(hdwp, hwndBtn, NULL, lwidth, splitterY - iOff, 0, 0, SWP_NOZORDER | SWP_NOSIZE); if (IsWindowVisible(hwndBtn) || (cbd->bSeparator && !(cbd->bAutoHidden || cbd->bHidden))) lwidth += cbd->iButtonWidth + gap; if (!IsWindowEnabled(hwndBtn) && !IsWindowVisible(hwndBtn) && !cbd->bAutoHidden) @@ -624,14 +626,16 @@ BOOL TSAPI BB_SetButtonsPos(TWindowData *dat) cbd->bAutoHidden = 0; } } - DeferWindowPos(hdwp, hwndBtn, NULL, lwidth, splitterY - iOff, 0, 0, SWP_NOZORDER | SWP_NOSIZE);// SWP_NOCOPYBITS); + if (NULL != hwndBtn) /* Wine fix. */ + hdwp = DeferWindowPos(hdwp, hwndBtn, NULL, lwidth, splitterY - iOff, 0, 0, SWP_NOZORDER | SWP_NOSIZE);// SWP_NOCOPYBITS); if (IsWindowVisible(hwndBtn) || (cbd->bSeparator && !(cbd->bAutoHidden || cbd->bHidden))) lwidth += cbd->iButtonWidth + gap; } } if ((dat->pContainer->dwFlags & CNT_SIDEBAR) && (dat->pContainer->SideBar->getFlags() & CSideBar::SIDEBARORIENTATION_RIGHT)) { - DeferWindowPos(hdwp, hwndToggleSideBar, NULL, rect.right - foravatar - 10, 2 + splitterY - iOff, 0, 0, SWP_NOZORDER | SWP_NOSIZE); + if (NULL != hwndToggleSideBar) /* Wine fix. */ + hdwp = DeferWindowPos(hdwp, hwndToggleSideBar, NULL, rect.right - foravatar - 10, 2 + splitterY - iOff, 0, 0, SWP_NOZORDER | SWP_NOSIZE); rwidth += 12; tempR -= 12; } @@ -645,7 +649,8 @@ BOOL TSAPI BB_SetButtonsPos(TWindowData *dat) ShowWindow(hwndBtn, SW_HIDE); if (IsWindowVisible(hwndBtn) || (cbd->bSeparator && !(cbd->bAutoHidden || cbd->bHidden))) rwidth += cbd->iButtonWidth + gap; - DeferWindowPos(hdwp, hwndBtn, NULL, rect.right - foravatar - rwidth + gap, splitterY - iOff, 0, 0, SWP_NOZORDER | SWP_NOSIZE); + if (NULL != hwndBtn) /* Wine fix. */ + hdwp = DeferWindowPos(hdwp, hwndBtn, NULL, rect.right - foravatar - rwidth + gap, splitterY - iOff, 0, 0, SWP_NOZORDER | SWP_NOSIZE); if (!IsWindowEnabled(hwndBtn) && !IsWindowVisible(hwndBtn) && !cbd->bAutoHidden) cbd->bAutoHidden = 1; continue; @@ -672,10 +677,10 @@ BOOL TSAPI BB_SetButtonsPos(TWindowData *dat) if (IsWindowVisible(hwndBtn) || (cbd->bSeparator && !(cbd->bAutoHidden || cbd->bHidden))) rwidth += cbd->iButtonWidth + gap; - DeferWindowPos(hdwp, hwndBtn, NULL, rect.right - foravatar - rwidth + gap, splitterY - iOff, 0, 0, SWP_NOZORDER | SWP_NOSIZE); + if (NULL != hwndBtn) /* Wine fix. */ + hdwp = DeferWindowPos(hdwp, hwndBtn, NULL, rect.right - foravatar - rwidth + gap, splitterY - iOff, 0, 0, SWP_NOZORDER | SWP_NOSIZE); } } - return EndDeferWindowPos(hdwp); } diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index 7781f59342..d15d5ca7bf 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -243,11 +243,11 @@ static void Chat_UpdateWindowState(TWindowData *dat, UINT msg) dat->wParam = dat->lParam = 0; } } + BB_SetButtonsPos(dat); if (M.isAero()) InvalidateRect(hwndTab, NULL, FALSE); if (dat->pContainer->dwFlags & CNT_SIDEBAR) dat->pContainer->SideBar->setActiveItem(dat); - BB_SetButtonsPos(dat); if (dat->pWnd) dat->pWnd->Invalidate(); @@ -1811,9 +1811,6 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_SETOLECALLBACK, 0, (LPARAM)&reOleCallback); - BB_InitDlgButtons(dat); - DM_InitTip(dat); - SendDlgItemMessage(hwndDlg, IDC_COLOR, BUTTONSETASPUSHBTN, TRUE, 0); mir_subclassWindow(GetDlgItem(hwndDlg, IDC_SPLITTERX), SplitterSubclassProc); @@ -1845,17 +1842,21 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar DM_ThemeChanged(dat); SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_HIDESELECTION, TRUE, 0); - CustomizeButton(CreateWindowEx(0, _T("MButtonClass"), _T(""), WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 0, 6, DPISCALEY_S(20), - hwndDlg, (HMENU)IDC_CHAT_TOGGLESIDEBAR, g_hInst, NULL)); - GetMYUIN(dat); GetMyNick(dat); + + CustomizeButton(CreateWindowEx(0, _T("MButtonClass"), _T(""), WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 0, 6, DPISCALEY_S(20), + hwndDlg, (HMENU)IDC_CHAT_TOGGLESIDEBAR, g_hInst, NULL)); SendDlgItemMessage(hwndDlg, IDC_CHAT_TOGGLESIDEBAR, BUTTONSETASTHEMEDBTN, 1, 0); SendDlgItemMessage(hwndDlg, IDC_CHAT_TOGGLESIDEBAR, BUTTONSETCONTAINER, (LPARAM)dat->pContainer, 0); SendDlgItemMessage(hwndDlg, IDC_CHAT_TOGGLESIDEBAR, BUTTONSETASFLATBTN, FALSE, 0); SendDlgItemMessage(hwndDlg, IDC_CHAT_TOGGLESIDEBAR, BUTTONSETASTOOLBARBUTTON, TRUE, 0); SendDlgItemMessage(hwndDlg, IDC_CHAT_TOGGLESIDEBAR, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Expand or collapse the side bar"), BATF_TCHAR); + DM_InitTip(dat); + BB_InitDlgButtons(dat); + SendMessage(hwndDlg, DM_LOADBUTTONBARICONS, 0, 0); + dat->hwndIEView = dat->hwndHPP = 0; SendMessage(hwndDlg, GC_SETWNDPROPS, 0, 0); @@ -1867,7 +1868,6 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar ShowWindow(hwndDlg, SW_SHOW); PostMessage(hwndDlg, GC_UPDATENICKLIST, 0, 0); dat->pContainer->hwndActive = hwndDlg; - BB_SetButtonsPos(dat); TABSRMM_FireEvent(dat->hContact, hwndDlg, MSG_WINDOW_EVT_OPEN, 0); } break; @@ -2037,6 +2037,9 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (!IsIconic(hwndDlg)) { int panelHeight = dat->Panel->getHeight() + 1; + GetClientRect(hwndDlg, &rc); + int cx = rc.right; + UTILRESIZEDIALOG urd = { sizeof(urd) }; urd.hInstance = g_hInst; urd.hwndDlg = hwndDlg; @@ -2047,9 +2050,6 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar BB_SetButtonsPos(dat); - GetClientRect(hwndDlg, &rc); - int cx = rc.right; - rc.left = panelHeight <= CInfoPanel::LEFT_OFFSET_LOGO ? panelHeight : CInfoPanel::LEFT_OFFSET_LOGO; rc.right = cx; rc.top = 1; @@ -3424,7 +3424,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar BB_InitDlgButtons(dat); BB_SetButtonsPos(dat); - break; + return 0; case DM_CBDESTROY: if (lParam) diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp index 01cf0661bc..8ddd0c7f92 100644 --- a/plugins/TabSRMM/src/sidebar.cpp +++ b/plugins/TabSRMM/src/sidebar.cpp @@ -752,14 +752,14 @@ void CSideBar::Layout(const RECT *rc, bool fOnlyCalc) if (p.isTopAligned()) {
if (m_totalItemHeight <= m_firstVisibleOffset) { // partially visible
- if (!fOnlyCalc)
+ if (!fOnlyCalc && NULL != hwnd) /* Wine fix. */
hdwp = ::DeferWindowPos(hdwp, hwnd, 0, 2, -(m_firstVisibleOffset - m_totalItemHeight),
m_elementWidth, height, SWP_SHOWWINDOW | dwFlags);
spaceUsed += ((height + 1) - (m_firstVisibleOffset - m_totalItemHeight));
m_totalItemHeight += (height + 1);
}
else {
- if (!fOnlyCalc)
+ if (!fOnlyCalc && NULL != hwnd) /* Wine fix. */
hdwp = ::DeferWindowPos(hdwp, hwnd, 0, 2, spaceUsed, m_elementWidth, height, SWP_SHOWWINDOW | dwFlags);
spaceUsed += (height + 1);
m_totalItemHeight += (height + 1);
diff --git a/plugins/TopToolBar/src/toolbar.cpp b/plugins/TopToolBar/src/toolbar.cpp index 4a8ff9f7fd..a7d88e3d0e 100644 --- a/plugins/TopToolBar/src/toolbar.cpp +++ b/plugins/TopToolBar/src/toolbar.cpp @@ -261,14 +261,16 @@ int ArrangeButtons() g_ctrl->bOrderChanged = TRUE;
if (b->isVisible()) {
- hdwp = DeferWindowPos(hdwp, b->hwnd, NULL, nextX, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW);
+ if (NULL != b->hwnd) /* Wine fix. */
+ hdwp = DeferWindowPos(hdwp, b->hwnd, NULL, nextX, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW);
if (b->isSep())
nextX += SEPWIDTH + 2;
else
nextX += g_ctrl->nButtonWidth + g_ctrl->nButtonSpace;
+ } else {
+ if (NULL != Buttons[i]->hwnd) /* Wine fix. */
+ hdwp = DeferWindowPos(hdwp, Buttons[i]->hwnd, NULL, nextX, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_HIDEWINDOW);
}
- else
- hdwp = DeferWindowPos(hdwp, Buttons[i]->hwnd, NULL, nextX, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_HIDEWINDOW);
}
if (iFirstButtonId == iLastButtonId)
@@ -281,8 +283,10 @@ int ArrangeButtons() break;
} while (iFirstButtonId < Buttons.getCount() && y >= 0 && (g_ctrl->bAutoSize || (y + g_ctrl->nButtonHeight <= rcClient.bottom - rcClient.top)));
- for (i = iLastButtonId; i < Buttons.getCount(); i++)
- hdwp = DeferWindowPos(hdwp, Buttons[i]->hwnd, NULL, nextX, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_HIDEWINDOW);
+ for (i = iLastButtonId; i < Buttons.getCount(); i++) {
+ if (NULL != Buttons[i]->hwnd) /* Wine fix. */
+ hdwp = DeferWindowPos(hdwp, Buttons[i]->hwnd, NULL, nextX, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_HIDEWINDOW);
+ }
if (hdwp)
EndDeferWindowPos(hdwp);
diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index f7632f0d6a..7a487842db 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -203,17 +203,19 @@ class CAnnivList {
if (!(_wndPos->flags & SWP_NOSIZE)) {
HWND hCtrl = GetDlgItem(_wndPos->hwnd, idCtrl);
- RECT rcc = _CalcPos(hCtrl, anchors);
- _hdWnds = DeferWindowPos(
- _hdWnds, //HDWP hWinPosInfo
- hCtrl, //HWND hWnd
- HWND_NOTOPMOST, //hWndInsertAfter
- rcc.left, //int x
- rcc.top, //int y
- rcc.right - rcc.left,
- rcc.bottom - rcc.top,
- SWP_NOZORDER //UINT uFlags
- );
+ if (NULL != hCtrl) { /* Wine fix. */
+ RECT rcc = _CalcPos(hCtrl, anchors);
+ _hdWnds = DeferWindowPos(
+ _hdWnds, //HDWP hWinPosInfo
+ hCtrl, //HWND hWnd
+ HWND_NOTOPMOST, //hWndInsertAfter
+ rcc.left, //int x
+ rcc.top, //int y
+ rcc.right - rcc.left,
+ rcc.bottom - rcc.top,
+ SWP_NOZORDER //UINT uFlags
+ );
+ }
}
}
};
diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp index f8b0c66fa6..85752f8fb5 100644 --- a/plugins/WhenWasIt/src/dlg_handlers.cpp +++ b/plugins/WhenWasIt/src/dlg_handlers.cpp @@ -509,6 +509,8 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l void AddAnchorWindowToDeferList(HDWP &hdWnds, HWND window, RECT *rParent, WINDOWPOS *wndPos, int anchors)
{
+ if (NULL == window) /* Wine fix. */
+ return;
RECT rChild = AnchorCalcPos(window, rParent, wndPos, anchors);
hdWnds = DeferWindowPos(hdWnds, window, HWND_NOTOPMOST, rChild.left, rChild.top, rChild.right - rChild.left, rChild.bottom - rChild.top, SWP_NOZORDER);
}
diff --git a/plugins/YAPP/src/yapp_history_dlg.cpp b/plugins/YAPP/src/yapp_history_dlg.cpp index 00cda4723c..5b3b8d7bf9 100644 --- a/plugins/YAPP/src/yapp_history_dlg.cpp +++ b/plugins/YAPP/src/yapp_history_dlg.cpp @@ -103,6 +103,8 @@ void AnchorMoveWindow(HWND window, const WINDOWPOS *parentPos, int anchors) void AddAnchorWindowToDeferList(HDWP &hdWnds, HWND window, RECT *rParent, WINDOWPOS *wndPos, int anchors)
{
+ if (NULL == window) /* Wine fix. */
+ return;
RECT rChild = AnchorCalcPos(window, rParent, wndPos, anchors);
hdWnds = DeferWindowPos(hdWnds, window, HWND_NOTOPMOST, rChild.left, rChild.top, rChild.right - rChild.left, rChild.bottom - rChild.top, SWP_NOZORDER);
}
diff --git a/src/core/stdfile/src/ftmanager.cpp b/src/core/stdfile/src/ftmanager.cpp index a361dd7a30..139ffbffbd 100644 --- a/src/core/stdfile/src/ftmanager.cpp +++ b/src/core/stdfile/src/ftmanager.cpp @@ -78,7 +78,8 @@ static void LayoutTransfers(HWND hwnd, struct TFtPageData *dat) top -= dat->scrollPos;
for (int i = 0; i < dat->wnds->realCount; ++i) {
int height = dat->wnds->items[i]->rc.bottom - dat->wnds->items[i]->rc.top;
- hdwp = DeferWindowPos(hdwp, dat->wnds->items[i]->hwnd, NULL, 0, top, rc.right, height, SWP_NOZORDER);
+ if (NULL != dat->wnds->items[i]->hwnd) /* Wine fix. */
+ hdwp = DeferWindowPos(hdwp, dat->wnds->items[i]->hwnd, NULL, 0, top, rc.right, height, SWP_NOZORDER);
top += height;
}
top += dat->scrollPos;
@@ -313,7 +314,8 @@ static INT_PTR CALLBACK FtMgrDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM rc.bottom -= rcButton.bottom + 5;
- hdwp = DeferWindowPos(hdwp, hwndTab, NULL, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, SWP_NOZORDER);
+ if (NULL != hwndTab) /* Wine fix. */
+ hdwp = DeferWindowPos(hdwp, hwndTab, NULL, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, SWP_NOZORDER);
EndDeferWindowPos(hdwp);
@@ -324,8 +326,10 @@ static INT_PTR CALLBACK FtMgrDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM hdwp = BeginDeferWindowPos(2);
- hdwp = DeferWindowPos(hdwp, dat->hwndIncoming, HWND_TOP, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, 0);
- hdwp = DeferWindowPos(hdwp, dat->hwndOutgoing, HWND_TOP, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, 0);
+ if (NULL != dat->hwndIncoming) /* Wine fix. */
+ hdwp = DeferWindowPos(hdwp, dat->hwndIncoming, HWND_TOP, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, 0);
+ if (NULL != dat->hwndOutgoing) /* Wine fix. */
+ hdwp = DeferWindowPos(hdwp, dat->hwndOutgoing, HWND_TOP, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, 0);
EndDeferWindowPos(hdwp);
diff --git a/src/modules/utils/resizer.cpp b/src/modules/utils/resizer.cpp index 7958664688..17f9e5bd34 100644 --- a/src/modules/utils/resizer.cpp +++ b/src/modules/utils/resizer.cpp @@ -149,7 +149,9 @@ INT_PTR ResizeDialog(WPARAM, LPARAM lParam) urc.rcItem.top+=(urc.dlgNewSize.cy-urc.dlgOriginalSize.cy)/2;
urc.rcItem.bottom+=(urc.dlgNewSize.cy-urc.dlgOriginalSize.cy)/2;
}
- hDwp = DeferWindowPos(hDwp, GetDlgItem(urd->hwndDlg, extendedDlg?pItemEx->id:pItem->id), 0, urc.rcItem.left, urc.rcItem.top, urc.rcItem.right-urc.rcItem.left, urc.rcItem.bottom-urc.rcItem.top, SWP_NOZORDER);
+ HWND hCtrl = GetDlgItem(urd->hwndDlg, extendedDlg ? pItemEx->id : pItem->id);
+ if (NULL != hCtrl) /* Wine fix. */
+ hDwp = DeferWindowPos(hDwp, hCtrl, 0, urc.rcItem.left, urc.rcItem.top, urc.rcItem.right-urc.rcItem.left, urc.rcItem.bottom-urc.rcItem.top, SWP_NOZORDER);
}
EndDeferWindowPos(hDwp);
return 0;
|