summaryrefslogtreecommitdiff
path: root/newmoon/debian/patches/UXP-eliminate-need-for-GTK-2.patch
blob: 7eaffa9396a4949e95a9bcb754182945e86d075a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# This patch was created by Gordon N. Squash.
#
# This patch can be used to eliminate the Unified XUL Platform's need for both
# GTK+ 2 and GTK+ 3, even when you are compiling UXP only to use GTK+ 3.
#
# This patch is still highly experimental.  The author of this patch has not
# yet encountered any issues with this patch, but there are no guarantees.
#
# WARNING!  This is not an official patch in any way, shape or form!  Do not
#           contact the original authors of UXP for support of this patch!
#
diff -uprN palemoon-28.12.0-original/platform/config/recurse.mk palemoon-28.12.0-patched/platform/config/recurse.mk
--- palemoon-28.12.0-original/platform/config/recurse.mk	2020-07-30 05:37:13.000000000 -0400
+++ palemoon-28.12.0-patched/platform/config/recurse.mk	2020-08-19 13:12:24.228334662 -0400
@@ -161,9 +161,9 @@ endif
 
 # Interdependencies that moz.build world don't know about yet for compilation.
 # Note some others are hardcoded or "guessed" in recursivemake.py and emitter.py
-ifeq ($(MOZ_WIDGET_TOOLKIT),gtk3)
-toolkit/library/target: widget/gtk/mozgtk/gtk3/target
-endif
+#ifeq ($(MOZ_WIDGET_TOOLKIT),gtk3)
+#toolkit/library/target: widget/gtk/mozgtk/gtk3/target
+#endif
 ifdef MOZ_LDAP_XPCOM
 ldap/target: config/external/nss/target mozglue/build/target
 toolkit/library/target: ldap/target
