diff --git a/src/apps/icon-o-matic/MainWindow.cpp b/src/apps/icon-o-matic/MainWindow.cpp index 70b14b1514..c49607a0c5 100644 --- a/src/apps/icon-o-matic/MainWindow.cpp +++ b/src/apps/icon-o-matic/MainWindow.cpp @@ -575,34 +575,18 @@ MainWindow::WorkspaceActivated(int32 workspace, bool active) { BWindow::WorkspaceActivated(workspace, active); - // NOTE: hack to workaround buggy BScreen::DesktopColor() on R5 - - uint32 workspaces = Workspaces(); - if (!active || ((1 << workspace) & workspaces) == 0) - return; - - WorkspacesChanged(workspaces, workspaces); + if (active) + _WorkspaceEntered(); } void MainWindow::WorkspacesChanged(uint32 oldWorkspaces, uint32 newWorkspaces) { - if (oldWorkspaces != newWorkspaces) - BWindow::WorkspacesChanged(oldWorkspaces, newWorkspaces); + BWindow::WorkspacesChanged(oldWorkspaces, newWorkspaces); - BScreen screen(this); - - // Unfortunately, this is buggy on R5: screen.DesktopColor() - // as well as ui_color(B_DESKTOP_COLOR) return the color - // of the *active* screen, not the one on which this window - // is. So this trick only works when you drag this window - // from another workspace onto the current workspace, not - // when you drag the window from the current workspace onto - // another workspace and then switch to the other workspace. - - fIconPreview32Desktop->SetIconBGColor(screen.DesktopColor()); - fIconPreview64->SetIconBGColor(screen.DesktopColor()); + if((1 << current_workspace() & newWorkspaces) != 0) + _WorkspaceEntered(); } @@ -1274,6 +1258,18 @@ MainWindow::_ImproveScrollBarLayout(BView* target) // #pragma mark - +void +MainWindow::_WorkspaceEntered() +{ + BScreen screen(this); + fIconPreview32Desktop->SetIconBGColor(screen.DesktopColor()); + fIconPreview64->SetIconBGColor(screen.DesktopColor()); +} + + +// #pragma mark - + + bool MainWindow::_CheckSaveIcon(const BMessage* currentMessage) { diff --git a/src/apps/icon-o-matic/MainWindow.h b/src/apps/icon-o-matic/MainWindow.h index 32b8f866cb..95f435f6b2 100644 --- a/src/apps/icon-o-matic/MainWindow.h +++ b/src/apps/icon-o-matic/MainWindow.h @@ -84,6 +84,8 @@ private: void _ImproveScrollBarLayout(BView* target); + void _WorkspaceEntered(); + bool _CheckSaveIcon(const BMessage* currentMessage); void _PickUpActionBeforeSave();