[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - svx/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Feb 4 06:29:19 UTC 2020


 svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx |   20 +++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 8036632b86d5294c527ae527c26548399c1e58e1
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Jan 29 15:59:41 2020 +0000
Commit:     Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Tue Feb 4 07:28:50 2020 +0100

    gtk: resizing video elements has no effect once the video has played once
    
    Change-Id: Ice8e688a7909bcfffc477479110a69e4770996d8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87697
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx
index 42e7a6a22675..e838b583af79 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx
@@ -109,8 +109,26 @@ void ViewObjectContactOfSdrMediaObj::updateMediaItem( ::avmedia::MediaItem& rIte
                 static_cast<sal_Int32>(floor(aViewRange.getMinX())), static_cast<sal_Int32>(floor(aViewRange.getMinY())),
                 static_cast<sal_Int32>(ceil(aViewRange.getMaxX())), static_cast<sal_Int32>(ceil(aViewRange.getMaxY())));
 
-            mpMediaWindow->setPosSize(aViewRectangle);
+            // mpMediaWindow contains a SalObject window and gtk won't accept
+            // the size until after the SalObject widget is shown but if we
+            // show it before setting a size then vcl will detect that the
+            // vcl::Window has no size and make it invisible instead. If we
+            // call setPosSize twice with the same size before and after show
+            // then the second attempt is a no-op as vcl caches the size.
+
+            // so call it initially with a size arbitrarily 1 pixel wider than
+            // we want so we have an initial size to make vcl happy
+            tools::Rectangle aInitialRect(aViewRectangle);
+            aInitialRect.AdjustRight(1);
+            mpMediaWindow->setPosSize(aInitialRect);
+
+            // then make it visible
             mpMediaWindow->show();
+
+            // set the final desired size which is different to let vcl send it
+            // through to gtk which will now accept it as the underlying
+            // m_pSocket of GtkSalObject::SetPosSize is now visible
+            mpMediaWindow->setPosSize(aViewRectangle);
         }
     }
 #else


More information about the Libreoffice-commits mailing list