diff -uprN palemoon-28.12.0-original/platform/dom/ipc/moz.build palemoon-28.12.0-patched/platform/dom/ipc/moz.build
--- palemoon-28.12.0-original/platform/dom/ipc/moz.build	2020-07-30 05:37:13.000000000 -0400
+++ palemoon-28.12.0-patched/platform/dom/ipc/moz.build	2020-08-19 11:20:54.768059475 -0400
@@ -114,6 +114,7 @@ LOCAL_INCLUDES += [
     '/dom/workers',
     '/embedding/components/printingui/ipc',
     '/extensions/cookie',
+    '/extensions/spellcheck/hunspell/glue',
     '/extensions/spellcheck/src',
     '/gfx/2d',
     '/hal/sandbox',
diff -uprN palemoon-28.12.0-original/platform/dom/plugins/ipc/moz.build palemoon-28.12.0-patched/platform/dom/plugins/ipc/moz.build
--- palemoon-28.12.0-original/platform/dom/plugins/ipc/moz.build	2020-07-30 05:37:13.000000000 -0400
+++ palemoon-28.12.0-patched/platform/dom/plugins/ipc/moz.build	2020-08-18 14:55:40.548143359 -0400
@@ -121,11 +121,7 @@ LOCAL_INCLUDES += [
 
 DEFINES['FORCE_PR_LOG'] = True
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gtk3':
-    CXXFLAGS += CONFIG['TK_CFLAGS']
-else:
-    # Force build against gtk+2 for struct offsets and such.
-    CXXFLAGS += CONFIG['MOZ_GTK2_CFLAGS']
+CXXFLAGS += CONFIG['TK_CFLAGS']
 
 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 
diff -uprN palemoon-28.12.0-original/platform/dom/plugins/ipc/PluginInstanceChild.cpp palemoon-28.12.0-patched/platform/dom/plugins/ipc/PluginInstanceChild.cpp
--- palemoon-28.12.0-original/platform/dom/plugins/ipc/PluginInstanceChild.cpp	2020-07-30 05:37:13.000000000 -0400
+++ palemoon-28.12.0-patched/platform/dom/plugins/ipc/PluginInstanceChild.cpp	2020-08-19 12:33:46.736239327 -0400
@@ -52,7 +52,9 @@
 #include <gtk/gtk.h>
 #include <gdk/gdkx.h>
 #include <gdk/gdk.h>
+#if MOZ_WIDGET_GTK == 2
 #include "gtk2xtbin.h"
+#endif
 
 #elif defined(OS_WIN)
 
@@ -152,7 +154,7 @@
     , mAsyncInvalidateTask(0)
     , mCachedWindowActor(nullptr)
     , mCachedElementActor(nullptr)
-#ifdef MOZ_WIDGET_GTK
+#if MOZ_WIDGET_GTK == 2
     , mXEmbed(false)
 #endif // MOZ_WIDGET_GTK
 #if defined(OS_WIN)
@@ -201,7 +203,7 @@
 #if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
     mWindow.ws_info = &mWsInfo;
     memset(&mWsInfo, 0, sizeof(mWsInfo));
-#ifdef MOZ_WIDGET_GTK
+#if MOZ_WIDGET_GTK == 2
     mWsInfo.display = nullptr;
     mXtClient.top_widget = nullptr;
 #else
@@ -610,7 +612,7 @@
             return NPERR_GENERIC_ERROR;
 
         NPWindowType newWindowType = windowed ? NPWindowTypeWindow : NPWindowTypeDrawable;
-#ifdef MOZ_WIDGET_GTK
+#if MOZ_WIDGET_GTK == 2
         if (mWindow.type != newWindowType && mWsInfo.display) {
            // plugin type has been changed but we already have a valid display
            // so update it for the recent plugin mode
@@ -1202,7 +1204,7 @@
                       aWindow.x, aWindow.y,
                       aWindow.width, aWindow.height));
 
-#ifdef MOZ_WIDGET_GTK
+#if MOZ_WIDGET_GTK == 2
     if (mXEmbed) {
         mWindow.window = reinterpret_cast<void*>(aWindow.window);
     }
@@ -1231,7 +1233,7 @@
   if (!mWindow.window)
       return;
 
-#ifdef MOZ_WIDGET_GTK
+#if MOZ_WIDGET_GTK == 2
   if (mXtClient.top_widget) {     
       xt_client_unrealize(&mXtClient);
       xt_client_destroy(&mXtClient); 
@@ -1313,7 +1315,7 @@
         CreateWindow(aWindow);
     }
 
-#ifdef MOZ_WIDGET_GTK
+#if MOZ_WIDGET_GTK == 2
     if (mXEmbed && gtk_check_version(2,18,7) != nullptr) { // older
         if (aWindow.type == NPWindowTypeWindow) {
             GdkWindow* socket_window = gdk_window_lookup(static_cast<GdkNativeWindow>(aWindow.window));
@@ -1439,7 +1441,7 @@
 bool
 PluginInstanceChild::Initialize()
 {
-#ifdef MOZ_WIDGET_GTK
+#if MOZ_WIDGET_GTK == 2
     NPError rv;
 
     if (mWsInfo.display) {
@@ -4650,7 +4652,7 @@
 
     mPendingAsyncCalls.Clear();
     
-#ifdef MOZ_WIDGET_GTK
+#if MOZ_WIDGET_GTK == 2
     if (mWindow.type == NPWindowTypeWindow && !mXEmbed) {
       xt_client_xloop_destroy();
     }
diff -uprN palemoon-28.12.0-original/platform/dom/plugins/ipc/PluginInstanceChild.h palemoon-28.12.0-patched/platform/dom/plugins/ipc/PluginInstanceChild.h
--- palemoon-28.12.0-original/platform/dom/plugins/ipc/PluginInstanceChild.h	2020-07-30 05:37:13.000000000 -0400
+++ palemoon-28.12.0-patched/platform/dom/plugins/ipc/PluginInstanceChild.h	2020-08-19 11:51:36.556135241 -0400
@@ -35,7 +35,7 @@
 
 #include <map>
 
-#ifdef MOZ_WIDGET_GTK
+#if MOZ_WIDGET_GTK == 2
 #include "gtk2xtbin.h"
 #endif
 
@@ -458,7 +458,7 @@ private:
 
 #if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
     NPSetWindowCallbackStruct mWsInfo;
-#ifdef MOZ_WIDGET_GTK
+#if MOZ_WIDGET_GTK == 2
     bool mXEmbed;
     XtClient mXtClient;
 #endif
diff -uprN palemoon-28.12.0-original/platform/dom/plugins/ipc/PluginModuleChild.cpp palemoon-28.12.0-patched/platform/dom/plugins/ipc/PluginModuleChild.cpp
--- palemoon-28.12.0-original/platform/dom/plugins/ipc/PluginModuleChild.cpp	2020-07-30 05:37:13.000000000 -0400
+++ palemoon-28.12.0-patched/platform/dom/plugins/ipc/PluginModuleChild.cpp	2020-08-19 12:52:01.880284378 -0400
@@ -13,6 +13,7 @@
 
 #ifdef MOZ_WIDGET_GTK
 #include <gtk/gtk.h>
+#include <gtk/gtkx.h>
 #endif
 
 #include "nsIFile.h"
@@ -1094,7 +1095,7 @@ _getvalue(NPP aNPP,
         case NPNVSupportsWindowless:
             *(NPBool*)aValue = PluginModuleChild::GetChrome()->Settings().supportsWindowless();
             return NPERR_NO_ERROR;
-#if defined(MOZ_WIDGET_GTK)
+#if MOZ_WIDGET_GTK == 2
         case NPNVxDisplay: {
             if (aNPP) {
                 return InstCast(aNPP)->NPN_GetValue(aVariable, aValue);
diff -uprN palemoon-28.12.0-original/platform/dom/plugins/test/testplugin/testplugin.mozbuild palemoon-28.12.0-patched/platform/dom/plugins/test/testplugin/testplugin.mozbuild
--- palemoon-28.12.0-original/platform/dom/plugins/test/testplugin/testplugin.mozbuild	2020-07-30 05:37:13.000000000 -0400
+++ palemoon-28.12.0-patched/platform/dom/plugins/test/testplugin/testplugin.mozbuild	2020-08-18 14:56:31.168144491 -0400
@@ -49,13 +49,20 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' and '64' in CONFIG['OS_TEST']:
     OS_LIBS += ['-framework Carbon']
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'):
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in 'gtk2':
     CXXFLAGS += CONFIG['MOZ_GTK2_CFLAGS']
     CFLAGS += CONFIG['MOZ_GTK2_CFLAGS']
     OS_LIBS += CONFIG['MOZ_GTK2_LIBS']
     OS_LIBS += CONFIG['XLDFLAGS']
     OS_LIBS += CONFIG['XLIBS']
     OS_LIBS += CONFIG['XEXT_LIBS']
+elif CONFIG['MOZ_WIDGET_TOOLKIT'] in 'gtk3':
+    CXXFLAGS += CONFIG['MOZ_GTK3_CFLAGS']
+    CFLAGS += CONFIG['MOZ_GTK3_CFLAGS']
+    OS_LIBS += CONFIG['MOZ_GTK3_LIBS']
+    OS_LIBS += CONFIG['XLDFLAGS']
+    OS_LIBS += CONFIG['XLIBS']
+    OS_LIBS += CONFIG['XEXT_LIBS']
 
 if CONFIG['_MSC_VER']:
     # This is intended as a temporary hack to support building with VS2015.
diff -uprN palemoon-28.12.0-original/platform/old-configure.in palemoon-28.12.0-patched/platform/old-configure.in
--- palemoon-28.12.0-original/platform/old-configure.in	2020-07-30 05:37:13.000000000 -0400
+++ palemoon-28.12.0-patched/platform/old-configure.in	2020-08-18 14:54:27.952141735 -0400
@@ -2324,8 +2324,6 @@ if test "$COMPILE_ENVIRONMENT"; then
   fi
   if test "$MOZ_WIDGET_TOOLKIT" = gtk2; then
     GLIB_VERSION_MAX_ALLOWED=$GLIB_VERSION_MIN_REQUIRED
-  fi
-  if test "$MOZ_ENABLE_GTK"; then
     if test "$MOZ_X11"; then
       GDK_PACKAGES=gdk-x11-2.0
     fi
@@ -2334,8 +2332,6 @@ if test "$COMPILE_ENVIRONMENT"; then
 
     PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 >= $GLIB_VERSION gobject-2.0 $GDK_PACKAGES)
     MOZ_GTK2_CFLAGS="-I${_topsrcdir}/widget/gtk/compat $MOZ_GTK2_CFLAGS"
-  fi
-  if test "$MOZ_WIDGET_TOOLKIT" = gtk2; then
     TK_CFLAGS=$MOZ_GTK2_CFLAGS
     TK_LIBS=$MOZ_GTK2_LIBS
   fi
diff -uprN palemoon-28.12.0-original/platform/toolkit/library/moz.build palemoon-28.12.0-patched/platform/toolkit/library/moz.build
--- palemoon-28.12.0-original/platform/toolkit/library/moz.build	2020-07-30 05:37:13.000000000 -0400
+++ palemoon-28.12.0-patched/platform/toolkit/library/moz.build	2020-08-19 14:14:17.820487430 -0400
@@ -117,10 +117,10 @@ if CONFIG['USE_ICU']:
         'icu',
     ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
-    USE_LIBS += [
-        'mozgtk_stub',
-    ]
+#if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
+#    USE_LIBS += [
+#        'mozgtk_stub',
+#    ]
 
 if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT'] or \
         CONFIG['MOZ_TREE_FREETYPE']:
@@ -231,16 +231,18 @@ if CONFIG['MOZ_ENABLE_DBUS']:
     OS_LIBS += CONFIG['MOZ_DBUS_GLIB_LIBS']
 
 if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
-    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
-        OS_LIBS += [l for l in CONFIG['TK_LIBS']
-            if l not in ('-lgtk-3', '-lgdk-3')]
-    else:
-        OS_LIBS += CONFIG['TK_LIBS']
+#    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
+#        OS_LIBS += [l for l in CONFIG['TK_LIBS']
+#            if l not in ('-lgtk-3', '-lgdk-3')]
+#    else:
+#        OS_LIBS += CONFIG['TK_LIBS']
+    OS_LIBS += CONFIG['TK_LIBS']
     OS_LIBS += CONFIG['XLDFLAGS']
     OS_LIBS += CONFIG['XLIBS']
     OS_LIBS += CONFIG['XEXT_LIBS']
     OS_LIBS += CONFIG['MOZ_PANGO_LIBS']
-    OS_LIBS += CONFIG['XT_LIBS']
+    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk2':
+        OS_LIBS += CONFIG['XT_LIBS']
     OS_LIBS += [
         'gthread-2.0',
     ]
diff -uprN palemoon-28.12.0-original/platform/widget/gtk/moz.build palemoon-28.12.0-patched/platform/widget/gtk/moz.build
--- palemoon-28.12.0-original/platform/widget/gtk/moz.build	2020-07-30 05:37:13.000000000 -0400
+++ palemoon-28.12.0-patched/platform/widget/gtk/moz.build	2020-08-19 12:31:16.304233138 -0400
@@ -4,8 +4,8 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
-    DIRS += ['mozgtk']
+#if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
+#    DIRS += ['mozgtk']
 
 EXPORTS += [
     'mozcontainer.h',
diff -uprN palemoon-28.12.0-original/platform/widget/moz.build palemoon-28.12.0-patched/platform/widget/moz.build
--- palemoon-28.12.0-original/platform/widget/moz.build	2020-07-30 05:37:13.000000000 -0400
+++ palemoon-28.12.0-patched/platform/widget/moz.build	2020-08-18 15:01:26.856151106 -0400
@@ -53,7 +53,7 @@ if toolkit in ('cocoa', 'gtk2', 'gtk3'):
 if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     DIRS += ['gtk']
 
-    if CONFIG['MOZ_X11']:
+    if CONFIG['MOZ_X11'] and CONFIG['MOZ_WIDGET_TOOKIT'] == 'gtk2':
         DIRS += ['gtkxtbin']
 
 XPIDL_SOURCES += [
bgstack15