summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2015-03-24 00:55:09 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2015-03-24 00:55:09 +0000
commitb2e1ec3eb79227ccea43e270d5ed1917cc0dcc53 (patch)
treedaf3cd3ef42ada29a532713b53dff6c44b76e1ca /plugins/TabSRMM
parentceb5a959c77bbfdb5f5054d6d694032aa323f674 (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
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r--plugins/TabSRMM/src/buttonsbar.cpp23
-rw-r--r--plugins/TabSRMM/src/chat/window.cpp24
-rw-r--r--plugins/TabSRMM/src/sidebar.cpp4
3 files changed, 28 insertions, 23 deletions
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);