summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorGlenn Rice <glennricster@gmail.com>2011-02-20 22:56:03 +0000
committerGlenn Rice <glennricster@gmail.com>2011-02-20 22:56:03 +0000
commit636af2ce673c2baa787b8ff582b5d5158973bd2c (patch)
treee6ee37e40ed2f3d15751dd9ffff7a1f4e5df75f0 /Source/Core
parentb90a85da49e2da54dd28e47f0a89319f07b54cbd (diff)
Fix the game list tooltips on linux in a better way. Also activated them on OSX, but they still don't work the best there.
Fix a hang on emulation shutdown on linux. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7215 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinWX/Src/Frame.cpp8
-rw-r--r--Source/Core/DolphinWX/Src/GameListCtrl.cpp40
2 files changed, 26 insertions, 22 deletions
diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp
index f5bc6aa98c..e7eb08ed3c 100644
--- a/Source/Core/DolphinWX/Src/Frame.cpp
+++ b/Source/Core/DolphinWX/Src/Frame.cpp
@@ -686,8 +686,16 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
void CFrame::GetRenderWindowSize(int& x, int& y, int& width, int& height)
{
+#ifdef __WXGTK__
+ if (!wxIsMainThread())
+ wxMutexGuiEnter();
+#endif
m_RenderParent->GetClientSize(&width, &height);
m_RenderParent->GetPosition(&x, &y);
+#ifdef __WXGTK__
+ if (!wxIsMainThread())
+ wxMutexGuiLeave();
+#endif
}
void CFrame::OnRenderWindowSizeRequest(int width, int height)
diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.cpp b/Source/Core/DolphinWX/Src/GameListCtrl.cpp
index 1e24c19c07..cdefed3e08 100644
--- a/Source/Core/DolphinWX/Src/GameListCtrl.cpp
+++ b/Source/Core/DolphinWX/Src/GameListCtrl.cpp
@@ -882,15 +882,20 @@ void CGameListCtrl::OnMouseMotion(wxMouseEvent& event)
if (item != wxNOT_FOUND)
{
-#ifndef __WXGTK__
- // The subitem parameter of HitTest is only implemented for wxMSW. On
- // all other platforms it will always be -1.
+ wxRect Rect;
+#ifdef __WXMSW__
if (subitem == COLUMN_EMULATION_STATE)
+#else
+ // The subitem parameter of HitTest is only implemented for wxMSW. On
+ // all other platforms it will always be -1. Check the x position
+ // instead.
+ GetItemRect(item, Rect);
+ if (Rect.GetX() + Rect.GetWidth() - GetColumnWidth(COLUMN_EMULATION_STATE) < event.GetX())
#endif
{
if (toolTip || lastItem == item || this != FindFocus())
{
- if (!toolTip) lastItem = -1;
+ if (lastItem != item) lastItem = -1;
event.Skip();
return;
}
@@ -927,34 +932,25 @@ void CGameListCtrl::OnMouseMotion(wxMouseEvent& event)
toolTip = new wxEmuStateTip(this, _("Not Set"), &toolTip);
// Get item Coords
- wxRect Rect;
GetItemRect(item, Rect);
-#ifdef _WIN32
int mx = Rect.GetWidth();
int my = Rect.GetY();
- ClientToScreen(&mx, &my);
- toolTip->SetBoundingRect(wxRect(mx - GetColumnWidth(subitem),
- my, GetColumnWidth(subitem), Rect.GetHeight()));
- toolTip->SetPosition(wxPoint(mx - GetColumnWidth(subitem),
- my - 5 + Rect.GetHeight()));
-#elif defined __WXGTK__
- // TODO: This works on OSX too, but something weird happens
- // when the mouse is over the header row.
- int x = Rect.GetX(), y = Rect.GetY(),
- w = Rect.GetWidth(), h = Rect.GetHeight();
+#ifndef __WXMSW__
// For some reason the y position does not account for the header
// row, so subtract the y position of the first visible item.
GetItemRect(GetTopItem(), Rect);
- y -= Rect.GetY();
- ClientToScreen(&x, &y);
- toolTip->SetBoundingRect(wxRect(x, y, w, h));
- toolTip->SetPosition(wxPoint(x + w, y + h / 2));
+ my -= Rect.GetY();
#endif
-
+ // Convert to screen coordinates
+ ClientToScreen(&mx, &my);
+ toolTip->SetBoundingRect(wxRect(mx - GetColumnWidth(COLUMN_EMULATION_STATE),
+ my, GetColumnWidth(COLUMN_EMULATION_STATE), Rect.GetHeight()));
+ toolTip->SetPosition(wxPoint(mx - GetColumnWidth(COLUMN_EMULATION_STATE),
+ my - 5 + Rect.GetHeight()));
lastItem = item;
}
}
- else
+ if (!toolTip)
lastItem = -1;
event.Skip();