From 5d196712c9fb5173e96f8c4bfc5febec07af570d Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Fri, 11 Jan 2008 23:12:41 +0000 Subject: [PATCH] Add a temporary backwards compatibility fix for applications that accidently mix up the resizingMode and flags field in the BView constructor. This does not cause problems under BeOS but was causing wrong follow modes when those applications were run under Haiku. In case such an application is detetected a corresponding warning is printed out. Also added a comment explaining the rational behind the change and a ToDo for the later cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23424 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/View.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp index d872d5ea7d..88f62c9380 100644 --- a/src/kits/interface/View.cpp +++ b/src/kits/interface/View.cpp @@ -4193,8 +4193,18 @@ BView::_InitData(BRect frame, const char *name, uint32 resizingMode, uint32 flag STRACE(("BView::InitData: enter\n")); - // initialize members - fFlags = (resizingMode & _RESIZE_MASK_) | (flags & ~_RESIZE_MASK_); + // initialize members + if ((resizingMode & ~_RESIZE_MASK_) || (flags & _RESIZE_MASK_)) + printf("BView::InitData(): resizing mode or flags swapped\n"); + + // There are applications that swap the resize mask and the flags in the + // BView constructor. This does not cause problems under BeOS as it just + // ors the two fields to one 32bit flag. + // For now we do the same but print the above warning message. + // ToDo: this should be removed at some point and the original + // version restored: + // fFlags = (resizingMode & _RESIZE_MASK_) | (flags & ~_RESIZE_MASK_); + fFlags = resizingMode | flags; // handle rounding frame.left = roundf(frame.left);