When the workspace changes use the passed in workspace screen mode

...instead of the current workspace screen mode that we are switching from.
Fixes #9415
Also don't ignore the returned the status code when updating the screen mode.
This commit is contained in:
John Scipione
2013-01-31 14:17:31 -05:00
parent ec96e7af1a
commit c491b5ad85
2 changed files with 19 additions and 8 deletions
+18 -8
View File
@@ -802,16 +802,25 @@ ScreenWindow::_UpdateControls()
/*! Reflect active mode in chosen settings */
void
ScreenWindow::_UpdateActiveMode()
{
_UpdateActiveMode(current_workspace());
}
void
ScreenWindow::_UpdateActiveMode(int32 workspace)
{
// Usually, this function gets called after a mode
// has been set manually; still, as the graphics driver
// is free to fiddle with mode passed, we better ask
// what kind of mode we actually got
fScreenMode.Get(fActive);
fSelected = fActive;
if (fScreenMode.Get(fActive, workspace) == B_OK) {
fSelected = fActive;
_UpdateMonitor();
_UpdateControls();
_UpdateMonitor();
_BuildSupportedColorSpaces();
_UpdateControls();
}
}
@@ -851,11 +860,12 @@ ScreenWindow::ScreenChanged(BRect frame, color_space mode)
void
ScreenWindow::WorkspaceActivated(int32 workspace, bool state)
{
fScreenMode.GetOriginalMode(fOriginal, workspace);
_UpdateActiveMode();
if (fScreenMode.GetOriginalMode(fOriginal, workspace) == B_OK) {
_UpdateActiveMode(workspace);
BMessage message(UPDATE_DESKTOP_COLOR_MSG);
PostMessage(&message, fMonitorView);
BMessage message(UPDATE_DESKTOP_COLOR_MSG);
PostMessage(&message, fMonitorView);
}
}
+1
View File
@@ -50,6 +50,7 @@ private:
void _CheckRefreshMenu();
void _UpdateActiveMode();
void _UpdateActiveMode(int32 workspace);
void _UpdateWorkspaceButtons();
void _UpdateRefreshControl();
void _UpdateMonitorView();