summaryrefslogtreecommitdiffstats
path: root/avmedia
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-01-25 20:59:58 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-01-27 13:39:31 +0100
commitac9789dbb36f45dcc1caf7dd2951353b1574c8ea (patch)
tree320145e75c0b59160f7c255641dafaf9e5c6a881 /avmedia
parenttdf#139147 sw outline UI: allow clearing of custom list format (diff)
downloadcore-ac9789dbb36f45dcc1caf7dd2951353b1574c8ea.tar.gz
core-ac9789dbb36f45dcc1caf7dd2951353b1574c8ea.zip
tdf#139609 avoid fetching unnecessary xid under gtk3
because of the side effects using a bare GtkGrid as m_pSocket in vcl/unx/gtk3/gtk3gtkobject.cxx is perhaps a poor choice, getting its xid causes poor side effects wrt events belonging to its child widgets getting delivered to the SalFrame widget, so duplicate scrolling after showing a opengl slide and/or showing a video and lots of flickering we're (generally at least) not using the xid under gtk3 so don't set it unless it's explicitly asked for. Happily the gtk Player::createPlayerWindow doesn't use its arg[0] xid in any case, so don't bother setting it for that backend. Change-Id: I1c59a607a332635091782c3b49de10647558f301 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109941 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> and... use an accessor for SystemEnvData::aWindow with an eye to making it on-demand Change-Id: If6cefd68a336dc6afe23591c857bd71034215b54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109929 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110005 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'avmedia')
-rw-r--r--avmedia/source/gstreamer/gstplayer.cxx11
-rw-r--r--avmedia/source/viewer/mediawindow_impl.cxx8
2 files changed, 14 insertions, 5 deletions
diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx
index 932e1dd1c6e1..9bc8920fd2d6 100644
--- a/avmedia/source/gstreamer/gstplayer.cxx
+++ b/avmedia/source/gstreamer/gstplayer.cxx
@@ -880,11 +880,14 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co
g_object_set(G_OBJECT(mpPlaybin), "video-sink", pVideosink, nullptr);
g_object_set(G_OBJECT(mpPlaybin), "force-aspect-ratio", FALSE, nullptr);
- mnWindowID = pEnvData->aWindow;
- mpDisplay = pEnvData->pDisplay;
- SAL_INFO( "avmedia.gstreamer", AVVERSION "set window id to " << static_cast<int>(mnWindowID) << " XOverlay " << mpXOverlay);
+ if (!mbUseGtkSink)
+ {
+ mnWindowID = pEnvData->GetWindowHandle(pParentWindow->ImplGetFrame());
+ mpDisplay = pEnvData->pDisplay;
+ SAL_INFO( "avmedia.gstreamer", AVVERSION "set window id to " << static_cast<int>(mnWindowID) << " XOverlay " << mpXOverlay);
+ }
gst_element_set_state( mpPlaybin, GST_STATE_PAUSED );
- if ( mpXOverlay != nullptr )
+ if (!mbUseGtkSink && mpXOverlay)
gst_video_overlay_set_window_handle( mpXOverlay, mnWindowID );
}
diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx
index 01c25c291ec5..dec4d00a52f1 100644
--- a/avmedia/source/viewer/mediawindow_impl.cxx
+++ b/avmedia/source/viewer/mediawindow_impl.cxx
@@ -34,6 +34,7 @@
#include <unotools/securityoptions.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/svapp.hxx>
+#include <vcl/sysdata.hxx>
#include <vcl/commandevent.hxx>
#include <vcl/event.hxx>
#include <vcl/ptrstyle.hxx>
@@ -420,7 +421,12 @@ void MediaWindowImpl::onURLChanged()
const Point aPoint;
const Size aSize(mpChildWindow->GetSizePixel());
- aArgs[0] <<= mpChildWindow->GetParentWindowHandle();
+ sal_IntPtr nParentWindowHandle(0);
+ const SystemEnvData* pEnvData = mpChildWindow->GetSystemData();
+ // tdf#139609 gtk doesn't need the handle, and fetching it is undesirable
+ if (!pEnvData || pEnvData->toolkit != SystemEnvData::Toolkit::Gtk3)
+ nParentWindowHandle = mpChildWindow->GetParentWindowHandle();
+ aArgs[0] <<= nParentWindowHandle;
aArgs[1] <<= awt::Rectangle(aPoint.X(), aPoint.Y(), aSize.Width(), aSize.Height());
aArgs[2] <<= reinterpret_cast<sal_IntPtr>(mpChildWindow.get());