Make ui_color a little more bulletproof. This will mitigate bug #256 until I can track down the reason (probably in the app_server) that the color request fails
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17069 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -687,7 +687,20 @@ mouse_mode()
|
||||
_IMPEXP_BE rgb_color
|
||||
ui_color(color_which which)
|
||||
{
|
||||
if (!be_app) {
|
||||
if(be_app) {
|
||||
|
||||
rgb_color color;
|
||||
BPrivate::AppServerLink link;
|
||||
link.StartMessage(AS_GET_UI_COLOR);
|
||||
link.Attach<color_which>(which);
|
||||
|
||||
int32 code;
|
||||
if (link.FlushWithReply(code) == B_OK && code == B_OK) {
|
||||
link.Read<rgb_color>(&color);
|
||||
return color;
|
||||
}
|
||||
}
|
||||
|
||||
switch (which) {
|
||||
case B_PANEL_BACKGROUND_COLOR:
|
||||
return make_color(216,216,216);
|
||||
@@ -735,18 +748,6 @@ ui_color(color_which which)
|
||||
fprintf(stderr, "ui_color(): unknown color_which %d\n", which);
|
||||
return make_color(0,0,0);
|
||||
}
|
||||
}
|
||||
|
||||
rgb_color color;
|
||||
BPrivate::AppServerLink link;
|
||||
link.StartMessage(AS_GET_UI_COLOR);
|
||||
link.Attach<color_which>(which);
|
||||
|
||||
int32 code;
|
||||
if (link.FlushWithReply(code) == B_OK && code == B_OK)
|
||||
link.Read<rgb_color>(&color);
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user