comparison gui/win32/gui.c @ 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 daebf766dea6
children 960c785cb6ef
comparison
equal deleted inserted replaced
34324:58aaa0d8cc82 34325:fc74085e2487
236 switch(msg) 236 switch(msg)
237 { 237 {
238 case evLoadPlay: 238 case evLoadPlay:
239 case evLoad: 239 case evLoad:
240 if(display_openfilewindow(gui, 0) && (msg == evLoadPlay)) 240 if(display_openfilewindow(gui, 0) && (msg == evLoadPlay))
241 handlemsg(hWnd, evLoadPlay); 241 gui->playercontrol(evLoadPlay);
242 return; 242 return;
243 case evLoadSubtitle: 243 case evLoadSubtitle:
244 display_opensubtitlewindow(gui); 244 display_opensubtitlewindow(gui);
245 break; 245 break;
246 case evPreferences: 246 case evPreferences:
499 uiSetFileName(NULL, file, STREAMTYPE_FILE); 499 uiSetFileName(NULL, file, STREAMTYPE_FILE);
500 if(!parse_filename(file, playtree, mconfig, 1)) 500 if(!parse_filename(file, playtree, mconfig, 1))
501 gui->playlist->add_track(gui->playlist, file, NULL, NULL, 0); 501 gui->playlist->add_track(gui->playlist, file, NULL, NULL, 0);
502 } 502 }
503 DragFinish((HDROP) wParam); 503 DragFinish((HDROP) wParam);
504 handlemsg(hWnd, evLoadPlay); 504 gui->playercontrol(evLoadPlay);
505 } 505 }
506 else 506 else
507 { 507 {
508 gui->playlist->clear_playlist(gui->playlist); 508 gui->playlist->clear_playlist(gui->playlist);
509 gui->playlist->add_track(gui->playlist, (const char *) wParam, NULL, NULL, 0); 509 gui->playlist->add_track(gui->playlist, (const char *) wParam, NULL, NULL, 0);
510 handlemsg(hWnd, evLoadPlay); 510 gui->playercontrol(evLoadPlay);
511 } 511 }
512 SetForegroundWindow(gui->subwindow); 512 SetForegroundWindow(gui->subwindow);
513 return 0; 513 return 0;
514 } 514 }
515 case WM_LBUTTONDOWN: 515 case WM_LBUTTONDOWN:
788 uiSetFileName(NULL, file, STREAMTYPE_FILE); 788 uiSetFileName(NULL, file, STREAMTYPE_FILE);
789 if(!parse_filename(file, playtree, mconfig, 1)) 789 if(!parse_filename(file, playtree, mconfig, 1))
790 gui->playlist->add_track(gui->playlist, file, NULL, NULL, 0); 790 gui->playlist->add_track(gui->playlist, file, NULL, NULL, 0);
791 } 791 }
792 DragFinish((HDROP) wParam); 792 DragFinish((HDROP) wParam);
793 handlemsg(hWnd, evLoadPlay); 793 gui->playercontrol(evLoadPlay);
794 } 794 }
795 else 795 else
796 { 796 {
797 gui->playlist->clear_playlist(gui->playlist); 797 gui->playlist->clear_playlist(gui->playlist);
798 gui->playlist->add_track(gui->playlist, (const char *) wParam, NULL, NULL, 0); 798 gui->playlist->add_track(gui->playlist, (const char *) wParam, NULL, NULL, 0);
799 handlemsg(hWnd, evLoadPlay); 799 gui->playercontrol(evLoadPlay);
800 } 800 }
801 SetForegroundWindow(gui->mainwindow); 801 SetForegroundWindow(gui->mainwindow);
802 return 0; 802 return 0;
803 } 803 }
804 case WM_LBUTTONDOWN: 804 case WM_LBUTTONDOWN:
1116 return DefWindowProc(hWnd, message, wParam, lParam); 1116 return DefWindowProc(hWnd, message, wParam, lParam);
1117 } 1117 }
1118 1118
1119 static void startplay(gui_t *gui) 1119 static void startplay(gui_t *gui)
1120 { 1120 {
1121 handlemsg(gui->mainwindow, evLoadPlay); 1121 gui->playercontrol(evLoadPlay);
1122 } 1122 }
1123 1123
1124 /* returns the bits per pixel of the desktop */ 1124 /* returns the bits per pixel of the desktop */
1125 /* the format is always in BGR byte order */ 1125 /* the format is always in BGR byte order */
1126 static int GetDesktopBitsPerPixel(void) 1126 static int GetDesktopBitsPerPixel(void)