vcl/source/app/salvtables.cxx |    3 +++
 vcl/unx/gtk3/gtk3gtkinst.cxx  |   11 ++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 10a5df7de19c86b362976b4bd8cee32da4413547
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Jul 7 20:27:51 2020 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed Jul 8 20:24:23 2020 +0200

    improve weld::Widget::draw rendering a widget
    
    Change-Id: I1f49e3e7829f41d7eb4ffc137a9b0ab5c47d2cce
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98375
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 81c2e38085c3..4121165b37a5 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1137,7 +1137,10 @@ void SalInstanceWidget::draw(OutputDevice& rOutput, 
const tools::Rectangle& rRec
 {
     Size aOrigSize(m_xWidget->GetSizePixel());
     m_xWidget->SetSizePixel(rRect.GetSize());
+    rOutput.Push(PushFlags::CLIPREGION);
+    rOutput.IntersectClipRegion(rRect);
     m_xWidget->Draw(&rOutput, rRect.TopLeft(), DrawFlags::NONE);
+    rOutput.Pop();
     m_xWidget->SetSizePixel(aOrigSize);
 }
 
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index cba5c662baff..5ba41f9e028a 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -3047,10 +3047,10 @@ public:
         // has to be mapped for draw to work
         bool bAlreadyMapped = gtk_widget_get_mapped(m_pWidget);
 
-        if (!bAlreadyVisible)
-            gtk_widget_show(m_pWidget);
         if (!bAlreadyRealized)
             gtk_widget_realize(m_pWidget);
+        if (!bAlreadyVisible)
+            gtk_widget_show(m_pWidget);
         if (!bAlreadyMapped)
             gtk_widget_map(m_pWidget);
 
@@ -3065,7 +3065,7 @@ public:
                                       aOrigAllocation.y,
                                       static_cast<int>(aSize.Width()),
                                       static_cast<int>(aSize.Height()) };
-        gtk_widget_set_allocation(m_pWidget, &aNewAllocation);
+        gtk_widget_size_allocate(m_pWidget, &aNewAllocation);
 
         if (GTK_IS_CONTAINER(m_pWidget))
             gtk_container_resize_children(GTK_CONTAINER(m_pWidget));
@@ -3080,13 +3080,14 @@ public:
         cairo_destroy(cr);
 
         gtk_widget_set_allocation(m_pWidget, &aOrigAllocation);
+        gtk_widget_size_allocate(m_pWidget, &aOrigAllocation);
 
         rOutput.DrawOutDev(rRect.TopLeft(), aSize, Point(), aSize, *xOutput);
 
-        if (!bAlreadyVisible)
-            gtk_widget_hide(m_pWidget);
         if (!bAlreadyMapped)
             gtk_widget_unmap(m_pWidget);
+        if (!bAlreadyVisible)
+            gtk_widget_hide(m_pWidget);
         if (!bAlreadyRealized)
             gtk_widget_unrealize(m_pWidget);
     }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to