BWindow: lock the looper in some new methods.
* This makes it more convenient to call them from someplace else, and follows the design used in the rest of the implementation.
This commit is contained in:
@@ -1549,6 +1549,8 @@ BWindow::GetSizeLimits(float* _minWidth, float* _maxWidth, float* _minHeight,
|
|||||||
void
|
void
|
||||||
BWindow::UpdateSizeLimits()
|
BWindow::UpdateSizeLimits()
|
||||||
{
|
{
|
||||||
|
BAutolock locker(this);
|
||||||
|
|
||||||
if ((fFlags & B_AUTO_UPDATE_SIZE_LIMITS) != 0) {
|
if ((fFlags & B_AUTO_UPDATE_SIZE_LIMITS) != 0) {
|
||||||
// Get min/max constraints of the top view and enforce window
|
// Get min/max constraints of the top view and enforce window
|
||||||
// size limits respectively.
|
// size limits respectively.
|
||||||
@@ -2524,6 +2526,7 @@ BWindow::ResizeTo(float width, float height)
|
|||||||
void
|
void
|
||||||
BWindow::ResizeToPreferred()
|
BWindow::ResizeToPreferred()
|
||||||
{
|
{
|
||||||
|
BAutolock locker(this);
|
||||||
Layout(false);
|
Layout(false);
|
||||||
|
|
||||||
float width = fTopView->PreferredSize().width;
|
float width = fTopView->PreferredSize().width;
|
||||||
@@ -2544,6 +2547,8 @@ BWindow::ResizeToPreferred()
|
|||||||
void
|
void
|
||||||
BWindow::CenterIn(const BRect& rect)
|
BWindow::CenterIn(const BRect& rect)
|
||||||
{
|
{
|
||||||
|
BAutolock locker(this);
|
||||||
|
|
||||||
// Set size limits now if needed
|
// Set size limits now if needed
|
||||||
UpdateSizeLimits();
|
UpdateSizeLimits();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user