[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/unx

Miklos Vajna vmiklos at collabora.co.uk
Fri Jul 10 12:48:19 PDT 2015


 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx |   18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

New commits:
commit 7609867f60edb5eaf785ce44386e8ed28ab9e01c
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Jul 10 13:50:16 2015 +0200

    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
    (cherry picked from commit 12d1a2a08a8056df2c14ad3e75b309847989bc23)
    Reviewed-on: https://gerrit.libreoffice.org/16931
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index b0ca1c6..61a471e 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -3192,6 +3192,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,
@@ -3226,10 +3235,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 )
@@ -3249,6 +3255,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,


More information about the Libreoffice-commits mailing list