# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1340672085 0 # Node ID 3bbbb5a55cf80a2a690aafaccecc2c4b49a54a10 # Parent e113f9e46fbd068c95f41cb0b1222206297e1729 Fix buttons causing double events when toolbar support is enabled on Windows. diff -r e113f9e46fbd -r 3bbbb5a55cf8 win/dw.c --- a/win/dw.c Sat Jun 23 21:54:35 2012 +0000 +++ b/win/dw.c Tue Jun 26 00:54:45 2012 +0000 @@ -2189,8 +2189,16 @@ #ifdef TOOLBAR else if (message == BN_CLICKED && tmp->message == WM_COMMAND && tmp->window == (HWND)mp2) { - result = clickfunc(tmp->window, tmp->data); - tmp = NULL; + TCHAR tmpbuf[100] = {0}; + + GetClassName((HWND)mp2, tmpbuf, 99); + + /* Make sure this isn't a button, because it will have already been handled */ + if (_tcsnicmp(tmpbuf, BUTTONCLASSNAME, _tcslen(BUTTONCLASSNAME)+1) != 0) + { + result = clickfunc(tmp->window, tmp->data); + tmp = NULL; + } } #endif else if (tmp->id && passthru == tmp->id)