- for (int i = 0; i < nNumModes; ++i)
- {
- if (!bRet &&
- ppXModes[i]->hdisplay == mode.w &&
- ppXModes[i]->vdisplay == mode.h &&
- wxCRR((*ppXModes[i])) == mode.refresh)
- {
- //switch!
- bRet = XF86VidModeSwitchToMode((Display*)wxGetDisplay(), DefaultScreen((Display*)wxGetDisplay()),
- ppXModes[i]) == TRUE;
- }
- wxClearXVM((*ppXModes[i]));
- // XFree(ppXModes[i]); //supposed to free?
- }
- XFree(ppXModes);
-
- return bRet;
- }
- else //OOPS!
- {
- wxLogSysError(_("Failed to change video mode"));
- return false;