mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Fix focus detection on OS X by replacing wxGetActiveWindow with wxWindow::FindFocus.
wxGetActiveWindow is implemented as "return NULL" on OS X, while wxWindow::FindFocus works. On Windows, the difference is in the use of GetActiveWindow() vs. GetForegroundWindow(). A MSDN comment says: > A system has only one active window, which GetForegroundWindow() > returns. GetActiveWindow() seems to return the same window as > GetForegroundWindow() if the foreground window belongs to the current > thread. Otherwise, it always returns null, rather than the topmost > window of the calling thread. Since we are on the GUI thread, it shouldn't make any difference.
This commit is contained in:
@ -97,7 +97,7 @@ protected:
|
||||
if (new_backend->GetName() == "Software Renderer")
|
||||
{
|
||||
do_switch = (wxYES == wxMessageBox(_("Software rendering is an order of magnitude slower than using the other backends.\nIt's only useful for debugging purposes.\nDo you really want to enable software rendering? If unsure, select 'No'."),
|
||||
_("Warning"), wxYES_NO | wxNO_DEFAULT | wxICON_EXCLAMATION, wxGetActiveWindow()));
|
||||
_("Warning"), wxYES_NO | wxNO_DEFAULT | wxICON_EXCLAMATION, wxWindow::FindFocus()));
|
||||
}
|
||||
|
||||
if (do_switch)
|
||||
|
Reference in New Issue
Block a user