Kaydet (Commit) 12d1a2a0 authored tarafından Miklos Vajna's avatar Miklos Vajna

tdf#92670 GtkSalGraphics::NWPaintGTKMenubar: fix modified clip rectangle

Happens only with when double buffering is enabled, and e.g. with the
oxygen GTK2 theme, but not with the default one.

Change-Id: Iad9911121e57388c84c25860413763f75e06b0ea
üst 6a0efa98
......@@ -3184,6 +3184,15 @@ bool GtkSalGraphics::NWPaintGTKToolbar(
return true;
}
/// Converts a VCL Rectangle to a GdkRectangle.
static void lcl_rectangleToGdkRectangle(const Rectangle& rRectangle, GdkRectangle& rGdkRectangle)
{
rGdkRectangle.x = rRectangle.Left();
rGdkRectangle.y = rRectangle.Top();
rGdkRectangle.width = rRectangle.GetWidth();
rGdkRectangle.height = rRectangle.GetHeight();
}
bool GtkSalGraphics::NWPaintGTKMenubar(
GdkDrawable* gdkDrawable,
ControlType, ControlPart nPart,
......@@ -3218,10 +3227,7 @@ bool GtkSalGraphics::NWPaintGTKMenubar(
for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it )
{
clipRect.x = it->Left();
clipRect.y = it->Top();
clipRect.width = it->GetWidth();
clipRect.height = it->GetHeight();
lcl_rectangleToGdkRectangle(*it, clipRect);
// handle Menubar
if( nPart == PART_ENTIRE_CONTROL )
......@@ -3241,6 +3247,10 @@ bool GtkSalGraphics::NWPaintGTKMenubar(
GTK_WIDGET(m_pWindow),
"base",
x, y, w, h );
// Do the conversion again, in case clipRect has been modified.
lcl_rectangleToGdkRectangle(*it, clipRect);
gtk_paint_box( gWidgetData[m_nXScreen].gMenubarWidget->style,
gdkDrawable,
stateType,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment