Permalink
Browse files

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.
  • Loading branch information...
1 parent ec96e7a commit c491b5ad85c60a4b07821f7e9fbf34f60a26375e @jscipione jscipione committed Jan 31, 2013
Showing with 19 additions and 8 deletions.
  1. +18 −8 src/preferences/screen/ScreenWindow.cpp
  2. +1 −0 src/preferences/screen/ScreenWindow.h
@@ -803,15 +803,24 @@ ScreenWindow::_UpdateControls()
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);
+ }
}
@@ -50,6 +50,7 @@ class ScreenWindow : public BWindow {
void _CheckRefreshMenu();
void _UpdateActiveMode();
+ void _UpdateActiveMode(int32 workspace);
void _UpdateWorkspaceButtons();
void _UpdateRefreshControl();
void _UpdateMonitorView();

0 comments on commit c491b5a

Please sign in to comment.