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
This commit is contained in:
parent
b90a85da49
commit
636af2ce67
|
@ -686,8 +686,16 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
|
||||||
|
|
||||||
void CFrame::GetRenderWindowSize(int& x, int& y, int& width, int& height)
|
void CFrame::GetRenderWindowSize(int& x, int& y, int& width, int& height)
|
||||||
{
|
{
|
||||||
|
#ifdef __WXGTK__
|
||||||
|
if (!wxIsMainThread())
|
||||||
|
wxMutexGuiEnter();
|
||||||
|
#endif
|
||||||
m_RenderParent->GetClientSize(&width, &height);
|
m_RenderParent->GetClientSize(&width, &height);
|
||||||
m_RenderParent->GetPosition(&x, &y);
|
m_RenderParent->GetPosition(&x, &y);
|
||||||
|
#ifdef __WXGTK__
|
||||||
|
if (!wxIsMainThread())
|
||||||
|
wxMutexGuiLeave();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFrame::OnRenderWindowSizeRequest(int width, int height)
|
void CFrame::OnRenderWindowSizeRequest(int width, int height)
|
||||||
|
|
|
@ -882,15 +882,20 @@ void CGameListCtrl::OnMouseMotion(wxMouseEvent& event)
|
||||||
|
|
||||||
if (item != wxNOT_FOUND)
|
if (item != wxNOT_FOUND)
|
||||||
{
|
{
|
||||||
#ifndef __WXGTK__
|
wxRect Rect;
|
||||||
// The subitem parameter of HitTest is only implemented for wxMSW. On
|
#ifdef __WXMSW__
|
||||||
// all other platforms it will always be -1.
|
|
||||||
if (subitem == COLUMN_EMULATION_STATE)
|
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
|
#endif
|
||||||
{
|
{
|
||||||
if (toolTip || lastItem == item || this != FindFocus())
|
if (toolTip || lastItem == item || this != FindFocus())
|
||||||
{
|
{
|
||||||
if (!toolTip) lastItem = -1;
|
if (lastItem != item) lastItem = -1;
|
||||||
event.Skip();
|
event.Skip();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -927,34 +932,25 @@ void CGameListCtrl::OnMouseMotion(wxMouseEvent& event)
|
||||||
toolTip = new wxEmuStateTip(this, _("Not Set"), &toolTip);
|
toolTip = new wxEmuStateTip(this, _("Not Set"), &toolTip);
|
||||||
|
|
||||||
// Get item Coords
|
// Get item Coords
|
||||||
wxRect Rect;
|
|
||||||
GetItemRect(item, Rect);
|
GetItemRect(item, Rect);
|
||||||
#ifdef _WIN32
|
|
||||||
int mx = Rect.GetWidth();
|
int mx = Rect.GetWidth();
|
||||||
int my = Rect.GetY();
|
int my = Rect.GetY();
|
||||||
ClientToScreen(&mx, &my);
|
#ifndef __WXMSW__
|
||||||
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();
|
|
||||||
// For some reason the y position does not account for the header
|
// For some reason the y position does not account for the header
|
||||||
// row, so subtract the y position of the first visible item.
|
// row, so subtract the y position of the first visible item.
|
||||||
GetItemRect(GetTopItem(), Rect);
|
GetItemRect(GetTopItem(), Rect);
|
||||||
y -= Rect.GetY();
|
my -= Rect.GetY();
|
||||||
ClientToScreen(&x, &y);
|
|
||||||
toolTip->SetBoundingRect(wxRect(x, y, w, h));
|
|
||||||
toolTip->SetPosition(wxPoint(x + w, y + h / 2));
|
|
||||||
#endif
|
#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;
|
lastItem = item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
if (!toolTip)
|
||||||
lastItem = -1;
|
lastItem = -1;
|
||||||
|
|
||||||
event.Skip();
|
event.Skip();
|
||||||
|
|
Loading…
Reference in New Issue