changeset 34325:fc74085e2487

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.
author ib
date Thu, 08 Dec 2011 19:41:28 +0000
parents 58aaa0d8cc82
children d188b59d3fa4
files gui/win32/gui.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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 */