gui: Fix Console close behaviour

When the Console is closed (except through Misc -> Show Console), PCSX2
does not remember that you closed the Console and will reopen it the next
time. You also have to press Show Console twice if you want to reopen
the Console after closing it.

This is caused by the Console looking for its "parent" main emulator
window, when secretly, they're siblings :)

Make the console properly register when it is closed.
This commit is contained in:
Jonathan Li 2015-06-26 02:04:39 +01:00
parent 59a66f87c3
commit 0b42db11bd
1 changed files with 3 additions and 4 deletions

View File

@ -764,10 +764,9 @@ void ConsoleLogFrame::OnCloseWindow(wxCloseEvent& event)
// instead of closing just hide the window to be able to Show() it later
Show( false );
// Can't do this via a Connect() on the MainFrame because Close events are not commands,
// and thus do not propagate up/down the event chain.
if( wxWindow* main = GetParent() )
wxStaticCast( main, MainEmuFrame )->OnLogBoxHidden();
// In the nogui case there might not be a Main frame window.
if (MainEmuFrame* mainframe = GetMainFramePtr())
mainframe->OnLogBoxHidden();
}
else
{