From 40640217f17cc03c8f7195b52aaecb674f3507f3 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Wed, 2 May 2012 14:40:40 -0500 Subject: [PATCH] Fix hide mouse cursor on linux. Fix emulator window position when rendering to main on linux. Allow building against wxWidgets 2.9.3 on linux. --- CMakeLists.txt | 9 +++++++-- Source/Core/DolphinWX/Src/Frame.cpp | 12 ++++++++++-- Source/Core/DolphinWX/Src/FrameTools.cpp | 6 ++---- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba148a6762..9721bf54ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -489,8 +489,13 @@ if(NOT DISABLE_WX) ERROR_QUIET ) message("Found wxWidgets version ${wxWidgets_VERSION}") - if(${wxWidgets_VERSION} VERSION_LESS "2.9.4") - message("At least 2.9.4 is required; ignoring found version") + if(UNIX AND NOT APPLE) + set(wxMIN_VERSION "2.9.3") + else() + set(wxMIN_VERSION "2.9.4") + endif() + if(${wxWidgets_VERSION} VERSION_LESS ${wxMIN_VERSION}) + message("At least ${wxMIN_VERSION} is required; ignoring found version") unset(wxWidgets_FOUND) endif() endif(wxWidgets_FOUND) diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index f9f0cec412..93e0cf8f15 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -653,6 +653,11 @@ void CFrame::OnHostMessage(wxCommandEvent& event) break; #ifdef __WXGTK__ + case WM_USER_CREATE: + if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor) + m_RenderParent->SetCursor(wxCURSOR_BLANK); + break; + case IDM_PANIC: { wxString caption = event.GetString().BeforeFirst(':'); @@ -676,8 +681,11 @@ void CFrame::GetRenderWindowSize(int& x, int& y, int& width, int& height) if (!wxIsMainThread()) wxMutexGuiEnter(); #endif - m_RenderParent->GetClientSize(&width, &height); - m_RenderParent->GetPosition(&x, &y); + wxRect client_rect = m_RenderParent->GetClientRect(); + width = client_rect.width; + height = client_rect.height; + x = client_rect.x; + y = client_rect.y; #ifdef __WXGTK__ if (!wxIsMainThread()) wxMutexGuiLeave(); diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 99cb919da8..2791783aa1 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -826,11 +826,9 @@ void CFrame::OnRenderParentResize(wxSizeEvent& event) SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowHeight = height; } #if defined(HAVE_X11) && HAVE_X11 - int x, y; - m_RenderParent->GetClientSize(&width, &height); - m_RenderParent->GetPosition(&x, &y); + wxRect client_rect = m_RenderParent->GetClientRect(); X11Utils::SendClientEvent(X11Utils::XDisplayFromHandle(GetHandle()), - "RESIZE", x, y, width, height); + "RESIZE", client_rect.x, client_rect.y, client_rect.width, client_rect.height); #endif m_LogWindow->Refresh(); m_LogWindow->Update();