diff options
| author | Glenn Rice <glennricster@gmail.com> | 2011-02-01 04:35:25 +0000 |
|---|---|---|
| committer | Glenn Rice <glennricster@gmail.com> | 2011-02-01 04:35:25 +0000 |
| commit | 0d426e3972731684fd194354fd8a41aef18d8363 (patch) | |
| tree | df281d5ef855daca8c6cb8d8d4f1cbfb12234ebf /Source/Core | |
| parent | 53ae9e9e8fdb932e4f89aa3d6727e0d8231ffc5c (diff) | |
Fix the auto window resize option to take into account if the log/console window is open.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7031 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/DolphinWX/Src/Frame.cpp | 36 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/Globals.h | 1 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/Main.cpp | 4 |
3 files changed, 34 insertions, 7 deletions
diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index cdb5d8cc4e..2127027657 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -656,6 +656,14 @@ void CFrame::OnHostMessage(wxCommandEvent& event) m_RenderParent->SetCursor(wxCURSOR_BLANK); break; + case IDM_WINDOWSIZEREQUEST: + { + std::pair<int, int> *win_size = (std::pair<int, int> *)(event.GetClientData()); + OnRenderWindowSizeRequest(win_size->first, win_size->second); + delete win_size; + } + break; + #ifdef __WXGTK__ case IDM_PANIC: bPanicResult = (wxYES == wxMessageBox(event.GetString(), @@ -684,18 +692,34 @@ void CFrame::GetRenderWindowSize(int& x, int& y, int& width, int& height) void CFrame::OnRenderWindowSizeRequest(int width, int height) { - if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderWindowAutoSize || + if (Core::GetState() == Core::CORE_UNINITIALIZED || + !SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain || + !SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderWindowAutoSize || RendererIsFullscreen() || m_RenderFrame->IsMaximized()) return; - int old_width, old_height; + int old_width, old_height, log_width = 0, log_height = 0; m_RenderFrame->GetClientSize(&old_width, &old_height); - if (old_width != width || old_height != height) + + // Add space for the log/console/debugger window + if ((SConfig::GetInstance().m_InterfaceLogWindow || SConfig::GetInstance().m_InterfaceConsole) && + !m_Mgr->GetPane(wxT("Pane 1")).IsFloating()) { - wxMutexGuiEnter(); - m_RenderFrame->SetClientSize(width, height); - wxMutexGuiLeave(); + switch (m_Mgr->GetPane(wxT("Pane 1")).dock_direction) + { + case wxAUI_DOCK_LEFT: + case wxAUI_DOCK_RIGHT: + log_width = m_Mgr->GetPane(wxT("Pane 1")).rect.GetWidth(); + break; + case wxAUI_DOCK_TOP: + case wxAUI_DOCK_BOTTOM: + log_height = m_Mgr->GetPane(wxT("Pane 1")).rect.GetHeight(); + break; + } } + + if (old_width != width + log_width || old_height != height + log_height) + m_RenderFrame->SetClientSize(width + log_width, height + log_height); } bool CFrame::RendererHasFocus() diff --git a/Source/Core/DolphinWX/Src/Globals.h b/Source/Core/DolphinWX/Src/Globals.h index 79e723acc2..b2da9eff88 100644 --- a/Source/Core/DolphinWX/Src/Globals.h +++ b/Source/Core/DolphinWX/Src/Globals.h @@ -239,6 +239,7 @@ enum IDM_UPDATEBREAKPOINTS, IDM_PANIC, IDM_KEYSTATE, + IDM_WINDOWSIZEREQUEST, IDM_HOST_MESSAGE, IDM_MPANEL, ID_STATUSBAR, diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index 193c51729d..b0211226bb 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -587,7 +587,9 @@ void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height) void Host_RequestRenderWindowSize(int width, int height) { - main_frame->OnRenderWindowSizeRequest(width, height); + wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_WINDOWSIZEREQUEST); + event.SetClientData(new std::pair<int, int>(width, height)); + main_frame->GetEventHandler()->AddPendingEvent(event); } void Host_SetWaitCursor(bool enable) |
