app_server: Granularize whether font settings were loaded in DesktopSettings.
As per axeld's review. Change-Id: Idd817156d53ebf535f162285bfd08f0566ac3901 Reviewed-on: https://review.haiku-os.org/c/haiku/+/5755 Reviewed-by: waddlesplash <waddlesplash@gmail.com> Reviewed-by: Axel Dörfler <axeld@pinc-software.de> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This commit is contained in:
parent
689f8e9060
commit
56761ebfeb
@ -527,7 +527,7 @@ Desktop::Init()
|
|||||||
|
|
||||||
// now that the mode is set, see if we should increase the default font size
|
// now that the mode is set, see if we should increase the default font size
|
||||||
if (fSettings->DefaultPlainFont() == *gFontManager->DefaultPlainFont()
|
if (fSettings->DefaultPlainFont() == *gFontManager->DefaultPlainFont()
|
||||||
&& !fSettings->DidLoadSettings()) {
|
&& !fSettings->DidLoadFontSettings()) {
|
||||||
float fontSize = fSettings->DefaultPlainFont().Size();
|
float fontSize = fSettings->DefaultPlainFont().Size();
|
||||||
gScreenManager->Lock();
|
gScreenManager->Lock();
|
||||||
Screen* screen = gScreenManager->ScreenAt(0);
|
Screen* screen = gScreenManager->ScreenAt(0);
|
||||||
|
@ -34,7 +34,7 @@ DesktopSettingsPrivate::DesktopSettingsPrivate(server_read_only_memory* shared)
|
|||||||
{
|
{
|
||||||
// if the on-disk settings are not complete, the defaults will be kept
|
// if the on-disk settings are not complete, the defaults will be kept
|
||||||
_SetDefaults();
|
_SetDefaults();
|
||||||
fLoadStatus = _Load();
|
_Load();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -111,7 +111,6 @@ DesktopSettingsPrivate::_Load()
|
|||||||
status_t status = _GetPath(basePath);
|
status_t status = _GetPath(basePath);
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
return status;
|
return status;
|
||||||
int32 loadFailures = 0;
|
|
||||||
|
|
||||||
// read workspaces settings
|
// read workspaces settings
|
||||||
|
|
||||||
@ -138,10 +137,8 @@ DesktopSettingsPrivate::_Load()
|
|||||||
i, &fWorkspaceMessages[i]) == B_OK) {
|
i, &fWorkspaceMessages[i]) == B_OK) {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
loadFailures++;
|
}
|
||||||
} else
|
|
||||||
loadFailures++;
|
|
||||||
|
|
||||||
// read font settings
|
// read font settings
|
||||||
|
|
||||||
@ -152,7 +149,9 @@ DesktopSettingsPrivate::_Load()
|
|||||||
if (status == B_OK) {
|
if (status == B_OK) {
|
||||||
BMessage settings;
|
BMessage settings;
|
||||||
status = settings.Unflatten(&file);
|
status = settings.Unflatten(&file);
|
||||||
if (status == B_OK && gFontManager->Lock()) {
|
if (status != B_OK) {
|
||||||
|
fFontSettingsLoadStatus = status;
|
||||||
|
} else if (gFontManager->Lock()) {
|
||||||
const char* family;
|
const char* family;
|
||||||
const char* style;
|
const char* style;
|
||||||
float size;
|
float size;
|
||||||
@ -189,9 +188,9 @@ DesktopSettingsPrivate::_Load()
|
|||||||
|
|
||||||
gFontManager->Unlock();
|
gFontManager->Unlock();
|
||||||
} else
|
} else
|
||||||
loadFailures++;
|
fFontSettingsLoadStatus = EWOULDBLOCK;
|
||||||
} else
|
} else
|
||||||
loadFailures++;
|
fFontSettingsLoadStatus = status;
|
||||||
|
|
||||||
// read mouse settings
|
// read mouse settings
|
||||||
|
|
||||||
@ -219,10 +218,8 @@ DesktopSettingsPrivate::_Load()
|
|||||||
== B_OK) {
|
== B_OK) {
|
||||||
fAcceptFirstClick = acceptFirstClick;
|
fAcceptFirstClick = acceptFirstClick;
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
loadFailures++;
|
}
|
||||||
} else
|
|
||||||
loadFailures++;
|
|
||||||
|
|
||||||
// read appearance settings
|
// read appearance settings
|
||||||
|
|
||||||
@ -315,10 +312,8 @@ DesktopSettingsPrivate::_Load()
|
|||||||
fShared.colors[i] = B_TRANSPARENT_COLOR;
|
fShared.colors[i] = B_TRANSPARENT_COLOR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
loadFailures++;
|
}
|
||||||
} else
|
|
||||||
loadFailures++;
|
|
||||||
|
|
||||||
// read dragger settings
|
// read dragger settings
|
||||||
|
|
||||||
@ -332,12 +327,10 @@ DesktopSettingsPrivate::_Load()
|
|||||||
if (status == B_OK) {
|
if (status == B_OK) {
|
||||||
if (settings.FindBool("show", &fShowAllDraggers) != B_OK)
|
if (settings.FindBool("show", &fShowAllDraggers) != B_OK)
|
||||||
fShowAllDraggers = true;
|
fShowAllDraggers = true;
|
||||||
} else
|
}
|
||||||
loadFailures++;
|
}
|
||||||
} else
|
|
||||||
loadFailures++;
|
|
||||||
|
|
||||||
return (loadFailures > 0) ? B_PARTIAL_READ : B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,8 +27,8 @@ public:
|
|||||||
server_read_only_memory* shared);
|
server_read_only_memory* shared);
|
||||||
~DesktopSettingsPrivate();
|
~DesktopSettingsPrivate();
|
||||||
|
|
||||||
bool DidLoadSettings() const
|
bool DidLoadFontSettings() const
|
||||||
{ return fLoadStatus == B_OK; }
|
{ return fFontSettingsLoadStatus == B_OK; }
|
||||||
status_t Save(uint32 mask = kAllSettings);
|
status_t Save(uint32 mask = kAllSettings);
|
||||||
|
|
||||||
void SetDefaultPlainFont(const ServerFont& font);
|
void SetDefaultPlainFont(const ServerFont& font);
|
||||||
@ -104,7 +104,7 @@ private:
|
|||||||
void _ValidateWorkspacesLayout(int32& columns,
|
void _ValidateWorkspacesLayout(int32& columns,
|
||||||
int32& rows) const;
|
int32& rows) const;
|
||||||
|
|
||||||
status_t fLoadStatus;
|
status_t fFontSettingsLoadStatus;
|
||||||
|
|
||||||
ServerFont fPlainFont;
|
ServerFont fPlainFont;
|
||||||
ServerFont fBoldFont;
|
ServerFont fBoldFont;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user