summaryrefslogtreecommitdiff
path: root/vcl/source/window
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-11-14 12:20:57 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-11-14 13:18:10 +0000
commit18f08d180db8e821f5c39359e08c177bcfecb58b (patch)
treef5856068bcb5c66192c97ae657172cc1491ace02 /vcl/source/window
parenta857cd94f558e9215f48601197939356ed774faf (diff)
Resolves: fdo#57090 visual glitches on MacOSX with borders + layout
We need to force a resync of the borders of a borderwindow onto its client window when the borders change when layout is active, otherwise we are doing out calculations using the old borders and it all turns into a pile of junk Change-Id: I7dbff0b30aad41779f0f295498af6a492ddf5430
Diffstat (limited to 'vcl/source/window')
-rw-r--r--vcl/source/window/brdwin.cxx31
-rw-r--r--vcl/source/window/window2.cxx12
2 files changed, 38 insertions, 5 deletions
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 8f7ea254990e..5de8938320ea 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -1077,6 +1077,18 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
mnHeight = nHeight;
mbNWFBorder = false;
+ Window *pWin = NULL, *pCtrl = NULL;
+ if (mpOutDev->GetOutDevType() == OUTDEV_WINDOW)
+ pWin = (Window*) mpOutDev;
+
+ if (pWin)
+ pCtrl = mpBorderWindow->GetWindow(WINDOW_CLIENT);
+
+ long nOrigLeftBorder = mnLeftBorder;
+ long nOrigTopBorder = mnTopBorder;
+ long nOrigRightBorder = mnRightBorder;
+ long nOrigBottomBorder = mnBottomBorder;
+
sal_uInt16 nBorderStyle = mpBorderWindow->GetBorderStyle();
if ( nBorderStyle & WINDOW_BORDER_NOBORDER )
{
@@ -1093,12 +1105,8 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
{
// for native widget drawing we must find out what
// control this border belongs to
- Window *pWin = NULL, *pCtrl = NULL;
- if( mpOutDev->GetOutDevType() == OUTDEV_WINDOW )
- pWin = (Window*) mpOutDev;
-
ControlType aCtrlType = 0;
- if( pWin && (pCtrl = mpBorderWindow->GetWindow( WINDOW_CLIENT )) != NULL )
+ if (pCtrl)
{
switch( pCtrl->GetType() )
{
@@ -1207,6 +1215,19 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
mnBottomBorder = aRect.Bottom()-aCalcRect.Bottom();
}
}
+
+ if (pCtrl)
+ {
+ //fdo#57090 If the borders have changed, then trigger a queue_resize on
+ //the bordered window, which will resync its borders at that point
+ if (nOrigLeftBorder != mnLeftBorder ||
+ nOrigTopBorder != mnTopBorder ||
+ nOrigRightBorder != mnRightBorder ||
+ nOrigBottomBorder != mnBottomBorder)
+ {
+ pCtrl->queue_resize();
+ }
+ }
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index f816d2a3630a..be8c8baf5056 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1746,6 +1746,8 @@ void Window::SetBackgroundBitmap( const BitmapEx& rBitmapEx )
//as dirty for the size remains unchanged, but layout changed circumstances
void Window::queue_resize()
{
+ bool bSomeoneCares = false;
+
Dialog *pDialog = NULL;
Window *pWindow = this;
@@ -1756,6 +1758,7 @@ void Window::queue_resize()
{
VclContainer *pContainer = static_cast<VclContainer*>(pWindow);
pContainer->markLayoutDirty();
+ bSomeoneCares = true;
}
else if (pWindow->GetType() == WINDOW_TABCONTROL)
{
@@ -1770,6 +1773,15 @@ void Window::queue_resize()
pWindow = pWindow->GetParent();
}
+ if (bSomeoneCares)
+ {
+ //fdo#57090 force a resync of the borders of the borderwindow onto this
+ //window in case they have changed
+ Window* pBorderWindow = ImplGetBorderWindow();
+ if (pBorderWindow)
+ pBorderWindow->Resize();
+ }
+
if (!pDialog || pDialog == this)
return;
pDialog->queue_layout();