From 670cfb15a590bed0fe9f3e653b76700f01593066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 16 Nov 2015 20:20:37 +0100 Subject: [PATCH] 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. --- src/kits/interface/Window.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index f87e4f3d4a..b9e19b8546 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -1549,6 +1549,8 @@ BWindow::GetSizeLimits(float* _minWidth, float* _maxWidth, float* _minHeight, void BWindow::UpdateSizeLimits() { + BAutolock locker(this); + if ((fFlags & B_AUTO_UPDATE_SIZE_LIMITS) != 0) { // Get min/max constraints of the top view and enforce window // size limits respectively. @@ -2524,6 +2526,7 @@ BWindow::ResizeTo(float width, float height) void BWindow::ResizeToPreferred() { + BAutolock locker(this); Layout(false); float width = fTopView->PreferredSize().width; @@ -2544,6 +2547,8 @@ BWindow::ResizeToPreferred() void BWindow::CenterIn(const BRect& rect) { + BAutolock locker(this); + // Set size limits now if needed UpdateSizeLimits();