From b2e1ec3eb79227ccea43e270d5ed1917cc0dcc53 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Tue, 24 Mar 2015 00:55:09 +0000 Subject: * 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 --- plugins/TopToolBar/src/toolbar.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'plugins/TopToolBar/src/toolbar.cpp') 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); -- cgit v1.2.3