app_server: don't reset brightness when switching workspaces
Fixes #16538.
This commit is contained in:
@@ -514,6 +514,10 @@ Desktop::Init()
|
||||
fVirtualScreen.SetConfiguration(*this,
|
||||
fWorkspaces[0].CurrentScreenConfiguration());
|
||||
|
||||
float brightness = fWorkspaces[0].StoredScreenConfiguration().Brightness(0);
|
||||
if (brightness > 0)
|
||||
HWInterface()->SetBrightness(brightness);
|
||||
|
||||
if (fVirtualScreen.HWInterface() == NULL) {
|
||||
debug_printf("Could not initialize graphics output. Exiting.\n");
|
||||
return B_ERROR;
|
||||
|
||||
@@ -153,6 +153,14 @@ ScreenConfigurations::SetBrightness(int32 id, float brightness)
|
||||
}
|
||||
|
||||
|
||||
float
|
||||
ScreenConfigurations::Brightness(int32 id)
|
||||
{
|
||||
screen_configuration* configuration = fConfigurations.ItemAt(0);
|
||||
return configuration->brightness;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ScreenConfigurations::Remove(screen_configuration* configuration)
|
||||
{
|
||||
|
||||
@@ -39,6 +39,7 @@ public:
|
||||
const BRect& frame,
|
||||
const display_mode& mode);
|
||||
void SetBrightness(int32 id, float brightness);
|
||||
float Brightness(int32 id);
|
||||
void Remove(screen_configuration* configuration);
|
||||
|
||||
status_t Store(BMessage& settings) const;
|
||||
|
||||
@@ -142,13 +142,6 @@ VirtualScreen::AddScreen(Screen* screen, ScreenConfigurations& configurations)
|
||||
fFrame = screen->Frame();
|
||||
item->frame = fFrame;
|
||||
|
||||
screen_configuration* config = configurations.CurrentByID(screen->ID());
|
||||
if (config) {
|
||||
float brightness = config->brightness;
|
||||
if (brightness > 0)
|
||||
fHWInterface->SetBrightness(brightness);
|
||||
}
|
||||
|
||||
fScreenList.AddItem(item);
|
||||
|
||||
return B_OK;
|
||||
|
||||
Reference in New Issue
Block a user