Fixed compilation of qfiledialog_win.cpp

Change-Id: I2c84d8f55df5a35b1cc335fdb59a27f2d3d3bad6
Reviewed-on: http://codereview.qt.nokia.com/2962
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
bb10
Olli Werwolff 2011-07-12 14:44:50 +02:00 committed by Oliver Wolff
parent d34b0eb633
commit 48e525efac
1 changed files with 14 additions and 1 deletions

View File

@ -243,7 +243,20 @@ static void qt_win_clean_up_OFN(OPENFILENAME **ofn)
*ofn = 0;
}
extern void qt_win_eatMouseMove();
void qt_win_eatMouseMove()
{
// after closing a windows dialog with a double click (i.e. open a file)
// the message queue still contains a dubious WM_MOUSEMOVE message where
// the left button is reported to be down (wParam != 0).
// remove all those messages (usually 1) and post the last one with a
// reset button state
MSG msg = {0, 0, 0, 0, 0, {0, 0} };
while (PeekMessage(&msg, 0, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE))
;
if (msg.message == WM_MOUSEMOVE)
PostMessage(msg.hwnd, msg.message, 0, msg.lParam);
}
QString qt_win_get_open_file_name(const QFileDialogArgs &args,
QString *initialDirectory,