Better app_server communication for SetFeel(), SetLook(), and SetFlags().
SetFeel() gets a status value back as well. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15267 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1618,10 +1618,8 @@ BWindow::SetLook(window_look look)
|
|||||||
fLink->Attach<int32>((int32)look);
|
fLink->Attach<int32>((int32)look);
|
||||||
|
|
||||||
status_t status = B_ERROR;
|
status_t status = B_ERROR;
|
||||||
if (fLink->FlushWithReply(status) == B_OK && status == B_OK) {
|
if (fLink->FlushWithReply(status) == B_OK && status == B_OK)
|
||||||
fLook = look;
|
fLook = look;
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@@ -1637,26 +1635,16 @@ BWindow::Look() const
|
|||||||
status_t
|
status_t
|
||||||
BWindow::SetFeel(window_feel feel)
|
BWindow::SetFeel(window_feel feel)
|
||||||
{
|
{
|
||||||
// ToDo: that should probably be done by the server, not the window
|
BAutolock locker(this);
|
||||||
if (feel != B_NORMAL_WINDOW_FEEL
|
|
||||||
&& feel != B_MODAL_SUBSET_WINDOW_FEEL
|
|
||||||
&& feel != B_MODAL_APP_WINDOW_FEEL
|
|
||||||
&& feel != B_MODAL_ALL_WINDOW_FEEL
|
|
||||||
&& feel != B_FLOATING_SUBSET_WINDOW_FEEL
|
|
||||||
&& feel != B_FLOATING_APP_WINDOW_FEEL
|
|
||||||
&& feel != B_FLOATING_ALL_WINDOW_FEEL)
|
|
||||||
return B_BAD_VALUE;
|
|
||||||
|
|
||||||
Lock();
|
|
||||||
fLink->StartMessage(AS_SET_FEEL);
|
fLink->StartMessage(AS_SET_FEEL);
|
||||||
fLink->Attach<int32>((int32)feel);
|
fLink->Attach<int32>((int32)feel);
|
||||||
fLink->Flush();
|
|
||||||
Unlock();
|
|
||||||
|
|
||||||
// ToDo: return code from server?
|
status_t status = B_ERROR;
|
||||||
fFeel = feel;
|
if (fLink->FlushWithReply(status) == B_OK && status == B_OK)
|
||||||
|
fFeel = feel;
|
||||||
|
|
||||||
return B_OK;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1670,7 +1658,7 @@ BWindow::Feel() const
|
|||||||
status_t
|
status_t
|
||||||
BWindow::SetFlags(uint32 flags)
|
BWindow::SetFlags(uint32 flags)
|
||||||
{
|
{
|
||||||
Lock();
|
BAutolock locker(this);
|
||||||
|
|
||||||
fLink->StartMessage(AS_SET_FLAGS);
|
fLink->StartMessage(AS_SET_FLAGS);
|
||||||
fLink->Attach<uint32>(flags);
|
fLink->Attach<uint32>(flags);
|
||||||
@@ -1679,8 +1667,6 @@ BWindow::SetFlags(uint32 flags)
|
|||||||
if (fLink->FlushWithReply(status) == B_OK && status == B_OK)
|
if (fLink->FlushWithReply(status) == B_OK && status == B_OK)
|
||||||
fFlags = flags;
|
fFlags = flags;
|
||||||
|
|
||||||
Unlock();
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user