Fix crashing corner case in screen prefs.
If the refresh limits only allowed a single refresh, the menu item constructed had no BMessage. This caused _UpdateRefreshControls() to crash when attempting to match the current refresh rate to the item. For simplicity, give it a message containing the fixed refresh rate just as in all other cases. Should finally fix #8431.
This commit is contained in:
@@ -316,7 +316,9 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
|
||||
// frequency, like the VESA driver
|
||||
BString name;
|
||||
refresh_rate_to_string(min, name);
|
||||
BMenuItem *item = new BMenuItem(name.String(), NULL);
|
||||
BMessage *message = new BMessage(POP_REFRESH_MSG);
|
||||
message->AddFloat("refresh", min);
|
||||
BMenuItem *item = new BMenuItem(name.String(), message);
|
||||
fRefreshMenu->AddItem(item);
|
||||
item->SetEnabled(false);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user