зеркало из https://github.com/mozilla/gecko-dev.git
b=561308,539138 Realize GtkPlugs when associated with a socket for consistency with in-process behavior r=cjones
--HG-- extra : rebase_source : 96d433c381d6d560ddd566572cfc143d91113453
This commit is contained in:
Родитель
f9a8f033d8
Коммит
0ed80ea60e
|
@ -799,9 +799,11 @@ PluginInstanceChild::AnswerNPP_SetWindow(const NPRemoteWindow& aWindow)
|
||||||
&mWsInfo.visual, &mWsInfo.depth))
|
&mWsInfo.visual, &mWsInfo.depth))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (aWindow.type == NPWindowTypeWindow) {
|
|
||||||
#ifdef MOZ_WIDGET_GTK2
|
#ifdef MOZ_WIDGET_GTK2
|
||||||
if (GdkWindow* socket_window = gdk_window_lookup(aWindow.window)) {
|
if (aWindow.type == NPWindowTypeWindow
|
||||||
|
&& gtk_check_version(2,18,7) != NULL) { // older
|
||||||
|
GdkWindow* socket_window = gdk_window_lookup(aWindow.window);
|
||||||
|
if (socket_window) {
|
||||||
// A GdkWindow for the socket already exists. Need to
|
// A GdkWindow for the socket already exists. Need to
|
||||||
// workaround https://bugzilla.gnome.org/show_bug.cgi?id=607061
|
// workaround https://bugzilla.gnome.org/show_bug.cgi?id=607061
|
||||||
// See wrap_gtk_plug_embedded in PluginModuleChild.cpp.
|
// See wrap_gtk_plug_embedded in PluginModuleChild.cpp.
|
||||||
|
@ -809,8 +811,8 @@ PluginInstanceChild::AnswerNPP_SetWindow(const NPRemoteWindow& aWindow)
|
||||||
"moz-existed-before-set-window",
|
"moz-existed-before-set-window",
|
||||||
GUINT_TO_POINTER(1));
|
GUINT_TO_POINTER(1));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (mPluginIface->setwindow)
|
if (mPluginIface->setwindow)
|
||||||
(void) mPluginIface->setwindow(&mData, &mWindow);
|
(void) mPluginIface->setwindow(&mData, &mWindow);
|
||||||
|
|
|
@ -318,12 +318,18 @@ gtk_plug_scroll_event(GtkWidget *widget, GdkEventScroll *gdk_event)
|
||||||
static void
|
static void
|
||||||
wrap_gtk_plug_embedded(GtkPlug* plug) {
|
wrap_gtk_plug_embedded(GtkPlug* plug) {
|
||||||
GdkWindow* socket_window = plug->socket_window;
|
GdkWindow* socket_window = plug->socket_window;
|
||||||
if (socket_window &&
|
if (socket_window) {
|
||||||
g_object_get_data(G_OBJECT(socket_window),
|
if (gtk_check_version(2,18,7) != NULL // older
|
||||||
"moz-existed-before-set-window")) {
|
&& g_object_get_data(G_OBJECT(socket_window),
|
||||||
// Add missing reference for
|
"moz-existed-before-set-window")) {
|
||||||
// https://bugzilla.gnome.org/show_bug.cgi?id=607061
|
// Add missing reference for
|
||||||
g_object_ref(socket_window);
|
// https://bugzilla.gnome.org/show_bug.cgi?id=607061
|
||||||
|
g_object_ref(socket_window);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ensure the window exists to make this GtkPlug behave like an
|
||||||
|
// in-process GtkPlug for Flash Player. (Bugs 561308 and 539138).
|
||||||
|
gtk_widget_realize(GTK_WIDGET(plug));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*real_gtk_plug_embedded) {
|
if (*real_gtk_plug_embedded) {
|
||||||
|
@ -448,11 +454,9 @@ PluginModuleChild::InitGraphics()
|
||||||
*scroll_event = gtk_plug_scroll_event;
|
*scroll_event = gtk_plug_scroll_event;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gtk_check_version(2,18,7) != NULL) { // older
|
GtkPlugEmbeddedFn* embedded = >K_PLUG_CLASS(gtk_plug_class)->embedded;
|
||||||
GtkPlugEmbeddedFn* embedded = >K_PLUG_CLASS(gtk_plug_class)->embedded;
|
real_gtk_plug_embedded = *embedded;
|
||||||
real_gtk_plug_embedded = *embedded;
|
*embedded = wrap_gtk_plug_embedded;
|
||||||
*embedded = wrap_gtk_plug_embedded;
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(MOZ_WIDGET_QT)
|
#elif defined(MOZ_WIDGET_QT)
|
||||||
nsQAppInstance::AddRef();
|
nsQAppInstance::AddRef();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче