diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 548adda18ef6..3b5f81b74dc4 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,13 @@ +2015-07-27 Carlos Garcia Campos + + [GTK] Pass a GstInstallPluginsContext to gst_install_plugins_async + https://bugs.webkit.org/show_bug.cgi?id=147103 + + Reviewed by Philippe Normand. + + * platform/graphics/gstreamer/GUniquePtrGStreamer.h: Allow to use + GUniquePtr with GstInstallPluginsContext. + 2015-07-24 Carlos Garcia Campos [GStreamer] Crashes during plugin installation diff --git a/Source/WebCore/platform/graphics/gstreamer/GUniquePtrGStreamer.h b/Source/WebCore/platform/graphics/gstreamer/GUniquePtrGStreamer.h index c4d12b5b69aa..2c5ea6dc6d17 100644 --- a/Source/WebCore/platform/graphics/gstreamer/GUniquePtrGStreamer.h +++ b/Source/WebCore/platform/graphics/gstreamer/GUniquePtrGStreamer.h @@ -22,11 +22,13 @@ #if USE(GSTREAMER) #include +#include #include namespace WTF { WTF_DEFINE_GPTR_DELETER(GstStructure, gst_structure_free) +WTF_DEFINE_GPTR_DELETER(GstInstallPluginsContext, gst_install_plugins_context_free) } diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog index f94cc3309842..0677740be0c7 100644 --- a/Source/WebKit2/ChangeLog +++ b/Source/WebKit2/ChangeLog @@ -1,3 +1,27 @@ +2015-07-27 Carlos Garcia Campos + + [GTK] Pass a GstInstallPluginsContext to gst_install_plugins_async + https://bugs.webkit.org/show_bug.cgi?id=147103 + + Reviewed by Philippe Normand. + + This allows PackageKit to properly position the window and make it + transient to the web view window. + + * UIProcess/API/gtk/PageClientImpl.cpp: + (WebKit::PageClientImpl::setCursor): Disambiguate Cursor now that + we include gtkx.h. + (WebKit::PageClientImpl::createGstInstallPluginsContext): Create a + new GstInstallPluginsContext and set the web view window XID when + running on X11. + * UIProcess/API/gtk/PageClientImpl.h: + * UIProcess/PageClient.h: + * UIProcess/efl/WebViewEfl.h: + * UIProcess/gstreamer/WebPageProxyGStreamer.cpp: + (WebKit::WebPageProxy::requestInstallMissingMediaPlugins): Use + PageClient::createGstInstallPluginsContext() to create a new + GstInstallPluginsContext and pass it to gst_install_plugins_async(). + 2015-07-24 Anders Carlsson Networking process crash in NetworkConnectionToWebProcess::convertMainResourceLoadToDownload while attempting to download a blob diff --git a/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp b/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp index be53871cbdb1..831305021a63 100644 --- a/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp @@ -47,6 +47,11 @@ #include #include +#if PLATFORM(X11) +#include +#undef KeyPress +#endif + using namespace WebCore; namespace WebKit { @@ -132,7 +137,7 @@ void PageClientImpl::toolTipChanged(const String&, const String& newToolTip) webkitWebViewBaseSetTooltipText(WEBKIT_WEB_VIEW_BASE(m_viewWidget), newToolTip.utf8().data()); } -void PageClientImpl::setCursor(const Cursor& cursor) +void PageClientImpl::setCursor(const WebCore::Cursor& cursor) { if (!gtk_widget_get_realized(m_viewWidget)) return; @@ -427,4 +432,19 @@ void PageClientImpl::didSameDocumentNavigationForMainFrame(SameDocumentNavigatio { } +#if ENABLE(VIDEO) +GUniquePtr PageClientImpl::createGstInstallPluginsContext() +{ +#if PLATFORM(X11) + if (GDK_IS_X11_DISPLAY(gdk_display_manager_get_default_display(gdk_display_manager_get()))) { + GUniquePtr context(gst_install_plugins_context_new()); + gst_install_plugins_context_set_xid(context.get(), GDK_WINDOW_XID(gtk_widget_get_window(m_viewWidget))); + return context; + } +#endif + + return nullptr; +} +#endif + } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h b/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h index 6b2047bb3426..67b6447c783a 100644 --- a/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h +++ b/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h @@ -136,6 +136,10 @@ class PageClientImpl : public PageClient virtual void doneWithTouchEvent(const NativeWebTouchEvent&, bool wasEventHandled) override; +#if ENABLE(VIDEO) + virtual GUniquePtr createGstInstallPluginsContext() override; +#endif + // Members of PageClientImpl class GtkWidget* m_viewWidget; DefaultUndoController m_undoController; diff --git a/Source/WebKit2/UIProcess/PageClient.h b/Source/WebKit2/UIProcess/PageClient.h index b27fe36e5630..e3f8b10ddfbe 100644 --- a/Source/WebKit2/UIProcess/PageClient.h +++ b/Source/WebKit2/UIProcess/PageClient.h @@ -34,6 +34,10 @@ #include #include +#if ENABLE(VIDEO) && USE(GSTREAMER) +#include +#endif + #if PLATFORM(COCOA) #include "PluginComplexTextInputState.h" @@ -315,6 +319,10 @@ class PageClient { #if PLATFORM(MAC) virtual void didPerformActionMenuHitTest(const ActionMenuHitTestResult&, bool forImmediateAction, API::Object*) = 0; #endif + +#if ENABLE(VIDEO) && USE(GSTREAMER) + virtual GUniquePtr createGstInstallPluginsContext() = 0; +#endif }; } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/gstreamer/WebPageProxyGStreamer.cpp b/Source/WebKit2/UIProcess/gstreamer/WebPageProxyGStreamer.cpp index 0739fbbd8db0..3013482a5149 100644 --- a/Source/WebKit2/UIProcess/gstreamer/WebPageProxyGStreamer.cpp +++ b/Source/WebKit2/UIProcess/gstreamer/WebPageProxyGStreamer.cpp @@ -28,8 +28,8 @@ #if ENABLE(VIDEO) && USE(GSTREAMER) +#include "PageClient.h" #include "WebPageMessages.h" -#include namespace WebKit { @@ -38,8 +38,8 @@ void WebPageProxy::requestInstallMissingMediaPlugins(const String& details) CString detail = details.utf8(); const char* detailArray[2] = { detail.data(), nullptr }; ref(); - // FIXME: Use a proper GstInstallPluginsContext instead of nullptr. - GstInstallPluginsReturn result = gst_install_plugins_async(detailArray, nullptr, [](GstInstallPluginsReturn result, gpointer userData) { + GUniquePtr context = m_pageClient.createGstInstallPluginsContext(); + GstInstallPluginsReturn result = gst_install_plugins_async(detailArray, context.get(), [](GstInstallPluginsReturn result, gpointer userData) { RefPtr page = adoptRef(static_cast(userData)); if (page->isValid()) page->send(Messages::WebPage::DidEndRequestInstallMissingMediaPlugins(static_cast(result)));