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
+13 -3
View File
@@ -802,17 +802,26 @@ ScreenWindow::_UpdateControls()
/*! Reflect active mode in chosen settings */ /*! Reflect active mode in chosen settings */
void void
ScreenWindow::_UpdateActiveMode() ScreenWindow::_UpdateActiveMode()
{
_UpdateActiveMode(current_workspace());
}
void
ScreenWindow::_UpdateActiveMode(int32 workspace)
{ {
// Usually, this function gets called after a mode // Usually, this function gets called after a mode
// has been set manually; still, as the graphics driver // has been set manually; still, as the graphics driver
// is free to fiddle with mode passed, we better ask // is free to fiddle with mode passed, we better ask
// what kind of mode we actually got // what kind of mode we actually got
fScreenMode.Get(fActive); if (fScreenMode.Get(fActive, workspace) == B_OK) {
fSelected = fActive; fSelected = fActive;
_UpdateMonitor(); _UpdateMonitor();
_BuildSupportedColorSpaces();
_UpdateControls(); _UpdateControls();
} }
}
void void
@@ -851,12 +860,13 @@ ScreenWindow::ScreenChanged(BRect frame, color_space mode)
void void
ScreenWindow::WorkspaceActivated(int32 workspace, bool state) ScreenWindow::WorkspaceActivated(int32 workspace, bool state)
{ {
fScreenMode.GetOriginalMode(fOriginal, workspace); if (fScreenMode.GetOriginalMode(fOriginal, workspace) == B_OK) {
_UpdateActiveMode(); _UpdateActiveMode(workspace);
BMessage message(UPDATE_DESKTOP_COLOR_MSG); BMessage message(UPDATE_DESKTOP_COLOR_MSG);
PostMessage(&message, fMonitorView); PostMessage(&message, fMonitorView);
} }
}
void void
+1
View File
@@ -50,6 +50,7 @@ private:
void _CheckRefreshMenu(); void _CheckRefreshMenu();
void _UpdateActiveMode(); void _UpdateActiveMode();
void _UpdateActiveMode(int32 workspace);
void _UpdateWorkspaceButtons(); void _UpdateWorkspaceButtons();
void _UpdateRefreshControl(); void _UpdateRefreshControl();
void _UpdateMonitorView(); void _UpdateMonitorView();