diff options
author | Olli Werwolff <qt-info@nokia.com> | 2011-07-12 14:44:50 +0200 |
---|---|---|
committer | Oliver Wolff <oliver.wolff@nokia.com> | 2011-08-15 14:45:02 +0200 |
commit | 48e525efacd518e1372a18662c06f737a84fa0c1 (patch) | |
tree | 71bea5da66fb4d734fd8ecd0ea631bd72615697f /src | |
parent | d34b0eb633d142fc58f4aaf93afef6516acb9314 (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/dialogs/qfiledialog_win.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/widgets/dialogs/qfiledialog_win.cpp b/src/widgets/dialogs/qfiledialog_win.cpp index cdf8cd39cf..8c3b3cfda7 100644 --- a/src/widgets/dialogs/qfiledialog_win.cpp +++ b/src/widgets/dialogs/qfiledialog_win.cpp @@ -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, |