Fixed some crashing bugs (that only appear under Haiku, because there is some

stuff missing - defensive programming rules :-)).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13005 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-06-08 04:11:19 +00:00
parent bd28b3c746
commit e9b005131f
+7 -1
View File
@@ -107,7 +107,8 @@ set_pixel_clock(display_mode * mode, float refresh_rate)
ScreenWindow::ScreenWindow(ScreenSettings *Settings) ScreenWindow::ScreenWindow(ScreenSettings *Settings)
: BWindow(Settings->WindowFrame(), "Screen", B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE, B_ALL_WORKSPACES) : BWindow(Settings->WindowFrame(), "Screen", B_TITLED_WINDOW,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE, B_ALL_WORKSPACES)
{ {
BRect frame(Bounds()); BRect frame(Bounds());
BScreen screen(B_MAIN_SCREEN_ID); BScreen screen(B_MAIN_SCREEN_ID);
@@ -115,6 +116,8 @@ ScreenWindow::ScreenWindow(ScreenSettings *Settings)
if (!screen.IsValid()) if (!screen.IsValid())
;//debugger() ? ;//debugger() ?
fSupportedModes = NULL;
fTotalModes = 0;
screen.GetModeList(&fSupportedModes, &fTotalModes); screen.GetModeList(&fSupportedModes, &fTotalModes);
frame.InsetBy(-1, -1); frame.InsetBy(-1, -1);
@@ -143,6 +146,7 @@ ScreenWindow::ScreenWindow(ScreenSettings *Settings)
string << count_workspaces(); string << count_workspaces();
BMenuItem *marked = fWorkspaceCountMenu->FindItem(string.String()); BMenuItem *marked = fWorkspaceCountMenu->FindItem(string.String());
if (marked != NULL)
marked->SetMarked(true); marked->SetMarked(true);
fWorkspaceCountField->SetDivider(91.0); fWorkspaceCountField->SetDivider(91.0);
@@ -188,6 +192,7 @@ ScreenWindow::ScreenWindow(ScreenSettings *Settings)
fResolutionField = new BMenuField(controlMenuRect, "ResolutionMenu", resolutionLabel, fResolutionMenu, true); fResolutionField = new BMenuField(controlMenuRect, "ResolutionMenu", resolutionLabel, fResolutionMenu, true);
marked = fResolutionMenu->ItemAt(0); marked = fResolutionMenu->ItemAt(0);
if (marked != NULL)
marked->SetMarked(true); marked->SetMarked(true);
fResolutionField->SetDivider(resolutionWidth); fResolutionField->SetDivider(resolutionWidth);
@@ -200,6 +205,7 @@ ScreenWindow::ScreenWindow(ScreenSettings *Settings)
fColorsField = new BMenuField(controlMenuRect, "ColorsMenu", colorsLabel, fColorsMenu, true); fColorsField = new BMenuField(controlMenuRect, "ColorsMenu", colorsLabel, fColorsMenu, true);
marked = fColorsMenu->ItemAt(0); marked = fColorsMenu->ItemAt(0);
if (marked != NULL)
marked->SetMarked(true); marked->SetMarked(true);
fColorsField->SetDivider(colorsWidth); fColorsField->SetDivider(colorsWidth);