Don't check if the requested display mode is in the mode list - just ask the

graphics add-on if it can handle it.
This fixes setting the screen resolution natively. Unfortunately, that's not
all (the input_server still constraints the cursor position to the previous
resolution...). Also, there is apparently no B_SCREEN_CHANGED sent.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15164 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-11-26 15:52:22 +00:00
parent 987aa5e4d4
commit b635c022cb

View File

@ -343,26 +343,12 @@ AccelerantHWInterface::SetMode(const display_mode &mode)
// prevent from doing the unnecessary
if (fModeCount > 0 && fBackBuffer && fFrontBuffer
&& fDisplayMode == mode) {
// TODO: better comparison of display modes
return B_OK;
}
if (fModeCount <= 0 || !fModeList) {
if (_UpdateModeList() != B_OK || fModeCount <= 0) {
ATRACE(("unable to update mode list\n"));
return B_ERROR;
}
}
// check if the mode is in our list
bool found = false;
for (int32 i = 0; i < fModeCount; i++) {
if (fModeList[i] == mode) {
found = true;
break;
}
}
if (!found)
return B_BAD_VALUE;
// just try to set the mode - we let the graphics driver
// approve or deny the request, as it should know best
fDisplayMode = mode;