[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Dec 23 16:26:23 UTC 2019


 vcl/unx/gtk3/gtk3gtkobject.cxx |   20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

New commits:
commit 5bc2c2c1c86bbf92da4c8210e095e3a9a2928aa6
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Dec 23 15:10:11 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Dec 23 17:25:29 2019 +0100

    call gtk_widget_size_allocate explicitly
    
    otherwise native gtk sidebar widgets are not initially positioned automatically
    
    Change-Id: I835c63c9c18ebc37be57e605b82f748bcff5d1a2
    Reviewed-on: https://gerrit.libreoffice.org/85761
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtk3gtkobject.cxx b/vcl/unx/gtk3/gtk3gtkobject.cxx
index 93db53a159ec..d038a6121432 100644
--- a/vcl/unx/gtk3/gtk3gtkobject.cxx
+++ b/vcl/unx/gtk3/gtk3gtkobject.cxx
@@ -344,11 +344,25 @@ void GtkSalObjectWidgetClip::ApplyClipRegion()
     if( m_pSocket )
     {
         GtkFixed* pContainer = GTK_FIXED(gtk_widget_get_parent(m_pScrolledWindow));
-        gtk_fixed_move(pContainer, m_pScrolledWindow, m_aRect.Left() + m_aClipRect.Left(), m_aRect.Top() + m_aClipRect.Top());
+
+        GtkAllocation allocation;
+        allocation.x = m_aRect.Left() + m_aClipRect.Left();
+        allocation.y = m_aRect.Top() + m_aClipRect.Top();
         if (m_aClipRect.IsEmpty())
-            gtk_widget_set_size_request(m_pScrolledWindow, m_aRect.GetWidth(), m_aRect.GetHeight());
+        {
+            allocation.width = m_aRect.GetWidth();
+            allocation.height = m_aRect.GetHeight();
+        }
         else
-            gtk_widget_set_size_request(m_pScrolledWindow, m_aClipRect.GetWidth(), m_aClipRect.GetHeight());
+        {
+            allocation.width = m_aClipRect.GetWidth();
+            allocation.height = m_aClipRect.GetHeight();
+        }
+
+        gtk_fixed_move(pContainer, m_pScrolledWindow, allocation.x, allocation.y);
+        gtk_widget_set_size_request(m_pScrolledWindow, allocation.width, allocation.height);
+        gtk_widget_size_allocate(m_pScrolledWindow, &allocation);
+
         gtk_adjustment_set_value(gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(m_pScrolledWindow)), m_aClipRect.Left());
         gtk_adjustment_set_value(gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(m_pScrolledWindow)), m_aClipRect.Top());
     }


More information about the Libreoffice-commits mailing list