So, I've got flickering buttons on some themes for gtk, e.g. Glide,
Clearlooks and Glider. They all have slightly rounded corners to their
widgets and their mouse over state is the same as non mouse over, so the
newly drawn content on mouse enter/leave is unchanged. Which makes the
flicker of redraw more noticeable than one where there really is a
change of visual state.
I've been looking into it a little, and basically apparently the
background gets cleared and a few cycles later the widget gets rendered
piecemeal, giving a noticeable flicker.
The first flicker is that of clearing the background in the parent
dialog from the PreNotify of child widgets. i.e. the background clear
forced by having "SetPaintTransparent( TRUE)" in
PushButton::ImplInitSettings. So for experimental purposes I disabled
SetPaintTransparent. But flickering remains.
I can alleviate the symptoms of the secondary flickering by at least
bundling the bottom level gtk drawing into one screen operation with
basically protecting the calls to the native rendering framework with...
gdk_window_begin_paint_rect(GDK_WINDOW(gdkDrawable), &clipRect);
gdk_window_get_internal_paint_info(GDK_WINDOW(gdkDrawable), &drawable,
&m_nXOffset, &m_nYOffset);
Drawable hDrawable = gdk_x11_drawable_get_xid(drawable);
SetDrawable( hDrawable,
gdk_screen_get_number( gdk_drawable_get_screen( drawable ) ) );
which gives us a double buffer for gtk drawing, the first problem here
is that the m_nXOffset/m_nYOffset then needs to be propogated to our vcl
drawing methods so that e.g. text rendered into buttons is given the new
offset so that it gets rendered into the double buffer, but it sort of
works. We can force buffering on in the higher level e.g. PushButton
calls to the native rendering, so that all the various drawing that we
do during button rendering all gets done to the buffer until we leave
that PushButton::ImplDrawPushButton at which point the whole gtk widget
gets blitted to the screen.
That can get rid of the secondary flicker for buttons, the other big
offender is the listboxwindow widgets. There in PreNotify, triggered by
mouseover, we invalidate the border window and the contained window. In
the border window we native widget render the listbox, so it clears the
area and has its border drawn. Some time later then we render the
contained widget content. So we see a flicker between drawing cycles.
That one stumps me for a quick fix, so all in all I guess I've failed to
fix the flicker :-) But I'll dump in my horrific debugging patch which
leads to rock solid non-flickering gtk button rendering for reference if
anyone else wants to have a think about it.
C.
Index: inc/salgdi.hxx
===================================================================
RCS file: /cvs/gsl/vcl/inc/Attic/salgdi.hxx,v
retrieving revision 1.36
diff -u -r1.36 salgdi.hxx
--- inc/salgdi.hxx 14 Nov 2006 15:22:46 -0000 1.36
+++ inc/salgdi.hxx 1 Aug 2007 10:27:40 -0000
@@ -162,6 +162,10 @@
// native widget rendering methods that require mirroring
virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
const Point& aPos, SalControlHandle& rControlHandle, BOOL& rIsInside );
+
+ virtual void beginNativePaint(const Region& rControlRegion);
+ virtual void endNativePaint();
+
virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
ControlState nState, const ImplControlValue& aValue, SalControlHandle& rControlHandle,
const rtl::OUString& aCaption );
@@ -432,6 +447,9 @@
BOOL& rIsInside,
const OutputDevice *pOutDev );
+ void BeginNativePaint(const Region& rControlRegion);
+ void EndNativePaint();
+
// Request rendering of a particular control and/or part
BOOL DrawNativeControl( ControlType nType,
ControlPart nPart,
Index: inc/window.hxx
===================================================================
RCS file: /cvs/gsl/vcl/inc/Attic/window.hxx,v
retrieving revision 1.80.24.1
diff -u -r1.80.24.1 window.hxx
--- inc/window.hxx 19 Jan 2007 16:10:11 -0000 1.80.24.1
+++ inc/window.hxx 1 Aug 2007 10:27:42 -0000
@@ -1055,6 +1055,9 @@
const Point& aPos,
BOOL& rIsInside );
+ void BeginNativePaint(const Region& rControlRegion);
+ void EndNativePaint();
+
// Request rendering of a particular control and/or part
BOOL DrawNativeControl( ControlType nType,
ControlPart nPart,
Index: source/control/button.cxx
===================================================================
RCS file: /cvs/gsl/vcl/source/control/button.cxx,v
retrieving revision 1.45.132.1
diff -u -r1.45.132.1 button.cxx
--- source/control/button.cxx 24 Jan 2007 13:33:19 -0000 1.45.132.1
+++ source/control/button.cxx 1 Aug 2007 10:27:46 -0000
@@ -905,6 +905,7 @@
if ( bBackground )
{
SetBackground();
+#if 0
// #i38498#: do not check for GetParent()->IsChildTransparentModeEnabled()
// otherwise the formcontrol button will be overdrawn due to PARENTCLIPMODE_NOCLIP
// for radio and checkbox this is ok as they shoud appear transparent in documents
@@ -915,6 +916,7 @@
SetPaintTransparent( TRUE );
}
else
+#endif
{
EnableChildTransparentMode( FALSE );
SetParentClipMode( 0 );
@@ -1138,6 +1140,7 @@
long nX, long nY,
Color& rColor, BOOL bBlack )
{
+#if 1
Color aOldLineColor = pDev->GetLineColor();
Color aOldFillColor = pDev->GetFillColor();
@@ -1158,6 +1161,7 @@
}
pDev->SetLineColor( aOldLineColor );
pDev->SetFillColor( aOldFillColor );
+#endif
}
// -----------------------------------------------------------------------
@@ -1265,6 +1269,27 @@
{
}
+class FOO
+{
+private:
+ Window &mrWindow;
+public:
+ FOO(Window &rWindow, const Region &rRegion);
+ ~FOO();
+};
+
+FOO::FOO(Window &rWindow, const Region &rRegion) : mrWindow(rWindow)
+{
+ fprintf(stderr, "ENTER\n");
+ mrWindow.BeginNativePaint(rRegion);
+}
+
+FOO::~FOO()
+{
+ fprintf(stderr, "EXIT\n");
+ mrWindow.EndNativePaint();
+}
+
// -----------------------------------------------------------------------
void PushButton::ImplDrawPushButton( bool bLayout )
@@ -1343,6 +1368,8 @@
if ( IsMouseOver() && aInRect.IsInside( GetPointerPosPixel() ) )
nState |= CTRL_STATE_ROLLOVER;
+ fprintf(stderr, "doing this for %d (%d/%d)\n", aCtrlType, CTRL_LISTBOX, CTRL_COMBOBOX);
+
bNativeOK = DrawNativeControl( aCtrlType, PART_BUTTON_DOWN, aCtrlRegion, nState,
aControlValue, rtl::OUString() );
}
@@ -1367,6 +1394,8 @@
if ( IsMouseOver() && aInRect.IsInside( GetPointerPosPixel() ) )
nState |= CTRL_STATE_ROLLOVER;
+ FOO aDoubleBuffer(*this, aInRect);
+
bNativeOK = DrawNativeControl( CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion, nState,
aControlValue, rtl::OUString()/*PushButton::GetText()*/ );
@@ -1836,6 +1865,7 @@
case WINDOW_MULTILISTBOX:
case WINDOW_TREELISTBOX:
aCtrlType = CTRL_LISTBOX;
+ fprintf(stderr, "CTRL_LISTBOX\n");
break;
case WINDOW_COMBOBOX:
@@ -1846,6 +1876,7 @@
case WINDOW_DATEBOX:
case WINDOW_TIMEBOX:
case WINDOW_LONGCURRENCYBOX:
+ fprintf(stderr, "CTRL_COMBOBOX\n");
aCtrlType = CTRL_COMBOBOX;
break;
default:
@@ -1858,7 +1889,7 @@
!GetParent()->IsNativeControlSupported( aCtrlType, PART_BUTTON_DOWN) )
{
Window *pBorder = GetParent()->GetWindow( WINDOW_BORDER );
- if(aCtrlType == CTRL_COMBOBOX)
+ if((aCtrlType == CTRL_COMBOBOX) || (aCtrlType == CTRL_LISTBOX))
{
// only paint the button part to avoid flickering of the combobox text
Point aPt;
@@ -2239,6 +2270,7 @@
if ( bBackground )
{
Window* pParent = GetParent();
+#if 0
if ( !IsControlBackground() &&
(pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL ) ) )
{
@@ -2248,6 +2280,7 @@
SetBackground();
}
else
+#endif
{
EnableChildTransparentMode( FALSE );
SetParentClipMode( 0 );
@@ -2292,6 +2325,8 @@
if ( IsMouseOver() && maMouseRect.IsInside( GetPointerPosPixel() ) )
nState |= CTRL_STATE_ROLLOVER;
+ FOO aDoubleBuffer(*this, aCtrlRect);
+
bNativeOK = DrawNativeControl( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion, nState,
aControlValue,rtl::OUString() );
@@ -3286,6 +3321,7 @@
if ( bBackground )
{
Window* pParent = GetParent();
+#if 0
if ( !IsControlBackground() &&
(pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( CTRL_CHECKBOX, PART_ENTIRE_CONTROL ) ) )
{
@@ -3295,6 +3331,7 @@
SetBackground();
}
else
+#endif
{
EnableChildTransparentMode( FALSE );
SetParentClipMode( 0 );
@@ -3348,6 +3385,8 @@
if ( IsMouseOver() && maMouseRect.IsInside( GetPointerPosPixel() ) )
nState |= CTRL_STATE_ROLLOVER;
+ FOO aDoubleBuffer(*this, maStateRect );
+
bNativeOK = DrawNativeControl( CTRL_CHECKBOX, PART_ENTIRE_CONTROL, aCtrlRegion, nState,
aControlValue, rtl::OUString() );
}
Index: source/control/ilstbox.cxx
===================================================================
RCS file: /cvs/gsl/vcl/source/control/ilstbox.cxx,v
retrieving revision 1.57.134.1
diff -u -r1.57.134.1 ilstbox.cxx
--- source/control/ilstbox.cxx 15 Jan 2007 16:50:27 -0000 1.57.134.1
+++ source/control/ilstbox.cxx 1 Aug 2007 10:27:48 -0000
@@ -81,6 +81,8 @@
#include <com/sun/star/accessibility/XAccessible.hpp>
#endif
+#include <stdio.h>
+
using namespace ::com::sun::star;
@@ -130,6 +132,16 @@
pButton->SetBackground();
}
+class FOO
+{
+private:
+ Window &mrWindow;
+public:
+ FOO(Window &rWindow, const Region &rRegion);
+ ~FOO();
+};
+
+
// =======================================================================
ImplEntryList::ImplEntryList( Window* pWindow )
@@ -2595,8 +2607,20 @@
if ( IsNativeControlSupported(CTRL_LISTBOX, PART_ENTIRE_CONTROL)
&& ! IsNativeControlSupported(CTRL_LISTBOX, PART_BUTTON_DOWN) )
{
- GetParent()->GetWindow( WINDOW_BORDER )->Invalidate( INVALIDATE_NOERASE );
- GetParent()->GetWindow( WINDOW_BORDER )->Update();
+#if 1
+ {
+#if 0
+ sal_Int32 nLeft, nTop, nRight, nBottom;
+ Window *pWin = GetParent();
+ pWin->GetBorder( nLeft, nTop, nRight, nBottom );
+ Point aPoint( -nLeft, -nTop );
+ Region aCtrlRegion( Rectangle( aPoint - GetPosPixel(), pWin->GetSizePixel() ) );
+ FOO aDoubleBuffer(*this, aCtrlRegion);
+#endif
+ GetParent()->GetWindow( WINDOW_BORDER )->Invalidate( INVALIDATE_NOERASE );
+ }
+#endif
+// GetParent()->GetWindow( WINDOW_BORDER )->Update();
}
}
}
@@ -2647,7 +2671,9 @@
if( bMouseOver )
nState |= CTRL_STATE_ROLLOVER;
-
+
+ fprintf(stderr, "drawing listbox\n");
+
// if parent has no border, then nobody has drawn the background
// since no border window exists. so draw it here.
WinBits nParentStyle = pWin->GetStyle();
@@ -2655,10 +2681,12 @@
{
Rectangle aParentRect( Point( 0, 0 ), pWin->GetSizePixel() );
Region aParentReg( aParentRect );
+ fprintf(stderr, "draw parent rect\n");
pWin->DrawNativeControl( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aParentReg,
nState, aControlValue, rtl::OUString() );
}
+ FOO aDoubleBuffer(*this, aCtrlRegion);
bNativeOK = DrawNativeControl( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aCtrlRegion, nState,
aControlValue, rtl::OUString() );
}
Index: source/gdi/salgdilayout.cxx
===================================================================
RCS file: /cvs/gsl/vcl/source/gdi/salgdilayout.cxx,v
retrieving revision 1.26
diff -u -r1.26 salgdilayout.cxx
--- source/gdi/salgdilayout.cxx 14 Nov 2006 15:23:34 -0000 1.26
+++ source/gdi/salgdilayout.cxx 1 Aug 2007 10:28:02 -0000
@@ -566,6 +566,16 @@
}
}
+void SalGraphics::BeginNativePaint(const Region& rControlRegion)
+{
+ beginNativePaint(rControlRegion);
+}
+
+void SalGraphics::EndNativePaint()
+{
+ endNativePaint();
+}
+
BOOL SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
ControlState nState, const ImplControlValue& aValue, SalControlHandle& rControlHandle,
const OUString& aCaption, const OutputDevice *pOutDev )
Index: source/gdi/salnativewidgets-none.cxx
===================================================================
RCS file: /cvs/gsl/vcl/source/gdi/salnativewidgets-none.cxx,v
retrieving revision 1.5
diff -u -r1.5 salnativewidgets-none.cxx
--- source/gdi/salnativewidgets-none.cxx 17 Sep 2006 12:11:27 -0000 1.5
+++ source/gdi/salnativewidgets-none.cxx 1 Aug 2007 10:28:03 -0000
@@ -75,6 +75,14 @@
}
+void SalGraphics::beginNativePaint(const Region&)
+{
+}
+
+void SalGraphics::endNativePaint()
+{
+}
+
/*
* DrawNativeControl()
*
Index: source/window/window.cxx
===================================================================
RCS file: /cvs/gsl/vcl/source/window/window.cxx,v
retrieving revision 1.249.24.3
diff -u -r1.249.24.3 window.cxx
--- source/window/window.cxx 26 Jan 2007 12:14:38 -0000 1.249.24.3
+++ source/window/window.cxx 1 Aug 2007 10:28:12 -0000
@@ -5649,6 +5679,8 @@
void Window::SetPaintTransparent( BOOL bTransparent )
{
+ return;
+
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
// transparency is not useful for frames as the background would have to be provided by a different frame
Index: source/window/window3.cxx
===================================================================
RCS file: /cvs/gsl/vcl/source/window/window3.cxx,v
retrieving revision 1.8
diff -u -r1.8 window3.cxx
--- source/window/window3.cxx 17 Sep 2006 12:24:10 -0000 1.8
+++ source/window/window3.cxx 1 Aug 2007 10:28:12 -0000
@@ -65,6 +65,8 @@
#include <rtl/ustring.hxx>
#endif
+#include <stdio.h>
+
using namespace rtl;
// -----------------------------------------------------------------------
@@ -155,6 +157,36 @@
}
}
+void Window::BeginNativePaint(const Region& rControlRegion)
+{
+ if ( !mpGraphics )
+ if ( !ImplGetGraphics() )
+ return ;
+
+ // Convert the coordinates from relative to Window-absolute, so we draw
+ // in the correct place in platform code
+ Point aWinOffs;
+ aWinOffs = OutputToScreenPixel( aWinOffs );
+
+ Region screenRegion( rControlRegion );
+ Region aTestRegion( GetActiveClipRegion() );
+ aTestRegion.Intersect( rControlRegion );
+
+ aTestRegion.Move( aWinOffs.X(), aWinOffs.Y());
+
+ fprintf(stderr, "begin with %p\n", mpGraphics);
+ mpGraphics->BeginNativePaint(aTestRegion);
+}
+
+void Window::EndNativePaint()
+{
+ if ( !mpGraphics )
+ if ( !ImplGetGraphics() )
+ return ;
+ fprintf(stderr, "end with %p\n", mpGraphics);
+ mpGraphics->EndNativePaint();
+}
+
BOOL Window::DrawNativeControl( ControlType nType,
ControlPart nPart,
const Region& rControlRegion,
Index: unx/gtk/gdi/salnativewidgets-gtk.cxx
===================================================================
RCS file: /cvs/gsl/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx,v
retrieving revision 1.35.34.1
diff -u -r1.35.34.1 salnativewidgets-gtk.cxx
--- unx/gtk/gdi/salnativewidgets-gtk.cxx 24 Jan 2007 13:35:35 -0000 1.35.34.1
+++ unx/gtk/gdi/salnativewidgets-gtk.cxx 1 Aug 2007 10:28:14 -0000
@@ -682,6 +688,52 @@
}
}
+void GtkSalGraphics::beginNativePaint(const Region& rControlRegion)
+{
+#if 1
+ GdkDrawable* gdkDrawable = GDK_DRAWABLE( GetGdkWindow() );
+
+ Rectangle aCtrlRect = rControlRegion.GetBoundRect();
+
+ Region aClipRegion( m_aClipRegion );
+ if( aClipRegion.IsNull() )
+ aClipRegion = aCtrlRect;
+
+ Rectangle aPaintRect = aClipRegion.GetBoundRect();
+ aPaintRect = aCtrlRect.GetIntersection( aPaintRect );
+
+ GdkRectangle clipRect;
+ clipRect.x = aCtrlRect.Left();
+ clipRect.y = aCtrlRect.Top();
+ clipRect.width = aCtrlRect.GetWidth();
+ clipRect.height = aCtrlRect.GetHeight();
+ gdk_window_begin_paint_rect(GDK_WINDOW(gdkDrawable), &clipRect);
+
+ GdkDrawable *drawable = NULL;
+ gdk_window_get_internal_paint_info(GDK_WINDOW(gdkDrawable), &drawable, &m_nXOffset, &m_nYOffset);
+
+ Drawable hDrawable = gdk_x11_drawable_get_xid(drawable);
+
+ SetDrawable( hDrawable, gdk_screen_get_number( gdk_drawable_get_screen( drawable ) ) );
+ fprintf(stderr, "begin\n");
+#endif
+}
+
+void GtkSalGraphics::endNativePaint()
+{
+#if 1
+ GdkDrawable* gdkDrawable = GDK_DRAWABLE( GetGdkWindow() );
+ gdk_window_end_paint(GDK_WINDOW(gdkDrawable));
+
+ GdkDrawable *drawable = NULL;
+ gdk_window_get_internal_paint_info(GDK_WINDOW(gdkDrawable), &drawable, NULL, NULL);
+ Drawable hDrawable = gdk_x11_drawable_get_xid(drawable);
+ SetDrawable( hDrawable, gdk_screen_get_number( gdk_drawable_get_screen( drawable ) ) );
+
+ m_nXOffset = m_nYOffset = 0;
+ fprintf(stderr, "end\n");
+#endif
+}
/*
* DrawNativeControl()
@@ -719,7 +771,7 @@
Region aClipRegion( m_aClipRegion );
if( aClipRegion.IsNull() )
aClipRegion = aCtrlRect;
-
+
clipList aClip;
GdkDrawable* gdkDrawable = GDK_DRAWABLE( GetGdkWindow() );
GdkPixmap* pixmap = NULL;
@@ -737,6 +789,7 @@
aPixmapRect = Rectangle( Point( aCtrlRect.Left()-1, aCtrlRect.Top()-1 ),
Size( aCtrlRect.GetWidth()+2, aCtrlRect.GetHeight()+2) );
pixmap = NWGetPixmapFromScreen( aPixmapRect );
+ fprintf(stderr, "making pixmap\n");
if( ! pixmap )
return FALSE;
gdkDrawable = GDK_DRAWABLE( pixmap );
@@ -756,9 +809,12 @@
}
aClipRegion.EndEnumRects( aHdl );
}
+
+ Rectangle aPaintRect = aClipRegion.GetBoundRect();
if ( (nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL) )
{
+ fprintf(stderr, "drawing button\n");
returnVal = NWPaintGTKButton( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rControlHandle, rCaption );
}
else if ( (nType==CTRL_RADIOBUTTON) && (nPart==PART_ENTIRE_CONTROL) )
@@ -1073,20 +1129,19 @@
clipRect.y = it->Top();
clipRect.width = it->GetWidth();
clipRect.height = it->GetHeight();
-
+
// Buttons must paint opaque since some themes have alpha-channel enabled buttons
gtk_paint_flat_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
&clipRect, m_pWindow, "base", x, y, w, h );
-
+
if ( (nState & CTRL_STATE_DEFAULT) && (GTK_BUTTON(gWidgetData[m_nScreen].gBtnWidget)->relief == GTK_RELIEF_NORMAL) )
{
gtk_paint_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_IN,
&clipRect, gWidgetData[m_nScreen].gBtnWidget, "buttondefault", x, y, w, h );
}
-
+
if ( (GTK_BUTTON(gWidgetData[m_nScreen].gBtnWidget)->relief != GTK_RELIEF_NONE)
- || (nState & CTRL_STATE_PRESSED)
- || (nState & CTRL_STATE_ROLLOVER) )
+ || (stateType != GTK_STATE_NORMAL && stateType != GTK_STATE_INSENSITIVE))
{
gtk_paint_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, stateType, shadowType,
&clipRect, gWidgetData[m_nScreen].gBtnWidget, "button", xi, yi, wi, hi );
Index: unx/inc/plugins/gtk/gtkgdi.hxx
===================================================================
RCS file: /cvs/gsl/vcl/unx/inc/plugins/gtk/gtkgdi.hxx,v
retrieving revision 1.10
diff -u -r1.10 gtkgdi.hxx
--- unx/inc/plugins/gtk/gtkgdi.hxx 6 Oct 2006 10:03:07 -0000 1.10
+++ unx/inc/plugins/gtk/gtkgdi.hxx 1 Aug 2007 10:28:18 -0000
@@ -75,6 +75,8 @@
virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
const Point& aPos, SalControlHandle& rControlHandle, BOOL& rIsInside );
+ virtual void beginNativePaint(const Region& rControlRegion);
+ virtual void endNativePaint();
virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
ControlState nState, const ImplControlValue& aValue, SalControlHandle& rControlHandle,
const rtl::OUString& rCaption );
Index: unx/source/gdi/salgdi.cxx
===================================================================
RCS file: /cvs/gsl/vcl/unx/source/gdi/salgdi.cxx,v
retrieving revision 1.47
diff -u -r1.47 salgdi.cxx
--- unx/source/gdi/salgdi.cxx 18 Oct 2006 15:08:29 -0000 1.47
+++ unx/source/gdi/salgdi.cxx 1 Aug 2007 10:28:20 -0000
@@ -110,6 +110,8 @@
hDrawable_ = None;
pRenderFormat_ = NULL;
+ m_nXOffset = m_nYOffset = 0;
+
pClipRegion_ = NULL;
pPaintRegion_ = NULL;
Index: unx/source/gdi/salgdi3.cxx
===================================================================
RCS file: /cvs/gsl/vcl/unx/source/gdi/salgdi3.cxx,v
retrieving revision 1.143.12.1
diff -u -r1.143.12.1 salgdi3.cxx
--- unx/source/gdi/salgdi3.cxx 12 Apr 2007 17:18:48 -0000 1.143.12.1
+++ unx/source/gdi/salgdi3.cxx 1 Aug 2007 10:28:21 -0000
@@ -795,7 +795,10 @@
// set clipping
if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
+ {
+ XOffsetRegion(pClipRegion_, -m_nXOffset, -m_nYOffset);
rRenderPeer.SetPictureClipRegion( aDst, pClipRegion_ );
+ }
ServerFont& rFont = rLayout.GetServerFont();
X11GlyphPeer& rGlyphPeer = X11GlyphCache::GetInstance().GetPeer();
@@ -820,7 +823,7 @@
for( int i = 0; i < nGlyphs; ++i )
aRenderAry[ i ] = rGlyphPeer.GetGlyphId( rFont, aGlyphAry[i] );
rRenderPeer.CompositeString32( rEntry.m_aPicture, aDst,
- aGlyphSet, aPos.X(), aPos.Y(), aRenderAry, nGlyphs );
+ aGlyphSet, aPos.X() - m_nXOffset, aPos.Y() - m_nYOffset, aRenderAry, nGlyphs );
}
// cleanup
Index: unx/inc/salgdi.h
===================================================================
RCS file: /cvs/gsl/vcl/unx/inc/salgdi.h,v
retrieving revision 1.39
diff -u -r1.39 salgdi.h
--- unx/inc/salgdi.h 14 Nov 2006 15:24:32 -0000 1.39
+++ unx/inc/salgdi.h 1 Aug 2007 10:35:02 -0000
@@ -90,6 +90,8 @@
SalColormap *m_pDeleteColormap;
Drawable hDrawable_; // use
int m_nScreen;
+ int m_nXOffset;
+ int m_nYOffset;
void* pRenderFormat_;
XLIB_Region pPaintRegion_;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]