GUI: Fixed some wxPostEvent endless loops

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4060 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson 2009-08-25 09:13:17 +00:00
parent cc323e4849
commit c1f091e4bc
5 changed files with 15 additions and 18 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Version="9,00"
Name="Common"
ProjectGUID="{C573CAF7-EE6A-458E-8049-16C0BF34C2E9}"
RootNamespace="Common"

View File

@ -101,6 +101,9 @@ BEGIN_EVENT_TABLE(CCodeWindow, wxPanel)
// Menu bar
EVT_MENU(IDM_INTERPRETER, CCodeWindow::OnCPUMode) // CPU Mode
EVT_MENU(IDM_AUTOMATICSTART, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_BOOTTOPAUSE, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITUNLIMITED, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITLSOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITLSLXZOFF, CCodeWindow::OnCPUMode)
@ -711,7 +714,6 @@ void CCodeWindow::OnCodeStep(wxCommandEvent& event)
case IDM_DEBUG_GO:
{
// [F|RES] prolly we should disable the other buttons in go mode too ...
if (CCPU::IsStepping())
{
CCPU::EnableStepping(false);

View File

@ -80,18 +80,7 @@ class CCodeWindow
private:
enum
{
// Toolbar
ID_TOOLBAR = 2000,
IDM_DEBUG_GO,
IDM_STEP,
IDM_STEPOVER,
IDM_SKIP,
IDM_SETPC,
IDM_GOTOPC,
IDM_ADDRBOX,
// ==============================================================
{
// Debugger GUI Objects
ID_CODEVIEW,
ID_CALLSTACKLIST,

View File

@ -548,9 +548,15 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
// Post events
void CFrame::PostEvent(wxCommandEvent& event)
{
// Don't post zero events, that may hang
if (g_pCodeWindow && event.GetId()) wxPostEvent(g_pCodeWindow, event);
{
// Restrict the post events to the minimum necessary, it seems like these events are
// somtimes posted to the parent wxFrame too so that it creates and endless loop
if (g_pCodeWindow
&& event.GetId() >= IDM_INTERPRETER && event.GetId() <= IDM_ADDRBOX
&& event.GetId() != IDM_JITUNLIMITED
)
wxPostEvent(g_pCodeWindow, event);
event.Skip();
}
void CFrame::PostMenuEvent(wxMenuEvent& event)
{

View File

@ -153,7 +153,7 @@ enum
// --------------------------------------------------------------
// Debugger Toolbar
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
ID_TOOLBAR2 = 2000,
ID_TOOLBAR2,
IDM_DEBUG_GO,
IDM_STEP,
IDM_STEPOVER,