summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorQuentin Glidic2019-02-20 10:28:32 +0100
committerQuentin Glidic2019-02-20 10:28:32 +0100
commitbe58958272898b3a928b1fe48bf8f13dd933f880 (patch)
tree0b82c07e67c9c3ecd4fe831ea7cae1c20d3c5cb8 /packages
parent74c1d880ffb79fca605162054df191e3b1391a22 (diff)
downloadsardemff7-pending-be58958272898b3a928b1fe48bf8f13dd933f880.tar.xz
nightly,daily: Update GTK+2 removal patch
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Diffstat (limited to 'packages')
-rw-r--r--packages/mail-client/daily/files/gtk2less.patch416
-rw-r--r--packages/net-www/nightly/files/gtk2less.patch416
2 files changed, 134 insertions, 698 deletions
diff --git a/packages/mail-client/daily/files/gtk2less.patch b/packages/mail-client/daily/files/gtk2less.patch
index 25f7c85..38acf09 100644
--- a/packages/mail-client/daily/files/gtk2less.patch
+++ b/packages/mail-client/daily/files/gtk2less.patch
@@ -1,422 +1,140 @@
-From 5ac45581ae5c1cb42a3bc4748fcfae5f67f6ae56 Mon Sep 17 00:00:00 2001
+From e32d3fd40d23b326223dde534cbe1baa25887af8 Mon Sep 17 00:00:00 2001
From: Quentin Glidic <sardemff7+git@sardemff7.net>
Date: Wed, 12 Dec 2018 21:47:34 +0100
Subject: [PATCH] Less GTK+2
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
---
- dom/plugins/ipc/PluginInstanceChild.cpp | 27 +--
- dom/plugins/ipc/PluginInstanceChild.h | 7 -
- dom/plugins/ipc/PluginModuleChild.cpp | 263 ------------------------
- dom/plugins/ipc/PluginModuleChild.h | 8 -
- 4 files changed, 1 insertion(+), 304 deletions(-)
+ dom/plugins/ipc/PluginInstanceChild.cpp | 6 +++---
+ dom/plugins/ipc/PluginInstanceChild.h | 4 ++--
+ dom/plugins/ipc/PluginModuleChild.cpp | 12 ++++++------
+ dom/plugins/ipc/PluginModuleChild.h | 2 +-
+ 4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/dom/plugins/ipc/PluginInstanceChild.cpp b/dom/plugins/ipc/PluginInstanceChild.cpp
-index 76b0a14636e8..4e7e26a967e7 100644
+index 172c08837376..1eba79c27d1f 100644
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
-@@ -46,14 +46,7 @@ using namespace mozilla::gfx;
+@@ -46,7 +46,7 @@ using namespace mozilla::gfx;
using namespace mozilla::widget;
using namespace std;
-#ifdef MOZ_WIDGET_GTK
--
--#include <gtk/gtk.h>
--#include <gdk/gdkx.h>
--#include <gdk/gdk.h>
--#include "gtk2xtbin.h"
--
--#elif defined(OS_WIN)
-+#if defined(OS_WIN)
++#if 0 && defined(MOZ_WIDGET_GTK)
- #include <windows.h>
- #include <windowsx.h>
-@@ -194,11 +187,7 @@ PluginInstanceChild::PluginInstanceChild(
+ # include <gtk/gtk.h>
+ # include <gdk/gdkx.h>
+@@ -194,7 +194,7 @@ PluginInstanceChild::PluginInstanceChild(
#if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
mWindow.ws_info = &mWsInfo;
memset(&mWsInfo, 0, sizeof(mWsInfo));
--#ifdef MOZ_WIDGET_GTK
-- mWsInfo.display = nullptr;
--#else
+-# ifdef MOZ_WIDGET_GTK
++# if 0 && defined(MOZ_WIDGET_GTK)
+ mWsInfo.display = nullptr;
+ # else
mWsInfo.display = DefaultXDisplay();
--#endif
- #endif // MOZ_X11 && XP_UNIX && !XP_MACOSX
- #if defined(OS_WIN)
- InitPopupMenuHook();
-@@ -1221,20 +1210,6 @@ mozilla::ipc::IPCResult PluginInstanceChild::AnswerNPP_SetWindow(
+@@ -1221,7 +1221,7 @@ mozilla::ipc::IPCResult PluginInstanceChild::AnswerNPP_SetWindow(
}
bool PluginInstanceChild::Initialize() {
-#ifdef MOZ_WIDGET_GTK
-- if (mWsInfo.display) {
-- // Already initialized
-- return true;
-- }
--
-- // Request for windowless plugins is set in newp(), before this call.
-- if (mWindow.type == NPWindowTypeWindow) {
-- return false;
-- }
--
-- mWsInfo.display = DefaultXDisplay();
--#endif
--
- #if defined(XP_MACOSX) && defined(__i386__)
- // If an i386 Mac OS X plugin has selected the Carbon event model then
- // we have to fail. We do not support putting Carbon event model plugins
++#if 0 && defined(MOZ_WIDGET_GTK)
+ if (mWsInfo.display) {
+ // Already initialized
+ return true;
diff --git a/dom/plugins/ipc/PluginInstanceChild.h b/dom/plugins/ipc/PluginInstanceChild.h
-index abdca763321a..455db166cb55 100644
+index 3a209b220ee9..232eaaff1762 100644
--- a/dom/plugins/ipc/PluginInstanceChild.h
+++ b/dom/plugins/ipc/PluginInstanceChild.h
-@@ -34,10 +34,6 @@
+@@ -34,7 +34,7 @@
#include <map>
-#ifdef MOZ_WIDGET_GTK
--#include "gtk2xtbin.h"
--#endif
--
- class gfxASurface;
++#if 0 && defined(MOZ_WIDGET_GTK)
+ # include "gtk2xtbin.h"
+ #endif
- namespace mozilla {
-@@ -377,9 +373,6 @@ class PluginInstanceChild : public PPluginInstanceChild {
+@@ -369,7 +369,7 @@ class PluginInstanceChild : public PPluginInstanceChild {
#if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
NPSetWindowCallbackStruct mWsInfo;
--#ifdef MOZ_WIDGET_GTK
-- XtClient mXtClient;
--#endif
+-# ifdef MOZ_WIDGET_GTK
++# if 0 && defined(MOZ_WIDGET_GTK)
+ XtClient mXtClient;
+ # endif
#elif defined(OS_WIN)
- HWND mPluginWindowHWND;
- WNDPROC mPluginWndProc;
diff --git a/dom/plugins/ipc/PluginModuleChild.cpp b/dom/plugins/ipc/PluginModuleChild.cpp
-index 5c0bc18b1977..a57ab3248616 100644
+index 8753e424ce3f..8451352fc6e0 100644
--- a/dom/plugins/ipc/PluginModuleChild.cpp
+++ b/dom/plugins/ipc/PluginModuleChild.cpp
-@@ -12,10 +12,6 @@
+@@ -12,7 +12,7 @@
#include "mozilla/ipc/MessageChannel.h"
-#ifdef MOZ_WIDGET_GTK
--#include <gtk/gtk.h>
--#endif
--
- #include "nsIFile.h"
++#if 0 && defined(MOZ_WIDGET_GTK)
+ # include <gtk/gtk.h>
+ #endif
- #include "pratom.h"
-@@ -99,9 +95,6 @@ PluginModuleChild::PluginModuleChild(bool aIsChrome)
+@@ -99,7 +99,7 @@ PluginModuleChild::PluginModuleChild(bool aIsChrome)
#if defined(OS_WIN) || defined(OS_MACOSX)
,
mGetEntryPointsFunc(0)
-#elif defined(MOZ_WIDGET_GTK)
-- ,
-- mNestedLoopTimerId(0)
- #endif
- #ifdef OS_WIN
++#elif 0 && defined(MOZ_WIDGET_GTK)
,
-@@ -330,210 +323,6 @@ bool PluginModuleChild::InitForChrome(const std::string& aPluginFilename,
+ mNestedLoopTimerId(0)
+ #endif
+@@ -330,7 +330,7 @@ bool PluginModuleChild::InitForChrome(const std::string& aPluginFilename,
return true;
}
-#if defined(MOZ_WIDGET_GTK)
--
--typedef void (*GObjectDisposeFn)(GObject*);
--typedef gboolean (*GtkWidgetScrollEventFn)(GtkWidget*, GdkEventScroll*);
--typedef void (*GtkPlugEmbeddedFn)(GtkPlug*);
--
--static GObjectDisposeFn real_gtk_plug_dispose;
--static GtkPlugEmbeddedFn real_gtk_plug_embedded;
--
--static void undo_bogus_unref(gpointer data, GObject* object,
-- gboolean is_last_ref) {
-- if (!is_last_ref) // recursion in g_object_ref
-- return;
--
-- g_object_ref(object);
--}
--
--static void wrap_gtk_plug_dispose(GObject* object) {
-- // Work around Flash Player bug described in bug 538914.
-- //
-- // This function is called during gtk_widget_destroy and/or before
-- // the object's last reference is removed. A reference to the
-- // object is held during the call so the ref count should not drop
-- // to zero. However, Flash Player tries to destroy the GtkPlug
-- // using g_object_unref instead of gtk_widget_destroy. The
-- // reference that Flash is removing actually belongs to the
-- // GtkPlug. During real_gtk_plug_dispose, the GtkPlug removes its
-- // reference.
-- //
-- // A toggle ref is added to prevent premature deletion of the object
-- // caused by Flash Player's extra unref, and to detect when there are
-- // unexpectedly no other references.
-- g_object_add_toggle_ref(object, undo_bogus_unref, nullptr);
-- (*real_gtk_plug_dispose)(object);
-- g_object_remove_toggle_ref(object, undo_bogus_unref, nullptr);
--}
--
--static gboolean gtk_plug_scroll_event(GtkWidget* widget,
-- GdkEventScroll* gdk_event) {
-- if (!gtk_widget_is_toplevel(widget)) // in same process as its GtkSocket
-- return FALSE; // event not handled; propagate to GtkSocket
--
-- GdkWindow* socket_window = gtk_plug_get_socket_window(GTK_PLUG(widget));
-- if (!socket_window) return FALSE;
--
-- // Propagate the event to the embedder.
-- GdkScreen* screen = gdk_window_get_screen(socket_window);
-- GdkWindow* plug_window = gtk_widget_get_window(widget);
-- GdkWindow* event_window = gdk_event->window;
-- gint x = gdk_event->x;
-- gint y = gdk_event->y;
-- unsigned int button;
-- unsigned int button_mask = 0;
-- XEvent xevent;
-- Display* dpy = GDK_WINDOW_XDISPLAY(socket_window);
--
-- /* Translate the event coordinates to the plug window,
-- * which should be aligned with the socket window.
-- */
-- while (event_window != plug_window) {
-- gint dx, dy;
--
-- gdk_window_get_position(event_window, &dx, &dy);
-- x += dx;
-- y += dy;
--
-- event_window = gdk_window_get_parent(event_window);
-- if (!event_window) return FALSE;
-- }
--
-- switch (gdk_event->direction) {
-- case GDK_SCROLL_UP:
-- button = 4;
-- button_mask = Button4Mask;
-- break;
-- case GDK_SCROLL_DOWN:
-- button = 5;
-- button_mask = Button5Mask;
-- break;
-- case GDK_SCROLL_LEFT:
-- button = 6;
-- break;
-- case GDK_SCROLL_RIGHT:
-- button = 7;
-- break;
-- default:
-- return FALSE; // unknown GdkScrollDirection
-- }
--
-- memset(&xevent, 0, sizeof(xevent));
-- xevent.xbutton.type = ButtonPress;
-- xevent.xbutton.window = gdk_x11_window_get_xid(socket_window);
-- xevent.xbutton.root =
-- gdk_x11_window_get_xid(gdk_screen_get_root_window(screen));
-- xevent.xbutton.subwindow = gdk_x11_window_get_xid(plug_window);
-- xevent.xbutton.time = gdk_event->time;
-- xevent.xbutton.x = x;
-- xevent.xbutton.y = y;
-- xevent.xbutton.x_root = gdk_event->x_root;
-- xevent.xbutton.y_root = gdk_event->y_root;
-- xevent.xbutton.state = gdk_event->state;
-- xevent.xbutton.button = button;
-- xevent.xbutton.same_screen = True;
--
-- gdk_error_trap_push();
--
-- XSendEvent(dpy, xevent.xbutton.window, True, ButtonPressMask, &xevent);
--
-- xevent.xbutton.type = ButtonRelease;
-- xevent.xbutton.state |= button_mask;
-- XSendEvent(dpy, xevent.xbutton.window, True, ButtonReleaseMask, &xevent);
--
-- gdk_display_sync(gdk_screen_get_display(screen));
-- gdk_error_trap_pop();
--
-- return TRUE; // event handled
--}
--
--static void wrap_gtk_plug_embedded(GtkPlug* plug) {
-- GdkWindow* socket_window = gtk_plug_get_socket_window(plug);
-- if (socket_window) {
-- if (gtk_check_version(2, 18, 7) != nullptr // older
-- && g_object_get_data(G_OBJECT(socket_window),
-- "moz-existed-before-set-window")) {
-- // Add missing reference for
-- // 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) {
-- (*real_gtk_plug_embedded)(plug);
-- }
--}
--
--//
--// The next four constants are knobs that can be tuned. They trade
--// off potential UI lag from delayed event processing with CPU time.
--//
--static const gint kNestedLoopDetectorPriority = G_PRIORITY_HIGH_IDLE;
--// 90ms so that we can hopefully break livelocks before the user
--// notices UI lag (100ms)
--static const guint kNestedLoopDetectorIntervalMs = 90;
--
--static const gint kBrowserEventPriority = G_PRIORITY_HIGH_IDLE;
--static const guint kBrowserEventIntervalMs = 10;
--
--// static
--gboolean PluginModuleChild::DetectNestedEventLoop(gpointer data) {
-- PluginModuleChild* pmc = static_cast<PluginModuleChild*>(data);
--
-- MOZ_ASSERT(0 != pmc->mNestedLoopTimerId, "callback after descheduling");
-- MOZ_ASSERT(pmc->mTopLoopDepth < g_main_depth(),
-- "not canceled before returning to main event loop!");
--
-- PLUGIN_LOG_DEBUG(("Detected nested glib event loop"));
--
-- // just detected a nested loop; start a timer that will
-- // periodically rpc-call back into the browser and process some
-- // events
-- pmc->mNestedLoopTimerId = g_timeout_add_full(
-- kBrowserEventPriority, kBrowserEventIntervalMs,
-- PluginModuleChild::ProcessBrowserEvents, data, nullptr);
-- // cancel the nested-loop detection timer
-- return FALSE;
--}
--
--// static
--gboolean PluginModuleChild::ProcessBrowserEvents(gpointer data) {
-- PluginModuleChild* pmc = static_cast<PluginModuleChild*>(data);
--
-- MOZ_ASSERT(pmc->mTopLoopDepth < g_main_depth(),
-- "not canceled before returning to main event loop!");
--
-- pmc->CallProcessSomeEvents();
--
-- return TRUE;
--}
--
--void PluginModuleChild::EnteredCxxStack() {
-- MOZ_ASSERT(0 == mNestedLoopTimerId, "previous timer not descheduled");
--
-- mNestedLoopTimerId = g_timeout_add_full(
-- kNestedLoopDetectorPriority, kNestedLoopDetectorIntervalMs,
-- PluginModuleChild::DetectNestedEventLoop, this, nullptr);
--
--#ifdef DEBUG
-- mTopLoopDepth = g_main_depth();
--#endif
--}
--
--void PluginModuleChild::ExitedCxxStack() {
-- MOZ_ASSERT(0 < mNestedLoopTimerId, "nested loop timeout not scheduled");
--
-- g_source_remove(mNestedLoopTimerId);
-- mNestedLoopTimerId = 0;
--}
--
--#endif
--
- mozilla::ipc::IPCResult PluginModuleChild::RecvSetParentHangTimeout(
- const uint32_t& aSeconds) {
- #ifdef XP_WIN
-@@ -550,44 +339,6 @@ bool PluginModuleChild::ShouldContinueFromReplyTimeout() {
++#if 0 && defined(MOZ_WIDGET_GTK)
+
+ typedef void (*GObjectDisposeFn)(GObject*);
+ typedef gboolean (*GtkWidgetScrollEventFn)(GtkWidget*, GdkEventScroll*);
+@@ -550,7 +550,7 @@ bool PluginModuleChild::ShouldContinueFromReplyTimeout() {
}
bool PluginModuleChild::InitGraphics() {
-#if defined(MOZ_WIDGET_GTK)
-- // Work around plugins that don't interact well with GDK
-- // client-side windows.
-- PR_SetEnv("GDK_NATIVE_WINDOWS=1");
--
-- gtk_init(0, 0);
--
-- // GtkPlug is a static class so will leak anyway but this ref makes sure.
-- gpointer gtk_plug_class = g_type_class_ref(GTK_TYPE_PLUG);
--
-- // The dispose method is a good place to hook into the destruction process
-- // because the reference count should be 1 the last time dispose is
-- // called. (Toggle references wouldn't detect if the reference count
-- // might be higher.)
-- GObjectDisposeFn* dispose = &G_OBJECT_CLASS(gtk_plug_class)->dispose;
-- MOZ_ASSERT(*dispose != wrap_gtk_plug_dispose, "InitGraphics called twice");
-- real_gtk_plug_dispose = *dispose;
-- *dispose = wrap_gtk_plug_dispose;
--
-- // If we ever stop setting GDK_NATIVE_WINDOWS, we'll also need to
-- // gtk_widget_add_events GDK_SCROLL_MASK or GDK client-side windows will
-- // not tell us about the scroll events that it intercepts. With native
-- // windows, this is called when GDK intercepts the events; if GDK doesn't
-- // intercept the events, then the X server will instead send them directly
-- // to an ancestor (embedder) window.
-- GtkWidgetScrollEventFn* scroll_event =
-- &GTK_WIDGET_CLASS(gtk_plug_class)->scroll_event;
-- if (!*scroll_event) {
-- *scroll_event = gtk_plug_scroll_event;
-- }
--
-- GtkPlugEmbeddedFn* embedded = &GTK_PLUG_CLASS(gtk_plug_class)->embedded;
-- real_gtk_plug_embedded = *embedded;
-- *embedded = wrap_gtk_plug_embedded;
--
--#else
-- // may not be necessary on all platforms
--#endif
- #ifdef MOZ_X11
- // Do this after initializing GDK, or GDK will install its own handler.
- InstallX11ErrorHandler();
-@@ -998,10 +749,6 @@ NPError _getvalue(NPP aNPP, NPNVariable aVariable, void* aValue) {
++#if 0 && defined(MOZ_WIDGET_GTK)
+ // Work around plugins that don't interact well with GDK
+ // client-side windows.
+ PR_SetEnv("GDK_NATIVE_WINDOWS=1");
+@@ -998,7 +998,7 @@ NPError _getvalue(NPP aNPP, NPNVariable aVariable, void* aValue) {
switch (aVariable) {
// Copied from nsNPAPIPlugin.cpp
case NPNVToolkit:
-#if defined(MOZ_WIDGET_GTK)
-- *static_cast<NPNToolkitType*>(aValue) = NPNVGtk2;
-- return NPERR_NO_ERROR;
--#endif
- return NPERR_GENERIC_ERROR;
-
- case NPNVjavascriptEnabledBool:
-@@ -1024,16 +771,6 @@ NPError _getvalue(NPP aNPP, NPNVariable aVariable, void* aValue) {
++#if 0 && defined(MOZ_WIDGET_GTK)
+ *static_cast<NPNToolkitType*>(aValue) = NPNVGtk2;
+ return NPERR_NO_ERROR;
+ #endif
+@@ -1024,7 +1024,7 @@ NPError _getvalue(NPP aNPP, NPNVariable aVariable, void* aValue) {
case NPNVSupportsWindowless:
*(NPBool*)aValue = true;
return NPERR_NO_ERROR;
-#if defined(MOZ_WIDGET_GTK)
-- case NPNVxDisplay: {
-- if (!aNPP) {
-- return NPERR_INVALID_INSTANCE_ERROR;
-- }
-- return InstCast(aNPP)->NPN_GetValue(aVariable, aValue);
-- }
-- case NPNVxtAppContext:
-- return NPERR_GENERIC_ERROR;
--#endif
- default: {
- if (aNPP) {
- return InstCast(aNPP)->NPN_GetValue(aVariable, aValue);
++#if 0 && defined(MOZ_WIDGET_GTK)
+ case NPNVxDisplay: {
+ if (!aNPP) {
+ return NPERR_INVALID_INSTANCE_ERROR;
diff --git a/dom/plugins/ipc/PluginModuleChild.h b/dom/plugins/ipc/PluginModuleChild.h
-index 3e0eace74861..ad83fecceb3d 100644
+index e770c97ece87..503f28831da5 100644
--- a/dom/plugins/ipc/PluginModuleChild.h
+++ b/dom/plugins/ipc/PluginModuleChild.h
-@@ -211,14 +211,6 @@ class PluginModuleChild : public PPluginModuleChild {
+@@ -207,7 +207,7 @@ class PluginModuleChild : public PPluginModuleChild {
bool InitGraphics();
void DeinitGraphics();
-#if defined(MOZ_WIDGET_GTK)
-- static gboolean DetectNestedEventLoop(gpointer data);
-- static gboolean ProcessBrowserEvents(gpointer data);
--
-- virtual void EnteredCxxStack() override;
-- virtual void ExitedCxxStack() override;
--#endif
--
- PRLibrary* mLibrary;
- nsCString mPluginFilename; // UTF8
- int mQuirks;
++#if 0 && defined(MOZ_WIDGET_GTK)
+ static gboolean DetectNestedEventLoop(gpointer data);
+ static gboolean ProcessBrowserEvents(gpointer data);
+
--
-2.20.0
+2.20.1
diff --git a/packages/net-www/nightly/files/gtk2less.patch b/packages/net-www/nightly/files/gtk2less.patch
index 25f7c85..38acf09 100644
--- a/packages/net-www/nightly/files/gtk2less.patch
+++ b/packages/net-www/nightly/files/gtk2less.patch
@@ -1,422 +1,140 @@
-From 5ac45581ae5c1cb42a3bc4748fcfae5f67f6ae56 Mon Sep 17 00:00:00 2001
+From e32d3fd40d23b326223dde534cbe1baa25887af8 Mon Sep 17 00:00:00 2001
From: Quentin Glidic <sardemff7+git@sardemff7.net>
Date: Wed, 12 Dec 2018 21:47:34 +0100
Subject: [PATCH] Less GTK+2
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
---
- dom/plugins/ipc/PluginInstanceChild.cpp | 27 +--
- dom/plugins/ipc/PluginInstanceChild.h | 7 -
- dom/plugins/ipc/PluginModuleChild.cpp | 263 ------------------------
- dom/plugins/ipc/PluginModuleChild.h | 8 -
- 4 files changed, 1 insertion(+), 304 deletions(-)
+ dom/plugins/ipc/PluginInstanceChild.cpp | 6 +++---
+ dom/plugins/ipc/PluginInstanceChild.h | 4 ++--
+ dom/plugins/ipc/PluginModuleChild.cpp | 12 ++++++------
+ dom/plugins/ipc/PluginModuleChild.h | 2 +-
+ 4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/dom/plugins/ipc/PluginInstanceChild.cpp b/dom/plugins/ipc/PluginInstanceChild.cpp
-index 76b0a14636e8..4e7e26a967e7 100644
+index 172c08837376..1eba79c27d1f 100644
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
-@@ -46,14 +46,7 @@ using namespace mozilla::gfx;
+@@ -46,7 +46,7 @@ using namespace mozilla::gfx;
using namespace mozilla::widget;
using namespace std;
-#ifdef MOZ_WIDGET_GTK
--
--#include <gtk/gtk.h>
--#include <gdk/gdkx.h>
--#include <gdk/gdk.h>
--#include "gtk2xtbin.h"
--
--#elif defined(OS_WIN)
-+#if defined(OS_WIN)
++#if 0 && defined(MOZ_WIDGET_GTK)
- #include <windows.h>
- #include <windowsx.h>
-@@ -194,11 +187,7 @@ PluginInstanceChild::PluginInstanceChild(
+ # include <gtk/gtk.h>
+ # include <gdk/gdkx.h>
+@@ -194,7 +194,7 @@ PluginInstanceChild::PluginInstanceChild(
#if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
mWindow.ws_info = &mWsInfo;
memset(&mWsInfo, 0, sizeof(mWsInfo));
--#ifdef MOZ_WIDGET_GTK
-- mWsInfo.display = nullptr;
--#else
+-# ifdef MOZ_WIDGET_GTK
++# if 0 && defined(MOZ_WIDGET_GTK)
+ mWsInfo.display = nullptr;
+ # else
mWsInfo.display = DefaultXDisplay();
--#endif
- #endif // MOZ_X11 && XP_UNIX && !XP_MACOSX
- #if defined(OS_WIN)
- InitPopupMenuHook();
-@@ -1221,20 +1210,6 @@ mozilla::ipc::IPCResult PluginInstanceChild::AnswerNPP_SetWindow(
+@@ -1221,7 +1221,7 @@ mozilla::ipc::IPCResult PluginInstanceChild::AnswerNPP_SetWindow(
}
bool PluginInstanceChild::Initialize() {
-#ifdef MOZ_WIDGET_GTK
-- if (mWsInfo.display) {
-- // Already initialized
-- return true;
-- }
--
-- // Request for windowless plugins is set in newp(), before this call.
-- if (mWindow.type == NPWindowTypeWindow) {
-- return false;
-- }
--
-- mWsInfo.display = DefaultXDisplay();
--#endif
--
- #if defined(XP_MACOSX) && defined(__i386__)
- // If an i386 Mac OS X plugin has selected the Carbon event model then
- // we have to fail. We do not support putting Carbon event model plugins
++#if 0 && defined(MOZ_WIDGET_GTK)
+ if (mWsInfo.display) {
+ // Already initialized
+ return true;
diff --git a/dom/plugins/ipc/PluginInstanceChild.h b/dom/plugins/ipc/PluginInstanceChild.h
-index abdca763321a..455db166cb55 100644
+index 3a209b220ee9..232eaaff1762 100644
--- a/dom/plugins/ipc/PluginInstanceChild.h
+++ b/dom/plugins/ipc/PluginInstanceChild.h
-@@ -34,10 +34,6 @@
+@@ -34,7 +34,7 @@
#include <map>
-#ifdef MOZ_WIDGET_GTK
--#include "gtk2xtbin.h"
--#endif
--
- class gfxASurface;
++#if 0 && defined(MOZ_WIDGET_GTK)
+ # include "gtk2xtbin.h"
+ #endif
- namespace mozilla {
-@@ -377,9 +373,6 @@ class PluginInstanceChild : public PPluginInstanceChild {
+@@ -369,7 +369,7 @@ class PluginInstanceChild : public PPluginInstanceChild {
#if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
NPSetWindowCallbackStruct mWsInfo;
--#ifdef MOZ_WIDGET_GTK
-- XtClient mXtClient;
--#endif
+-# ifdef MOZ_WIDGET_GTK
++# if 0 && defined(MOZ_WIDGET_GTK)
+ XtClient mXtClient;
+ # endif
#elif defined(OS_WIN)
- HWND mPluginWindowHWND;
- WNDPROC mPluginWndProc;
diff --git a/dom/plugins/ipc/PluginModuleChild.cpp b/dom/plugins/ipc/PluginModuleChild.cpp
-index 5c0bc18b1977..a57ab3248616 100644
+index 8753e424ce3f..8451352fc6e0 100644
--- a/dom/plugins/ipc/PluginModuleChild.cpp
+++ b/dom/plugins/ipc/PluginModuleChild.cpp
-@@ -12,10 +12,6 @@
+@@ -12,7 +12,7 @@
#include "mozilla/ipc/MessageChannel.h"
-#ifdef MOZ_WIDGET_GTK
--#include <gtk/gtk.h>
--#endif
--
- #include "nsIFile.h"
++#if 0 && defined(MOZ_WIDGET_GTK)
+ # include <gtk/gtk.h>
+ #endif
- #include "pratom.h"
-@@ -99,9 +95,6 @@ PluginModuleChild::PluginModuleChild(bool aIsChrome)
+@@ -99,7 +99,7 @@ PluginModuleChild::PluginModuleChild(bool aIsChrome)
#if defined(OS_WIN) || defined(OS_MACOSX)
,
mGetEntryPointsFunc(0)
-#elif defined(MOZ_WIDGET_GTK)
-- ,
-- mNestedLoopTimerId(0)
- #endif
- #ifdef OS_WIN
++#elif 0 && defined(MOZ_WIDGET_GTK)
,
-@@ -330,210 +323,6 @@ bool PluginModuleChild::InitForChrome(const std::string& aPluginFilename,
+ mNestedLoopTimerId(0)
+ #endif
+@@ -330,7 +330,7 @@ bool PluginModuleChild::InitForChrome(const std::string& aPluginFilename,
return true;
}
-#if defined(MOZ_WIDGET_GTK)
--
--typedef void (*GObjectDisposeFn)(GObject*);
--typedef gboolean (*GtkWidgetScrollEventFn)(GtkWidget*, GdkEventScroll*);
--typedef void (*GtkPlugEmbeddedFn)(GtkPlug*);
--
--static GObjectDisposeFn real_gtk_plug_dispose;
--static GtkPlugEmbeddedFn real_gtk_plug_embedded;
--
--static void undo_bogus_unref(gpointer data, GObject* object,
-- gboolean is_last_ref) {
-- if (!is_last_ref) // recursion in g_object_ref
-- return;
--
-- g_object_ref(object);
--}
--
--static void wrap_gtk_plug_dispose(GObject* object) {
-- // Work around Flash Player bug described in bug 538914.
-- //
-- // This function is called during gtk_widget_destroy and/or before
-- // the object's last reference is removed. A reference to the
-- // object is held during the call so the ref count should not drop
-- // to zero. However, Flash Player tries to destroy the GtkPlug
-- // using g_object_unref instead of gtk_widget_destroy. The
-- // reference that Flash is removing actually belongs to the
-- // GtkPlug. During real_gtk_plug_dispose, the GtkPlug removes its
-- // reference.
-- //
-- // A toggle ref is added to prevent premature deletion of the object
-- // caused by Flash Player's extra unref, and to detect when there are
-- // unexpectedly no other references.
-- g_object_add_toggle_ref(object, undo_bogus_unref, nullptr);
-- (*real_gtk_plug_dispose)(object);
-- g_object_remove_toggle_ref(object, undo_bogus_unref, nullptr);
--}
--
--static gboolean gtk_plug_scroll_event(GtkWidget* widget,
-- GdkEventScroll* gdk_event) {
-- if (!gtk_widget_is_toplevel(widget)) // in same process as its GtkSocket
-- return FALSE; // event not handled; propagate to GtkSocket
--
-- GdkWindow* socket_window = gtk_plug_get_socket_window(GTK_PLUG(widget));
-- if (!socket_window) return FALSE;
--
-- // Propagate the event to the embedder.
-- GdkScreen* screen = gdk_window_get_screen(socket_window);
-- GdkWindow* plug_window = gtk_widget_get_window(widget);
-- GdkWindow* event_window = gdk_event->window;
-- gint x = gdk_event->x;
-- gint y = gdk_event->y;
-- unsigned int button;
-- unsigned int button_mask = 0;
-- XEvent xevent;
-- Display* dpy = GDK_WINDOW_XDISPLAY(socket_window);
--
-- /* Translate the event coordinates to the plug window,
-- * which should be aligned with the socket window.
-- */
-- while (event_window != plug_window) {
-- gint dx, dy;
--
-- gdk_window_get_position(event_window, &dx, &dy);
-- x += dx;
-- y += dy;
--
-- event_window = gdk_window_get_parent(event_window);
-- if (!event_window) return FALSE;
-- }
--
-- switch (gdk_event->direction) {
-- case GDK_SCROLL_UP:
-- button = 4;
-- button_mask = Button4Mask;
-- break;
-- case GDK_SCROLL_DOWN:
-- button = 5;
-- button_mask = Button5Mask;
-- break;
-- case GDK_SCROLL_LEFT:
-- button = 6;
-- break;
-- case GDK_SCROLL_RIGHT:
-- button = 7;
-- break;
-- default:
-- return FALSE; // unknown GdkScrollDirection
-- }
--
-- memset(&xevent, 0, sizeof(xevent));
-- xevent.xbutton.type = ButtonPress;
-- xevent.xbutton.window = gdk_x11_window_get_xid(socket_window);
-- xevent.xbutton.root =
-- gdk_x11_window_get_xid(gdk_screen_get_root_window(screen));
-- xevent.xbutton.subwindow = gdk_x11_window_get_xid(plug_window);
-- xevent.xbutton.time = gdk_event->time;
-- xevent.xbutton.x = x;
-- xevent.xbutton.y = y;
-- xevent.xbutton.x_root = gdk_event->x_root;
-- xevent.xbutton.y_root = gdk_event->y_root;
-- xevent.xbutton.state = gdk_event->state;
-- xevent.xbutton.button = button;
-- xevent.xbutton.same_screen = True;
--
-- gdk_error_trap_push();
--
-- XSendEvent(dpy, xevent.xbutton.window, True, ButtonPressMask, &xevent);
--
-- xevent.xbutton.type = ButtonRelease;
-- xevent.xbutton.state |= button_mask;
-- XSendEvent(dpy, xevent.xbutton.window, True, ButtonReleaseMask, &xevent);
--
-- gdk_display_sync(gdk_screen_get_display(screen));
-- gdk_error_trap_pop();
--
-- return TRUE; // event handled
--}
--
--static void wrap_gtk_plug_embedded(GtkPlug* plug) {
-- GdkWindow* socket_window = gtk_plug_get_socket_window(plug);
-- if (socket_window) {
-- if (gtk_check_version(2, 18, 7) != nullptr // older
-- && g_object_get_data(G_OBJECT(socket_window),
-- "moz-existed-before-set-window")) {
-- // Add missing reference for
-- // 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) {
-- (*real_gtk_plug_embedded)(plug);
-- }
--}
--
--//
--// The next four constants are knobs that can be tuned. They trade
--// off potential UI lag from delayed event processing with CPU time.
--//
--static const gint kNestedLoopDetectorPriority = G_PRIORITY_HIGH_IDLE;
--// 90ms so that we can hopefully break livelocks before the user
--// notices UI lag (100ms)
--static const guint kNestedLoopDetectorIntervalMs = 90;
--
--static const gint kBrowserEventPriority = G_PRIORITY_HIGH_IDLE;
--static const guint kBrowserEventIntervalMs = 10;
--
--// static
--gboolean PluginModuleChild::DetectNestedEventLoop(gpointer data) {
-- PluginModuleChild* pmc = static_cast<PluginModuleChild*>(data);
--
-- MOZ_ASSERT(0 != pmc->mNestedLoopTimerId, "callback after descheduling");
-- MOZ_ASSERT(pmc->mTopLoopDepth < g_main_depth(),
-- "not canceled before returning to main event loop!");
--
-- PLUGIN_LOG_DEBUG(("Detected nested glib event loop"));
--
-- // just detected a nested loop; start a timer that will
-- // periodically rpc-call back into the browser and process some
-- // events
-- pmc->mNestedLoopTimerId = g_timeout_add_full(
-- kBrowserEventPriority, kBrowserEventIntervalMs,
-- PluginModuleChild::ProcessBrowserEvents, data, nullptr);
-- // cancel the nested-loop detection timer
-- return FALSE;
--}
--
--// static
--gboolean PluginModuleChild::ProcessBrowserEvents(gpointer data) {
-- PluginModuleChild* pmc = static_cast<PluginModuleChild*>(data);
--
-- MOZ_ASSERT(pmc->mTopLoopDepth < g_main_depth(),
-- "not canceled before returning to main event loop!");
--
-- pmc->CallProcessSomeEvents();
--
-- return TRUE;
--}
--
--void PluginModuleChild::EnteredCxxStack() {
-- MOZ_ASSERT(0 == mNestedLoopTimerId, "previous timer not descheduled");
--
-- mNestedLoopTimerId = g_timeout_add_full(
-- kNestedLoopDetectorPriority, kNestedLoopDetectorIntervalMs,
-- PluginModuleChild::DetectNestedEventLoop, this, nullptr);
--
--#ifdef DEBUG
-- mTopLoopDepth = g_main_depth();
--#endif
--}
--
--void PluginModuleChild::ExitedCxxStack() {
-- MOZ_ASSERT(0 < mNestedLoopTimerId, "nested loop timeout not scheduled");
--
-- g_source_remove(mNestedLoopTimerId);
-- mNestedLoopTimerId = 0;
--}
--
--#endif
--
- mozilla::ipc::IPCResult PluginModuleChild::RecvSetParentHangTimeout(
- const uint32_t& aSeconds) {
- #ifdef XP_WIN
-@@ -550,44 +339,6 @@ bool PluginModuleChild::ShouldContinueFromReplyTimeout() {
++#if 0 && defined(MOZ_WIDGET_GTK)
+
+ typedef void (*GObjectDisposeFn)(GObject*);
+ typedef gboolean (*GtkWidgetScrollEventFn)(GtkWidget*, GdkEventScroll*);
+@@ -550,7 +550,7 @@ bool PluginModuleChild::ShouldContinueFromReplyTimeout() {
}
bool PluginModuleChild::InitGraphics() {
-#if defined(MOZ_WIDGET_GTK)
-- // Work around plugins that don't interact well with GDK
-- // client-side windows.
-- PR_SetEnv("GDK_NATIVE_WINDOWS=1");
--
-- gtk_init(0, 0);
--
-- // GtkPlug is a static class so will leak anyway but this ref makes sure.
-- gpointer gtk_plug_class = g_type_class_ref(GTK_TYPE_PLUG);
--
-- // The dispose method is a good place to hook into the destruction process
-- // because the reference count should be 1 the last time dispose is
-- // called. (Toggle references wouldn't detect if the reference count
-- // might be higher.)
-- GObjectDisposeFn* dispose = &G_OBJECT_CLASS(gtk_plug_class)->dispose;
-- MOZ_ASSERT(*dispose != wrap_gtk_plug_dispose, "InitGraphics called twice");
-- real_gtk_plug_dispose = *dispose;
-- *dispose = wrap_gtk_plug_dispose;
--
-- // If we ever stop setting GDK_NATIVE_WINDOWS, we'll also need to
-- // gtk_widget_add_events GDK_SCROLL_MASK or GDK client-side windows will
-- // not tell us about the scroll events that it intercepts. With native
-- // windows, this is called when GDK intercepts the events; if GDK doesn't
-- // intercept the events, then the X server will instead send them directly
-- // to an ancestor (embedder) window.
-- GtkWidgetScrollEventFn* scroll_event =
-- &GTK_WIDGET_CLASS(gtk_plug_class)->scroll_event;
-- if (!*scroll_event) {
-- *scroll_event = gtk_plug_scroll_event;
-- }
--
-- GtkPlugEmbeddedFn* embedded = &GTK_PLUG_CLASS(gtk_plug_class)->embedded;
-- real_gtk_plug_embedded = *embedded;
-- *embedded = wrap_gtk_plug_embedded;
--
--#else
-- // may not be necessary on all platforms
--#endif
- #ifdef MOZ_X11
- // Do this after initializing GDK, or GDK will install its own handler.
- InstallX11ErrorHandler();
-@@ -998,10 +749,6 @@ NPError _getvalue(NPP aNPP, NPNVariable aVariable, void* aValue) {
++#if 0 && defined(MOZ_WIDGET_GTK)
+ // Work around plugins that don't interact well with GDK
+ // client-side windows.
+ PR_SetEnv("GDK_NATIVE_WINDOWS=1");
+@@ -998,7 +998,7 @@ NPError _getvalue(NPP aNPP, NPNVariable aVariable, void* aValue) {
switch (aVariable) {
// Copied from nsNPAPIPlugin.cpp
case NPNVToolkit:
-#if defined(MOZ_WIDGET_GTK)
-- *static_cast<NPNToolkitType*>(aValue) = NPNVGtk2;
-- return NPERR_NO_ERROR;
--#endif
- return NPERR_GENERIC_ERROR;
-
- case NPNVjavascriptEnabledBool:
-@@ -1024,16 +771,6 @@ NPError _getvalue(NPP aNPP, NPNVariable aVariable, void* aValue) {
++#if 0 && defined(MOZ_WIDGET_GTK)
+ *static_cast<NPNToolkitType*>(aValue) = NPNVGtk2;
+ return NPERR_NO_ERROR;
+ #endif
+@@ -1024,7 +1024,7 @@ NPError _getvalue(NPP aNPP, NPNVariable aVariable, void* aValue) {
case NPNVSupportsWindowless:
*(NPBool*)aValue = true;
return NPERR_NO_ERROR;
-#if defined(MOZ_WIDGET_GTK)
-- case NPNVxDisplay: {
-- if (!aNPP) {
-- return NPERR_INVALID_INSTANCE_ERROR;
-- }
-- return InstCast(aNPP)->NPN_GetValue(aVariable, aValue);
-- }
-- case NPNVxtAppContext:
-- return NPERR_GENERIC_ERROR;
--#endif
- default: {
- if (aNPP) {
- return InstCast(aNPP)->NPN_GetValue(aVariable, aValue);
++#if 0 && defined(MOZ_WIDGET_GTK)
+ case NPNVxDisplay: {
+ if (!aNPP) {
+ return NPERR_INVALID_INSTANCE_ERROR;
diff --git a/dom/plugins/ipc/PluginModuleChild.h b/dom/plugins/ipc/PluginModuleChild.h
-index 3e0eace74861..ad83fecceb3d 100644
+index e770c97ece87..503f28831da5 100644
--- a/dom/plugins/ipc/PluginModuleChild.h
+++ b/dom/plugins/ipc/PluginModuleChild.h
-@@ -211,14 +211,6 @@ class PluginModuleChild : public PPluginModuleChild {
+@@ -207,7 +207,7 @@ class PluginModuleChild : public PPluginModuleChild {
bool InitGraphics();
void DeinitGraphics();
-#if defined(MOZ_WIDGET_GTK)
-- static gboolean DetectNestedEventLoop(gpointer data);
-- static gboolean ProcessBrowserEvents(gpointer data);
--
-- virtual void EnteredCxxStack() override;
-- virtual void ExitedCxxStack() override;
--#endif
--
- PRLibrary* mLibrary;
- nsCString mPluginFilename; // UTF8
- int mQuirks;
++#if 0 && defined(MOZ_WIDGET_GTK)
+ static gboolean DetectNestedEventLoop(gpointer data);
+ static gboolean ProcessBrowserEvents(gpointer data);
+
--
-2.20.0
+2.20.1