Fix auto window size options when not rendering to main.
Switch gtk keystate_lock back to a recursive mutex. Now that the mutex attributes are being initialized properly this doesn't seem to cause the segmentation faults anymore. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7349 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
f43a8844a2
commit
27142fafe0
|
@ -684,7 +684,6 @@ void CFrame::GetRenderWindowSize(int& x, int& y, int& width, int& height)
|
||||||
void CFrame::OnRenderWindowSizeRequest(int width, int height)
|
void CFrame::OnRenderWindowSizeRequest(int width, int height)
|
||||||
{
|
{
|
||||||
if (Core::GetState() == Core::CORE_UNINITIALIZED ||
|
if (Core::GetState() == Core::CORE_UNINITIALIZED ||
|
||||||
!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain ||
|
|
||||||
!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderWindowAutoSize ||
|
!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderWindowAutoSize ||
|
||||||
RendererIsFullscreen() || m_RenderFrame->IsMaximized())
|
RendererIsFullscreen() || m_RenderFrame->IsMaximized())
|
||||||
return;
|
return;
|
||||||
|
@ -693,8 +692,10 @@ void CFrame::OnRenderWindowSizeRequest(int width, int height)
|
||||||
m_RenderFrame->GetClientSize(&old_width, &old_height);
|
m_RenderFrame->GetClientSize(&old_width, &old_height);
|
||||||
|
|
||||||
// Add space for the log/console/debugger window
|
// Add space for the log/console/debugger window
|
||||||
if ((SConfig::GetInstance().m_InterfaceLogWindow || SConfig::GetInstance().m_InterfaceConsole ||
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain &&
|
||||||
SConfig::GetInstance().m_InterfaceLogConfigWindow) &&
|
(SConfig::GetInstance().m_InterfaceLogWindow ||
|
||||||
|
SConfig::GetInstance().m_InterfaceConsole ||
|
||||||
|
SConfig::GetInstance().m_InterfaceLogConfigWindow) &&
|
||||||
!m_Mgr->GetPane(wxT("Pane 1")).IsFloating())
|
!m_Mgr->GetPane(wxT("Pane 1")).IsFloating())
|
||||||
{
|
{
|
||||||
switch (m_Mgr->GetPane(wxT("Pane 1")).dock_direction)
|
switch (m_Mgr->GetPane(wxT("Pane 1")).dock_direction)
|
||||||
|
|
|
@ -145,7 +145,7 @@ class CFrame : public CRenderFrame
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
Common::Event panic_event;
|
Common::Event panic_event;
|
||||||
bool bPanicResult;
|
bool bPanicResult;
|
||||||
std::mutex keystate_lock;
|
std::recursive_mutex keystate_lock;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_XRANDR) && HAVE_XRANDR
|
#if defined(HAVE_XRANDR) && HAVE_XRANDR
|
||||||
|
|
|
@ -1023,7 +1023,7 @@ void CFrame::DoStop()
|
||||||
{
|
{
|
||||||
#if defined __WXGTK__
|
#if defined __WXGTK__
|
||||||
wxMutexGuiLeave();
|
wxMutexGuiLeave();
|
||||||
std::lock_guard<std::mutex> lk(keystate_lock);
|
std::lock_guard<std::recursive_mutex> lk(keystate_lock);
|
||||||
wxMutexGuiEnter();
|
wxMutexGuiEnter();
|
||||||
#endif
|
#endif
|
||||||
// Ask for confirmation in case the user accidentally clicked Stop / Escape
|
// Ask for confirmation in case the user accidentally clicked Stop / Escape
|
||||||
|
|
|
@ -584,8 +584,8 @@ bool Host_GetKeyState(int keycode)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
return GetAsyncKeyState(keycode);
|
return GetAsyncKeyState(keycode);
|
||||||
#elif defined __WXGTK__
|
#elif defined __WXGTK__
|
||||||
std::unique_lock<std::mutex> lk(main_frame->keystate_lock, std::defer_lock);
|
std::unique_lock<std::recursive_mutex> lk(main_frame->keystate_lock, std::try_to_lock);
|
||||||
if (!lk.try_lock())
|
if (!lk.owns_lock())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
bool key_pressed;
|
bool key_pressed;
|
||||||
|
|
Loading…
Reference in New Issue