# HG changeset patch # User ib # Date 1323373288 0 # Node ID fc74085e24871c386f192894cf0f197638635c14 # Parent 58aaa0d8cc82756a44abc72832bd4e1159b276d6 Fix bug in Win32 GUI introduced in r34403. When selecting a file to open in the open dialog, the open dialog just reappears. handlemsg() passes unknown messages (such as evDropFile) to the gui's playercontrol function (guiSetEvent()). We cannot replace the handlemsg(hWnd, evDropFile) call by handlemsg(hWnd, evLoadPlay), because evLoadPlay is known in handlemsg() and has a different meaning there. So we directly call gui->playercontrol(evLoadPlay) instead where evDropFile and evLoadPlay have the same meaning. Reported by Stephen Sheldon, sfsheldo gmail com. diff -r 58aaa0d8cc82 -r fc74085e2487 gui/win32/gui.c --- a/gui/win32/gui.c Thu Dec 08 17:11:52 2011 +0000 +++ b/gui/win32/gui.c Thu Dec 08 19:41:28 2011 +0000 @@ -238,7 +238,7 @@ case evLoadPlay: case evLoad: if(display_openfilewindow(gui, 0) && (msg == evLoadPlay)) - handlemsg(hWnd, evLoadPlay); + gui->playercontrol(evLoadPlay); return; case evLoadSubtitle: display_opensubtitlewindow(gui); @@ -501,13 +501,13 @@ gui->playlist->add_track(gui->playlist, file, NULL, NULL, 0); } DragFinish((HDROP) wParam); - handlemsg(hWnd, evLoadPlay); + gui->playercontrol(evLoadPlay); } else { gui->playlist->clear_playlist(gui->playlist); gui->playlist->add_track(gui->playlist, (const char *) wParam, NULL, NULL, 0); - handlemsg(hWnd, evLoadPlay); + gui->playercontrol(evLoadPlay); } SetForegroundWindow(gui->subwindow); return 0; @@ -790,13 +790,13 @@ gui->playlist->add_track(gui->playlist, file, NULL, NULL, 0); } DragFinish((HDROP) wParam); - handlemsg(hWnd, evLoadPlay); + gui->playercontrol(evLoadPlay); } else { gui->playlist->clear_playlist(gui->playlist); gui->playlist->add_track(gui->playlist, (const char *) wParam, NULL, NULL, 0); - handlemsg(hWnd, evLoadPlay); + gui->playercontrol(evLoadPlay); } SetForegroundWindow(gui->mainwindow); return 0; @@ -1118,7 +1118,7 @@ static void startplay(gui_t *gui) { - handlemsg(gui->mainwindow, evLoadPlay); + gui->playercontrol(evLoadPlay); } /* returns the bits per pixel of the desktop */