Fixed the savety check to actually work.
Made sure that fDisplayMode is not modified if fAccSetDisplayMode failes, as on my system fAccGetDisplayMode did return values that would crash because of a virtual_width beeing 0. Generally, this whole class is pretty broken, as the functions modify *some* class member variables before eventually failing. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17352 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
84123592e9
commit
cb9f2e8d34
@ -377,22 +377,18 @@ AccelerantHWInterface::SetMode(const display_mode &mode)
|
|||||||
|
|
||||||
// some safety checks
|
// some safety checks
|
||||||
// TODO: more of those!
|
// TODO: more of those!
|
||||||
if (fDisplayMode.virtual_width < 320
|
if (mode.virtual_width < 320
|
||||||
|| fDisplayMode.virtual_height < 200)
|
|| mode.virtual_height < 200)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
// just try to set the mode - we let the graphics driver
|
// just try to set the mode - we let the graphics driver
|
||||||
// approve or deny the request, as it should know best
|
// approve or deny the request, as it should know best
|
||||||
|
display_mode new_mode = mode;
|
||||||
fDisplayMode = mode;
|
if (fAccSetDisplayMode(&new_mode) != B_OK) {
|
||||||
|
|
||||||
if (fAccSetDisplayMode(&fDisplayMode) != B_OK) {
|
|
||||||
ATRACE(("setting display mode failed\n"));
|
ATRACE(("setting display mode failed\n"));
|
||||||
fAccGetDisplayMode(&fDisplayMode);
|
return B_ERROR;
|
||||||
// We just keep the current mode and continue.
|
|
||||||
// Note, on startup, this may be different from
|
|
||||||
// what we think is the current display mode
|
|
||||||
}
|
}
|
||||||
|
fDisplayMode = new_mode;
|
||||||
|
|
||||||
// update frontbuffer
|
// update frontbuffer
|
||||||
fFrontBuffer->SetDisplayMode(fDisplayMode);
|
fFrontBuffer->SetDisplayMode(fDisplayMode);
|
||||||
|
Loading…
Reference in New Issue
Block a user