From 8c28694cbd01ca30490f9977e2e94d8b48eaec39 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 13 Jul 2021 23:43:56 +0300 Subject: [PATCH] firefox: 90.0 Closes #277 --- extra/firefox/build | 1 - extra/firefox/checksums | 5 +- extra/firefox/patches/no-gtk2.patch | 367 ---------- extra/firefox/patches/no-x11.patch | 1049 ++++++++++++--------------- extra/firefox/sources | 3 +- extra/firefox/version | 2 +- 6 files changed, 454 insertions(+), 973 deletions(-) delete mode 100644 extra/firefox/patches/no-gtk2.patch diff --git a/extra/firefox/build b/extra/firefox/build index 7b423881..ef81411c 100755 --- a/extra/firefox/build +++ b/extra/firefox/build @@ -1,6 +1,5 @@ #!/bin/sh -e -patch -p1 < no-gtk2.patch patch -p1 < no-x11.patch # Remove fribidi dependency. diff --git a/extra/firefox/checksums b/extra/firefox/checksums index 6ddcd3f4..a39a539a 100644 --- a/extra/firefox/checksums +++ b/extra/firefox/checksums @@ -1,5 +1,4 @@ -3225f583c5e36bdf52ad16f71a2c359deb0c765c38205acdeb6b7b6520ac5494 +43a943e7d7660c6d7f5b41c95b344b7fd6a4a88ad0bb45dbd844b372ea60d58b f0611136bee505811e9ca11ca7ac188ef5323a8e2ef19cffd3edb3cf08fd791e 3dce6601b495f5b3d45b59f7d2492a340ee7e84b5beca17e48f862502bd5603f -f18d00475ab9d7c4e8bd2dfcda00dc7ff4a1f930e3ffcee420aeadf636469cef -e8d9d077e5bd2750643337167ff822d1476aad1838a23b066eb0fde11b66b7b1 +a88ecf15a164dd82f9deb6576ff744d4ed1fda7ebd273e63b01e0c1d93c9ed1d diff --git a/extra/firefox/patches/no-gtk2.patch b/extra/firefox/patches/no-gtk2.patch deleted file mode 100644 index 568f777e..00000000 --- a/extra/firefox/patches/no-gtk2.patch +++ /dev/null @@ -1,367 +0,0 @@ -diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in -index 566e643..cb1e0dd 100644 ---- a/browser/installer/package-manifest.in -+++ b/browser/installer/package-manifest.in -@@ -107,7 +107,6 @@ - #endif - #ifdef MOZ_GTK - @BINPATH@/@DLL_PREFIX@mozgtk@DLL_SUFFIX@ --@BINPATH@/gtk2/@DLL_PREFIX@mozgtk@DLL_SUFFIX@ - #ifdef MOZ_WAYLAND - @BINPATH@/@DLL_PREFIX@mozwayland@DLL_SUFFIX@ - #endif -diff --git a/dom/moz.build b/dom/moz.build -index 9989f50..8c8167e 100644 ---- a/dom/moz.build -+++ b/dom/moz.build -@@ -120,7 +120,7 @@ TEST_DIRS += [ - "imptests", - ] - --if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("gtk", "cocoa", "windows"): -+if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("cocoa", "windows"): - TEST_DIRS += ["plugins/test"] - - SPHINX_TREES["/dom"] = "docs" -diff --git a/gfx/gl/GLContextProviderGLX.cpp b/gfx/gl/GLContextProviderGLX.cpp -index 8f97256..a371581 100644 ---- a/gfx/gl/GLContextProviderGLX.cpp -+++ b/gfx/gl/GLContextProviderGLX.cpp -@@ -3,7 +3,7 @@ - * 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/. */ - --#ifdef MOZ_WIDGET_GTK -+#if 0 - # include - # include - # define GET_NATIVE_WINDOW(aWidget) \ -@@ -42,7 +42,7 @@ - - #include "gfxCrashReporterUtils.h" - --#ifdef MOZ_WIDGET_GTK -+#if MOZ_WIDGET_GTK - # include "gfxPlatformGtk.h" - #endif - -diff --git a/gfx/thebes/gfxGdkNativeRenderer.cpp b/gfx/thebes/gfxGdkNativeRenderer.cpp -index 49f3afd..95760b1 100644 ---- a/gfx/thebes/gfxGdkNativeRenderer.cpp -+++ b/gfx/thebes/gfxGdkNativeRenderer.cpp -@@ -7,7 +7,7 @@ - #include "gfxContext.h" - #include "gfxPlatformGtk.h" - --#ifdef MOZ_X11 -+#if 0 - # include - # include "cairo-xlib.h" - # include "gfxXlibSurface.h" -diff --git a/gfx/thebes/gfxGdkNativeRenderer.h b/gfx/thebes/gfxGdkNativeRenderer.h -index e11a3ba..1cfaf8c 100644 ---- a/gfx/thebes/gfxGdkNativeRenderer.h -+++ b/gfx/thebes/gfxGdkNativeRenderer.h -@@ -6,9 +6,9 @@ - #ifndef GFXGDKNATIVERENDER_H_ - #define GFXGDKNATIVERENDER_H_ - --#include -+//#include - #include "nsSize.h" --#ifdef MOZ_X11 -+#if MOZ_X11 - # include "gfxXlibNativeRenderer.h" - #endif - -diff --git a/widget/gtk/mozgtk/gtk2/moz.build b/widget/gtk/mozgtk/gtk2/moz.build -deleted file mode 100644 -index 93e43c3..0000000 ---- a/widget/gtk/mozgtk/gtk2/moz.build -+++ /dev/null -@@ -1,40 +0,0 @@ --# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- --# vim: set filetype=python: --# This Source Code Form is subject to the terms of the Mozilla Public --# 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/. -- --SOURCES += [ -- "../mozgtk.c", --] -- --DEFINES["GTK3_SYMBOLS"] = True -- --SharedLibrary("mozgtk2") -- --SHARED_LIBRARY_NAME = "mozgtk" -- --FINAL_TARGET = "dist/bin/gtk2" -- --# If LDFLAGS contains -Wl,--as-needed or if it's the default for the toolchain, --# we need to add -Wl,--no-as-needed before the gtk libraries, otherwise the --# linker will drop those dependencies because no symbols are used from them. --# But those dependencies need to be kept for things to work properly. --# Ideally, we'd only add -Wl,--no-as-needed if necessary, but it's just simpler --# to add it unconditionally. This library is also simple enough that forcing --# -Wl,--as-needed after the gtk libraries is not going to make a significant --# difference. --if CONFIG["GCC_USE_GNU_LD"]: -- no_as_needed = ["-Wl,--no-as-needed"] -- as_needed = ["-Wl,--as-needed"] --else: -- no_as_needed = [] -- as_needed = [] -- --OS_LIBS += [f for f in CONFIG["MOZ_GTK2_LIBS"] if f.startswith("-L")] --OS_LIBS += no_as_needed --OS_LIBS += [ -- "gtk-x11-2.0", -- "gdk-x11-2.0", --] --OS_LIBS += as_needed -diff --git a/widget/gtk/mozgtk/gtk3/moz.build b/widget/gtk/mozgtk/gtk3/moz.build -index b4ab68e..e6e4a6d 100644 ---- a/widget/gtk/mozgtk/gtk3/moz.build -+++ b/widget/gtk/mozgtk/gtk3/moz.build -@@ -8,8 +8,6 @@ SOURCES += [ - "../mozgtk.c", - ] - --DEFINES["GTK2_SYMBOLS"] = True -- - SharedLibrary("mozgtk") - - SONAME = "mozgtk" -diff --git a/widget/gtk/mozgtk/moz.build b/widget/gtk/mozgtk/moz.build -index 8288583..cca6db0 100644 ---- a/widget/gtk/mozgtk/moz.build -+++ b/widget/gtk/mozgtk/moz.build -@@ -4,4 +4,4 @@ - # 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/. - --DIRS += ["stub", "gtk2", "gtk3"] -+DIRS += ["stub", "gtk3"] -diff --git a/widget/gtk/mozgtk/mozgtk.c b/widget/gtk/mozgtk/mozgtk.c -index 0b2e3fd..0bb4ac0 100644 ---- a/widget/gtk/mozgtk/mozgtk.c -+++ b/widget/gtk/mozgtk/mozgtk.c -@@ -646,21 +646,6 @@ STUB(gtk_color_chooser_get_rgba) - STUB(gtk_color_chooser_set_use_alpha) - #endif - --#ifdef GTK2_SYMBOLS --STUB(gdk_drawable_get_screen) --STUB(gdk_rgb_get_colormap) --STUB(gdk_rgb_get_visual) --STUB(gdk_window_lookup) --STUB(gdk_window_set_back_pixmap) --STUB(gdk_x11_colormap_foreign_new) --STUB(gdk_x11_colormap_get_xcolormap) --STUB(gdk_x11_drawable_get_xdisplay) --STUB(gdk_x11_drawable_get_xid) --STUB(gdk_x11_window_get_drawable_impl) --STUB(gdkx_visual_get) --STUB(gtk_object_get_type) --#endif -- - #ifndef GTK3_SYMBOLS - // Only define the following workaround when using GTK3, which we detect - // by checking if GTK3 stubs are not provided. -diff --git a/widget/gtk/mozgtk/stub/moz.build b/widget/gtk/mozgtk/stub/moz.build -index 8af0cc1..d523310 100644 ---- a/widget/gtk/mozgtk/stub/moz.build -+++ b/widget/gtk/mozgtk/stub/moz.build -@@ -8,7 +8,7 @@ SOURCES += [ - "../mozgtk.c", - ] - --for var in ("COMMON_SYMBOLS", "GTK2_SYMBOLS", "GTK3_SYMBOLS"): -+for var in ("COMMON_SYMBOLS", "GTK3_SYMBOLS"): - DEFINES[var] = True - - SharedLibrary("mozgtk_stub") -diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h -index 5bfdcd9..95caf91 100644 ---- a/widget/gtk/nsWindow.h -+++ b/widget/gtk/nsWindow.h -@@ -8,14 +8,14 @@ - #ifndef __nsWindow_h__ - #define __nsWindow_h__ - --#include -+//#include - #include - #ifdef MOZ_X11 - # include - # include "X11UndefineNone.h" - #endif /* MOZ_X11 */ - #ifdef MOZ_WAYLAND --# include -+//# include - # include "base/thread.h" - # include "WaylandVsyncSource.h" - #endif ---- a/old-configure -+++ b/old-configure -@@ -746,7 +746,6 @@ - GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_42 - GLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_42 - CAIRO_VERSION=1.10 --GTK2_VERSION=2.18.0 - GTK3_VERSION=3.14.0 - GDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_14 - W32API_VERSION=3.14 -@@ -7899,85 +7898,6 @@ - EOF - - fi -- if test "$MOZ_ENABLE_GTK"; then -- cat >> confdefs.pytmp <> confdefs.h <> confdefs.pytmp <> confdefs.h <= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 >= $GLIB_VERSION gobject-2.0 gio-unix-2.0 gdk-x11-2.0""... $ac_c" 1>&6 --echo "configure:7931: checking for gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 >= $GLIB_VERSION gobject-2.0 gio-unix-2.0 gdk-x11-2.0" >&5 -- -- if test -n "$PKG_CONFIG_SYSROOT_DIR"; then -- export PKG_CONFIG_SYSROOT_DIR -- fi -- if test -n "$PKG_CONFIG_LIBDIR"; then -- export PKG_CONFIG_LIBDIR -- fi -- -- if $PKG_CONFIG --exists "gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 >= $GLIB_VERSION gobject-2.0 gio-unix-2.0 gdk-x11-2.0" ; then -- echo "$ac_t""yes" 1>&6 -- succeeded=yes -- -- echo $ac_n "checking MOZ_GTK2_CFLAGS""... $ac_c" 1>&6 --echo "configure:7945: checking MOZ_GTK2_CFLAGS" >&5 -- MOZ_GTK2_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 >= $GLIB_VERSION gobject-2.0 gio-unix-2.0 gdk-x11-2.0"` -- echo "$ac_t""$MOZ_GTK2_CFLAGS" 1>&6 -- -- echo $ac_n "checking MOZ_GTK2_LIBS""... $ac_c" 1>&6 --echo "configure:7950: checking MOZ_GTK2_LIBS" >&5 -- ## Remove evil flags like -Wl,--export-dynamic -- MOZ_GTK2_LIBS="`$PKG_CONFIG --libs \"gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 >= $GLIB_VERSION gobject-2.0 gio-unix-2.0 gdk-x11-2.0\" |sed s/-Wl,--export-dynamic//g`" -- echo "$ac_t""$MOZ_GTK2_LIBS" 1>&6 -- else -- MOZ_GTK2_CFLAGS="" -- MOZ_GTK2_LIBS="" -- ## If we have a custom action on failure, don't print errors, but -- ## do set a variable so people can do so. -- MOZ_GTK2_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 >= $GLIB_VERSION gobject-2.0 gio-unix-2.0 gdk-x11-2.0"` -- echo $MOZ_GTK2_PKG_ERRORS -- fi -- -- -- -- else -- echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." -- echo "*** See http://www.freedesktop.org/software/pkgconfig" -- fi -- fi -- -- if test $succeeded = yes; then -- : -- else -- if test "$COMPILE_ENVIRONMENT"; then -- { echo "configure: error: Library requirements (gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 >= $GLIB_VERSION gobject-2.0 gio-unix-2.0 gdk-x11-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; echo "configure: error: Library requirements (gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 >= $GLIB_VERSION gobject-2.0 gio-unix-2.0 gdk-x11-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&5; exit 1; } -- fi -- fi -- -- MOZ_GTK2_CFLAGS="-I${_topsrcdir}/widget/gtk/compat $MOZ_GTK2_CFLAGS" -- fi -- fi - fi # COMPILE_ENVIRONMENT - - -@@ -10633,8 +10553,6 @@ - (''' MOZ_ANDROID_MAX_SDK_VERSION ''', r''' $MOZ_ANDROID_MAX_SDK_VERSION ''') - (''' MOZ_GTK3_CFLAGS ''', list(split(r''' $MOZ_GTK3_CFLAGS '''))) - (''' MOZ_GTK3_LIBS ''', list(split(r''' $MOZ_GTK3_LIBS '''))) -- (''' MOZ_GTK2_CFLAGS ''', list(split(r''' $MOZ_GTK2_CFLAGS '''))) -- (''' MOZ_GTK2_LIBS ''', list(split(r''' $MOZ_GTK2_LIBS '''))) - (''' MOZ_FS_LAYOUT ''', r''' $MOZ_FS_LAYOUT ''') - (''' TK_CFLAGS ''', list(split(r''' $TK_CFLAGS '''))) - (''' TK_LIBS ''', list(split(r''' $TK_LIBS '''))) ---- a/gfx/gl/GLContextProviderWayland.cpp -+++ b/gfx/gl/GLContextProviderWayland.cpp -@@ -20,13 +20,8 @@ - already_AddRefed GLContextProviderWayland::CreateForCompositorWidget( - CompositorWidget* aCompositorWidget, bool aHardwareWebRender, - bool aForceAccelerated) { -- if (GdkIsX11Display()) { -- return sGLContextProviderX11.CreateForCompositorWidget( -- aCompositorWidget, aHardwareWebRender, aForceAccelerated); -- } else { - return sGLContextProviderEGL.CreateForCompositorWidget( - aCompositorWidget, aHardwareWebRender, aForceAccelerated); -- } - } - - /*static*/ -@@ -33,10 +28,6 @@ - already_AddRefed GLContextProviderWayland::CreateHeadless( - const GLContextCreateDesc& desc, nsACString* const out_failureId) { -- if (GdkIsX11Display()) { -- return sGLContextProviderX11.CreateHeadless(desc, out_failureId); -- } else { - return sGLContextProviderEGL.CreateHeadless(desc, out_failureId); -- } - } - - /*static*/ -@@ -43,9 +34,5 @@ - GLContext* GLContextProviderWayland::GetGlobalContext() { -- if (GdkIsX11Display()) { -- return sGLContextProviderX11.GetGlobalContext(); -- } else { - return sGLContextProviderEGL.GetGlobalContext(); -- } - } - - /*static*/ -@@ -52,9 +39,5 @@ - void GLContextProviderWayland::Shutdown() { -- if (GdkIsX11Display()) { -- sGLContextProviderX11.Shutdown(); -- } else { - sGLContextProviderEGL.Shutdown(); -- } - } - - } // namespace mozilla::gl ---- a/dom/plugins/test/moz.build -+++ b/dom/plugins/test/moz.build -@@ -4,6 +4,6 @@ - # 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"] in ("gtk", "cocoa", "windows"): -+if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("cocoa", "windows"): - MOCHITEST_MANIFESTS += ["mochitest/mochitest.ini"] - BROWSER_CHROME_MANIFESTS += ["mochitest/browser.ini"] diff --git a/extra/firefox/patches/no-x11.patch b/extra/firefox/patches/no-x11.patch index e4250aea..ae0cc670 100644 --- a/extra/firefox/patches/no-x11.patch +++ b/extra/firefox/patches/no-x11.patch @@ -1,51 +1,34 @@ diff --git a/gfx/angle/checkout/include/EGL/eglplatform.h b/gfx/angle/checkout/include/EGL/eglplatform.h -index d1cae17..f2dfad1 100644 +index d1cae17724..505c334098 100644 --- a/gfx/angle/checkout/include/EGL/eglplatform.h +++ b/gfx/angle/checkout/include/EGL/eglplatform.h -@@ -122,7 +122,9 @@ typedef intptr_t EGLNativeDisplayType; +@@ -122,7 +122,8 @@ typedef intptr_t EGLNativeDisplayType; typedef intptr_t EGLNativePixmapType; typedef intptr_t EGLNativeWindowType; -#elif defined(__unix__) || defined(USE_X11) -+#elif defined(__unix__) -+ ++#elif defined(__unix__) +#if defined(USE_X11) /* X11 (tentative) */ #include -@@ -132,6 +134,14 @@ typedef Display *EGLNativeDisplayType; +@@ -131,6 +132,11 @@ typedef intptr_t EGLNativeWindowType; + typedef Display *EGLNativeDisplayType; typedef Pixmap EGLNativePixmapType; typedef Window EGLNativeWindowType; - +#else -+ +typedef void *EGLNativeDisplayType; +typedef khronos_uintptr_t EGLNativePixmapType; +typedef khronos_uintptr_t EGLNativeWindowType; -+ +#endif -+ + #elif defined(__APPLE__) - typedef int EGLNativeDisplayType; -diff --git a/gfx/cairo/cairo/src/moz.build b/gfx/cairo/cairo/src/moz.build -index 485f1e8..b77e341 100755 ---- a/gfx/cairo/cairo/src/moz.build -+++ b/gfx/cairo/cairo/src/moz.build -@@ -70,7 +70,7 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'beos': - SOURCES += [ - 'cairo-beos-surface.cpp', - ] --elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk': -+elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk' and CONFIG['MOZ_X11']: - EXPORTS.cairo += [ - 'cairo-ps.h', - ] diff --git a/gfx/gl/GLContextProvider.h b/gfx/gl/GLContextProvider.h -index 12d1a49..d30b01c 100644 +index 12d1a497b9..bec4cd17f0 100644 --- a/gfx/gl/GLContextProvider.h +++ b/gfx/gl/GLContextProvider.h -@@ -55,17 +55,18 @@ namespace gl { +@@ -55,17 +55,17 @@ namespace gl { # define GL_CONTEXT_PROVIDER_NAME GLContextProviderX11 # include "GLContextProviderImpl.h" # undef GL_CONTEXT_PROVIDER_NAME @@ -66,15 +49,14 @@ index 12d1a49..d30b01c 100644 +# undef GL_CONTEXT_PROVIDER_NAME +# define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderWayland +#endif -+ #ifndef GL_CONTEXT_PROVIDER_DEFAULT # define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderEGL #endif diff --git a/gfx/gl/GLContextProviderWayland.cpp b/gfx/gl/GLContextProviderWayland.cpp -index 2bf3c5f..eb49c3a 100644 +index 36ecf5032a..78e34bfaf0 100644 --- a/gfx/gl/GLContextProviderWayland.cpp +++ b/gfx/gl/GLContextProviderWayland.cpp -@@ -14,7 +14,9 @@ namespace mozilla::gl { +@@ -14,47 +14,65 @@ namespace mozilla::gl { using namespace mozilla::gfx; using namespace mozilla::widget; @@ -84,8 +66,64 @@ index 2bf3c5f..eb49c3a 100644 static class GLContextProviderEGL sGLContextProviderEGL; already_AddRefed GLContextProviderWayland::CreateForCompositorWidget( + CompositorWidget* aCompositorWidget, bool aHardwareWebRender, + bool aForceAccelerated) { ++#ifdef MOZ_X11 + if (GdkIsX11Display()) { + return sGLContextProviderX11.CreateForCompositorWidget( + aCompositorWidget, aHardwareWebRender, aForceAccelerated); + } else { ++#endif + return sGLContextProviderEGL.CreateForCompositorWidget( + aCompositorWidget, aHardwareWebRender, aForceAccelerated); ++#ifdef MOZ_X11 + } ++#endif + } + + /*static*/ + already_AddRefed GLContextProviderWayland::CreateHeadless( + const GLContextCreateDesc& desc, nsACString* const out_failureId) { ++#ifdef MOZ_X11 + if (GdkIsX11Display()) { + return sGLContextProviderX11.CreateHeadless(desc, out_failureId); + } else { ++#endif + return sGLContextProviderEGL.CreateHeadless(desc, out_failureId); ++#ifdef MOZ_X11 + } ++#endif + } + + /*static*/ + GLContext* GLContextProviderWayland::GetGlobalContext() { ++#ifdef MOZ_X11 + if (GdkIsX11Display()) { + return sGLContextProviderX11.GetGlobalContext(); + } else { ++#endif + return sGLContextProviderEGL.GetGlobalContext(); ++#ifdef MOZ_X11 + } ++#endif + } + + /*static*/ + void GLContextProviderWayland::Shutdown() { ++#ifdef MOZ_X11 + if (GdkIsX11Display()) { + sGLContextProviderX11.Shutdown(); + } else { ++#endif + sGLContextProviderEGL.Shutdown(); ++#ifdef MOZ_X11 + } ++#endif + } + + } // namespace mozilla::gl diff --git a/gfx/gl/moz.build b/gfx/gl/moz.build -index 62ad33c..481fc6d 100644 +index 62ad33c786..481fc6d432 100644 --- a/gfx/gl/moz.build +++ b/gfx/gl/moz.build @@ -13,7 +13,7 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa": @@ -98,7 +136,7 @@ index 62ad33c..481fc6d 100644 else: gl_provider = "GLX" diff --git a/gfx/layers/AnimationHelper.h b/gfx/layers/AnimationHelper.h -index f5a57b9..72091c3 100644 +index f5a57b9c4d..72091c3a4f 100644 --- a/gfx/layers/AnimationHelper.h +++ b/gfx/layers/AnimationHelper.h @@ -7,6 +7,7 @@ @@ -118,7 +156,7 @@ index f5a57b9..72091c3 100644 namespace mozilla { diff --git a/gfx/layers/ipc/CompositorBridgeParent.cpp b/gfx/layers/ipc/CompositorBridgeParent.cpp -index 33998e3..8cb6ed5 100644 +index 2ecd55b16a..82b56300c6 100644 --- a/gfx/layers/ipc/CompositorBridgeParent.cpp +++ b/gfx/layers/ipc/CompositorBridgeParent.cpp @@ -72,7 +72,7 @@ @@ -126,34 +164,46 @@ index 33998e3..8cb6ed5 100644 #include "mozilla/ProfilerMarkers.h" #include "mozilla/Telemetry.h" -#ifdef MOZ_WIDGET_GTK -+#if defined(MOZ_WIDGET_GTK) && defined(MOZ_X11) ++#if defined(MOZ_WIDGET_GTK) && defined(MOZ_X11) # include "basic/X11BasicCompositor.h" // for X11BasicCompositor #endif #include "nsCOMPtr.h" // for already_AddRefed -@@ -1403,7 +1403,7 @@ RefPtr CompositorBridgeParent::NewCompositor( +@@ -1402,7 +1402,7 @@ RefPtr CompositorBridgeParent::NewCompositor( new CompositorOGL(this, mWidget, mEGLSurfaceSize.width, mEGLSurfaceSize.height, mUseExternalSurfaceSize); } else if (aBackendHints[i] == LayersBackend::LAYERS_BASIC) { -#ifdef MOZ_WIDGET_GTK -+#if defined(MOZ_WIDGET_GTK) && defined(MOZ_X11) ++#if defined(MOZ_WIDGET_GTK) && defined(MOZ_X11) if (gfxVars::UseXRender()) { compositor = new X11BasicCompositor(this, mWidget); } else diff --git a/gfx/thebes/gfxPlatformGtk.cpp b/gfx/thebes/gfxPlatformGtk.cpp -index f458cef..b34b081 100644 +index 6a703edcf3..b6ad44212c 100644 --- a/gfx/thebes/gfxPlatformGtk.cpp +++ b/gfx/thebes/gfxPlatformGtk.cpp @@ -61,6 +61,9 @@ # include "mozilla/widget/nsWaylandDisplay.h" # include "mozilla/widget/DMABufLibWrapper.h" # include "mozilla/StaticPrefs_widget.h" -+# ifdef MOZ_WIDGET_GTK -+# include "mozilla/WidgetUtilsGtk.h" ++# ifdef MOZ_WIGET_GTK ++# include "mozilla/WidgetUtilsGtk.h" +# endif #endif #define GDK_PIXMAP_SIZE_MAX 32767 -@@ -222,9 +225,11 @@ void gfxPlatformGtk::InitDmabufConfig() { +@@ -96,7 +99,11 @@ gfxPlatformGtk::gfxPlatformGtk() { + } + + mMaxGenericSubstitutions = UNINITIALIZED_VALUE; ++#ifdef MOZ_X11 + mIsX11Display = gfxPlatform::IsHeadless() ? false : GdkIsX11Display(); ++#else ++ mIsX11Display = 0; ++#endif + if (XRE_IsParentProcess()) { + #ifdef MOZ_X11 + if (mIsX11Display && mozilla::Preferences::GetBool("gfx.xrender.enabled")) { +@@ -250,9 +257,11 @@ void gfxPlatformGtk::InitWebRenderConfig() { } void gfxPlatformGtk::FlushContentDrawing() { @@ -166,7 +216,7 @@ index f458cef..b34b081 100644 void gfxPlatformGtk::InitPlatformGPUProcessPrefs() { diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build -index c284127..be9e105 100644 +index c284127164..be9e10542b 100644 --- a/gfx/thebes/moz.build +++ b/gfx/thebes/moz.build @@ -119,7 +119,6 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": @@ -198,7 +248,7 @@ index c284127..be9e105 100644 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows": diff --git a/gfx/webrender_bindings/RenderCompositorOGLSWGL.cpp b/gfx/webrender_bindings/RenderCompositorOGLSWGL.cpp -index 895165b..084d6d9 100644 +index ec9b904967..dee437d8ae 100644 --- a/gfx/webrender_bindings/RenderCompositorOGLSWGL.cpp +++ b/gfx/webrender_bindings/RenderCompositorOGLSWGL.cpp @@ -27,7 +27,9 @@ @@ -212,8 +262,46 @@ index 895165b..084d6d9 100644 #endif namespace mozilla { +diff --git a/old-configure b/old-configure +index 22c103bdac..74a90f5ee1 100644 +--- a/old-configure ++++ b/old-configure +@@ -9743,13 +9743,13 @@ TEE_SURFACE_FEATURE="#define CAIRO_HAS_TEE_SURFACE 1" + if test "$MOZ_X11"; then + XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1" + XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1" +- PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1" + fi + if test "$_HAVE_FREETYPE2"; then + FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1" + MOZ_ENABLE_CAIRO_FT=1 + CAIRO_FT_CFLAGS="$FT2_CFLAGS" + fi ++PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1" + + case "$MOZ_WIDGET_TOOLKIT" in + cocoa | uikit) +diff --git a/old-configure.in b/old-configure.in +index de2642f71d..d0ab9b1988 100644 +--- a/old-configure.in ++++ b/old-configure.in +@@ -2327,13 +2327,13 @@ TEE_SURFACE_FEATURE="#define CAIRO_HAS_TEE_SURFACE 1" + if test "$MOZ_X11"; then + XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1" + XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1" +- PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1" + fi + if test "$_HAVE_FREETYPE2"; then + FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1" + MOZ_ENABLE_CAIRO_FT=1 + CAIRO_FT_CFLAGS="$FT2_CFLAGS" + fi ++PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1" + + case "$MOZ_WIDGET_TOOLKIT" in + cocoa | uikit) diff --git a/toolkit/components/remote/moz.build b/toolkit/components/remote/moz.build -index 235580d..b407dce 100644 +index 235580d6b7..b407dce197 100644 --- a/toolkit/components/remote/moz.build +++ b/toolkit/components/remote/moz.build @@ -13,12 +13,15 @@ SOURCES += [ @@ -236,7 +324,7 @@ index 235580d..b407dce 100644 SOURCES += [ "nsDBusRemoteClient.cpp", diff --git a/toolkit/components/remote/nsRemoteService.cpp b/toolkit/components/remote/nsRemoteService.cpp -index 289fa50..c1dd2e8 100644 +index 289fa506f4..c2fd3a1183 100644 --- a/toolkit/components/remote/nsRemoteService.cpp +++ b/toolkit/components/remote/nsRemoteService.cpp @@ -12,12 +12,18 @@ @@ -254,8 +342,8 @@ index 289fa50..c1dd2e8 100644 # include "nsDBusRemoteClient.h" # endif +# ifdef MOZ_WAYLAND -+# include -+# include "nsRemoteClient.h" ++# include ++# include "nsRemoteClient.h" +# endif #elif defined(XP_WIN) # include "nsWinRemoteServer.h" @@ -276,34 +364,33 @@ index 289fa50..c1dd2e8 100644 mRemoteServer = MakeUnique(); } # endif -+#if defined(MOZ_X11) ++# if defined(MOZ_X11) if (!mRemoteServer && useX11Remote) { mRemoteServer = MakeUnique(); } -+#endif ++# endif #elif defined(XP_WIN) mRemoteServer = MakeUnique(); #elif defined(XP_DARWIN) diff --git a/toolkit/moz.configure b/toolkit/moz.configure -index 0717b91..da32db0 100644 +index ac7ab6c2ef..b1bd632d81 100644 --- a/toolkit/moz.configure +++ b/toolkit/moz.configure -@@ -314,10 +314,6 @@ def toolkit_gtk(toolkit): +@@ -314,9 +314,6 @@ def toolkit_gtk(toolkit): return toolkit == "gtk" -set_config("MOZ_X11", True, when=toolkit_gtk) -set_define("MOZ_X11", True, when=toolkit_gtk) -add_old_configure_assignment("MOZ_X11", True, when=toolkit_gtk) -- + # Wayland support # ============================================================== - wayland_headers = pkg_check_modules( diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp -index 3a9928c..58bca06 100644 +index 3ec33c9b45..0ef2182368 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp -@@ -315,6 +315,7 @@ nsString gProcessStartupShortcut; +@@ -319,6 +319,7 @@ nsString gProcessStartupShortcut; # endif # ifdef MOZ_X11 # include @@ -311,18 +398,16 @@ index 3a9928c..58bca06 100644 # endif /* MOZ_X11 */ # include #endif -@@ -338,9 +339,6 @@ void XRE_LibFuzzerSetDriver(LibFuzzerDriver aDriver) { - # endif +@@ -343,7 +344,6 @@ void XRE_LibFuzzerSetDriver(LibFuzzerDriver aDriver) { #endif // FUZZING --// Undo X11/X.h's definition of None + // Undo X11/X.h's definition of None -#undef None -- + namespace mozilla { int (*RunGTest)(int*, char**) = 0; - diff --git a/toolkit/xre/nsGDKErrorHandler.cpp b/toolkit/xre/nsGDKErrorHandler.cpp -index 421abdf..3cd8789 100644 +index 421abdf12f..673a4f851b 100644 --- a/toolkit/xre/nsGDKErrorHandler.cpp +++ b/toolkit/xre/nsGDKErrorHandler.cpp @@ -6,14 +6,21 @@ @@ -355,24 +440,20 @@ index 421abdf..3cd8789 100644 if (strstr(message, "X Window System error")) { XErrorEvent event; nsDependentCString buffer(message); -@@ -92,10 +100,13 @@ static void GdkErrorHandler(const gchar* log_domain, GLogLevelFlags log_level, +@@ -92,10 +100,10 @@ static void GdkErrorHandler(const gchar* log_domain, GLogLevelFlags log_level, event.resourceid = 0; X11Error(event.display, &event); - } else { -- g_log_default_handler(log_domain, log_level, message, user_data); -- MOZ_CRASH_UNSAFE(message); -+ -+ return; - } ++ } +#endif -+ -+g_log_default_handler(log_domain, log_level, message, user_data); -+MOZ_CRASH_UNSAFE(message); + g_log_default_handler(log_domain, log_level, message, user_data); + MOZ_CRASH_UNSAFE(message); +- } } void InstallGdkErrorHandler() { -@@ -103,7 +114,9 @@ void InstallGdkErrorHandler() { +@@ -103,7 +111,9 @@ void InstallGdkErrorHandler() { (GLogLevelFlags)(G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION), GdkErrorHandler, nullptr); @@ -383,7 +464,7 @@ index 421abdf..3cd8789 100644 +#endif } diff --git a/toolkit/xre/nsNativeAppSupportUnix.cpp b/toolkit/xre/nsNativeAppSupportUnix.cpp -index e8f7b67..5549e40 100644 +index e8f7b67c35..5549e40fe9 100644 --- a/toolkit/xre/nsNativeAppSupportUnix.cpp +++ b/toolkit/xre/nsNativeAppSupportUnix.cpp @@ -401,7 +401,6 @@ static void SetSMProperty(SmProp& prop, const char* name, const char* type, @@ -403,7 +484,7 @@ index e8f7b67..5549e40 100644 NS_IMETHODIMP nsNativeAppSupportUnix::Start(bool* aRetVal) { diff --git a/widget/CompositorWidget.h b/widget/CompositorWidget.h -index 08d84f8..3dc76c4 100644 +index 4515f4ccc0..2f4795364c 100644 --- a/widget/CompositorWidget.h +++ b/widget/CompositorWidget.h @@ -63,7 +63,7 @@ class CompositorWidgetDelegate { @@ -415,209 +496,85 @@ index 08d84f8..3dc76c4 100644 // CompositorWidgetParent should implement CompositorWidget and // PCompositorWidgetParent. class CompositorWidgetParent; -diff --git a/widget/GfxInfoX11.cpp b/widget/GfxInfoX11.cpp -index 073cba4..213426a 100644 ---- a/widget/GfxInfoX11.cpp -+++ b/widget/GfxInfoX11.cpp -@@ -24,7 +24,9 @@ - - #include "GfxInfoX11.h" - +diff --git a/widget/gtk/GtkCompositorWidget.cpp b/widget/gtk/GtkCompositorWidget.cpp +index d74539c464..5beec1cdfa 100644 +--- a/widget/gtk/GtkCompositorWidget.cpp ++++ b/widget/gtk/GtkCompositorWidget.cpp +@@ -9,7 +9,9 @@ + #include "mozilla/widget/InProcessCompositorWidget.h" + #include "mozilla/widget/PlatformWidgetTypes.h" + #include "nsWindow.h" +#ifdef MOZ_X11 - #include + #include "mozilla/X11Util.h" +#endif + #ifdef MOZ_WAYLAND - # include "mozilla/WidgetUtilsGtk.h" - # include "mozilla/widget/nsWaylandDisplay.h" -@@ -250,6 +252,7 @@ void GfxInfo::GetData() { - - // Scan the GL_VERSION string for the GL and driver versions. - nsCWhitespaceTokenizer tokenizer(glVersion); -+#ifdef MOZ_X11 - while (tokenizer.hasMoreTokens()) { - nsCString token(tokenizer.nextToken()); - unsigned int major = 0, minor = 0, revision = 0, patch = 0; -@@ -612,6 +615,7 @@ void GfxInfo::GetData() { - } - - AddCrashReportAnnotations(); -+#endif - } - - const nsTArray& GfxInfo::GetGfxDriverInfo() { + # include "mozilla/layers/NativeLayerWayland.h" diff --git a/widget/gtk/MozContainer.cpp b/widget/gtk/MozContainer.cpp -index 334592e..3618089 100644 +index a1c1c2b124..97d31ba5b7 100644 --- a/widget/gtk/MozContainer.cpp +++ b/widget/gtk/MozContainer.cpp -@@ -9,10 +9,11 @@ +@@ -9,7 +9,12 @@ #include #include --#include ++#ifdef MOZ_X11 + #include ++#endif ++#ifdef MOZ_WAYLAND ++#include "mozilla/WidgetUtilsGtk.h" ++#endif #include - #ifdef MOZ_WAYLAND - # include "gfxPlatformGtk.h" -+#else -+#include - #endif #ifdef ACCESSIBILITY diff --git a/widget/gtk/WindowSurfaceProvider.cpp b/widget/gtk/WindowSurfaceProvider.cpp -index ae7a084..dc4d1c4 100644 +index 837e8aa696..ae19f3ff70 100644 --- a/widget/gtk/WindowSurfaceProvider.cpp +++ b/widget/gtk/WindowSurfaceProvider.cpp -@@ -10,9 +10,11 @@ - #include "mozilla/gfx/Logging.h" - #include "mozilla/layers/LayersTypes.h" - #include "nsWindow.h" -+#ifdef MOZ_X11 - #include "WindowSurfaceX11Image.h" - #include "WindowSurfaceX11SHM.h" - #include "WindowSurfaceXRender.h" -+#endif - #ifdef MOZ_WAYLAND - # include "WindowSurfaceWayland.h" - #endif -@@ -24,10 +26,12 @@ using namespace mozilla::layers; +@@ -87,7 +87,7 @@ RefPtr WindowSurfaceProvider::CreateWindowSurface() { + mXVisual, mXDepth); + } - WindowSurfaceProvider::WindowSurfaceProvider() - : mIsX11Display(false), -+#ifdef MOZ_X11 - mXDisplay(nullptr), - mXWindow(0), - mXVisual(nullptr), - mXDepth(0), -+#endif - mWindowSurface(nullptr) - #ifdef MOZ_WAYLAND - , -@@ -37,6 +41,7 @@ WindowSurfaceProvider::WindowSurfaceProvider() - mIsShaped(false) { - } +-# ifdef MOZ_HAVE_SHMIMAGE ++# if defined(MOZ_HAVE_SHMIMAGE) && defined(MOZ_X11) + if (!mIsShaped && nsShmImage::UseShm()) { + LOG(("Drawing to Window 0x%lx will use MIT-SHM\n", mXWindow)); + return MakeRefPtr(DefaultXDisplay(), mXWindow, +@@ -95,9 +95,11 @@ RefPtr WindowSurfaceProvider::CreateWindowSurface() { + } + # endif // MOZ_HAVE_SHMIMAGE -+#ifdef MOZ_X11 - void WindowSurfaceProvider::Initialize(Display* aDisplay, Window aWindow, - Visual* aVisual, int aDepth, - bool aIsShaped) { -@@ -53,6 +58,7 @@ void WindowSurfaceProvider::Initialize(Display* aDisplay, Window aWindow, - mIsShaped = aIsShaped; - mIsX11Display = true; - } -+#endif - - #ifdef MOZ_WAYLAND - void WindowSurfaceProvider::Initialize(nsWindow* aWidget) { -@@ -71,6 +77,7 @@ UniquePtr WindowSurfaceProvider::CreateWindowSurface() { ++# if defined(MOZ_X11) + LOG(("Drawing to Window 0x%lx will use XPutImage\n", mXWindow)); + return MakeRefPtr(DefaultXDisplay(), mXWindow, + mXVisual, mXDepth, mIsShaped); ++# endif } #endif - -+#if defined(MOZ_WIDGET_GTK) && defined(MOZ_X11) - // We should be initialized - MOZ_ASSERT(mXDisplay); - -@@ -83,8 +90,9 @@ UniquePtr WindowSurfaceProvider::CreateWindowSurface() { - return MakeUnique(mXDisplay, mXWindow, mXVisual, - mXDepth); - } -+#endif - --#ifdef MOZ_HAVE_SHMIMAGE -+#if defined(MOZ_HAVE_SHMIMAGE) && defined(MOZ_X11) - if (!mIsShaped && nsShmImage::UseShm()) { - LOGDRAW(("Drawing to Window 0x%lx will use MIT-SHM\n", mXWindow)); - return MakeUnique(mXDisplay, mXWindow, mXVisual, -@@ -92,9 +100,11 @@ UniquePtr WindowSurfaceProvider::CreateWindowSurface() { - } - #endif // MOZ_HAVE_SHMIMAGE - -+#ifdef MOZ_X11 - LOGDRAW(("Drawing to Window 0x%lx will use XPutImage\n", mXWindow)); - return MakeUnique(mXDisplay, mXWindow, mXVisual, - mXDepth, mIsShaped); -+#endif - } - - already_AddRefed -@@ -110,8 +120,9 @@ WindowSurfaceProvider::StartRemoteDrawingInRegion( - - *aBufferMode = BufferMode::BUFFER_NONE; - RefPtr dt = nullptr; -- if (!(dt = mWindowSurface->Lock(aInvalidRegion)) && mIsX11Display && -- !mWindowSurface->IsFallback()) { -+ if (!(dt = mWindowSurface->Lock(aInvalidRegion))) { -+#ifdef MOZ_X11 -+ if (mIsX11Display && !mWindowSurface->IsFallback()) { - // We can't use WindowSurfaceX11Image fallback on Wayland but - // Lock() call on WindowSurfaceWayland should never fail. - gfxWarningOnce() -@@ -119,6 +130,8 @@ WindowSurfaceProvider::StartRemoteDrawingInRegion( - mWindowSurface = MakeUnique( - mXDisplay, mXWindow, mXVisual, mXDepth, mIsShaped); - dt = mWindowSurface->Lock(aInvalidRegion); -+ } -+#endif - } - return dt.forget(); - } -diff --git a/widget/gtk/WindowSurfaceProvider.h b/widget/gtk/WindowSurfaceProvider.h -index ae66e0c..5162429 100644 ---- a/widget/gtk/WindowSurfaceProvider.h -+++ b/widget/gtk/WindowSurfaceProvider.h -@@ -17,8 +17,10 @@ - #ifdef MOZ_WAYLAND - # include - #endif -+#ifdef MOZ_X11 - #include // for Window, Display, Visual, etc. - #include "X11UndefineNone.h" -+#endif - - class nsWindow; - -@@ -40,8 +42,10 @@ class WindowSurfaceProvider final { - * own the Display, Window, etc, and they must continue to exist - * while WindowSurfaceProvider is used. - */ -+#ifdef MOZ_X11 - void Initialize(Display* aDisplay, Window aWindow, Visual* aVisual, - int aDepth, bool aIsShaped); -+#endif - - #ifdef MOZ_WAYLAND - void Initialize(nsWindow* aWidget); -@@ -65,10 +69,12 @@ class WindowSurfaceProvider final { - - // Can we access X? - bool mIsX11Display; -+#ifdef MOZ_X11 - Display* mXDisplay; - Window mXWindow; - Visual* mXVisual; - int mXDepth; -+#endif - UniquePtr mWindowSurface; - #ifdef MOZ_WAYLAND - nsWindow* mWidget; + MOZ_RELEASE_ASSERT(false); diff --git a/widget/gtk/WindowSurfaceWayland.cpp b/widget/gtk/WindowSurfaceWayland.cpp -index 5039c55..4975484 100644 +index 5c74524c21..78e0dc7801 100644 --- a/widget/gtk/WindowSurfaceWayland.cpp +++ b/widget/gtk/WindowSurfaceWayland.cpp -@@ -12,8 +12,10 @@ +@@ -15,11 +15,13 @@ #include "mozilla/gfx/Tools.h" #include "gfx2DGlue.h" #include "gfxPlatform.h" +#include "gfxImageSurface.h" #include "MozContainer.h" - #include "nsTArray.h" -+#include "prenv.h" #include "mozilla/ScopeExit.h" #include "mozilla/StaticPrefs_widget.h" #include "mozilla/WidgetUtils.h" + #include "nsTArray.h" ++#include "prenv.h" + + #ifdef MOZ_LOGGING + # include "mozilla/Logging.h" diff --git a/widget/gtk/components.conf b/widget/gtk/components.conf -index 8c160c5..2c9fa07 100644 +index 38c07bd812..a125d8d275 100644 --- a/widget/gtk/components.conf +++ b/widget/gtk/components.conf -@@ -84,7 +84,7 @@ Classes = [ +@@ -78,7 +78,7 @@ Classes = [ }, ] @@ -627,64 +584,66 @@ index 8c160c5..2c9fa07 100644 { 'js_name': 'clipboard', diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build -index b39a1aa..f10d654 100644 +index b579218ab8..f882569689 100644 --- a/widget/gtk/moz.build +++ b/widget/gtk/moz.build -@@ -63,7 +63,7 @@ SOURCES += [ - "WaylandVsyncSource.cpp", # conflicts with X11 headers - ] +@@ -100,23 +100,27 @@ if CONFIG["MOZ_WAYLAND"]: --if CONFIG["MOZ_X11"]: -+if CONFIG["MOZ_X11"] or CONFIG["MOZ_WAYLAND"]: - UNIFIED_SOURCES += [ - "CompositorWidgetChild.cpp", - "CompositorWidgetParent.cpp", -@@ -86,12 +86,18 @@ if CONFIG["NS_PRINTING"]: - "nsPrintSettingsServiceGTK.cpp", - ] - -+UNIFIED_SOURCES += [ -+ "nsClipboard.cpp", -+ "nsDragService.cpp", -+ "WindowSurfaceProvider.cpp", -+] -+EXPORTS.mozilla.widget += [ -+ "WindowSurfaceProvider.h", -+] -+ if CONFIG["MOZ_X11"]: UNIFIED_SOURCES += [ -- "nsClipboard.cpp", +- "CompositorWidgetChild.cpp", +- "CompositorWidgetParent.cpp", +- "InProcessGtkCompositorWidget.cpp", "nsClipboardX11.cpp", -- "nsDragService.cpp", -- "WindowSurfaceProvider.cpp", + "nsShmImage.cpp", +- "nsUserIdleServiceGTK.cpp", "WindowSurfaceX11.cpp", "WindowSurfaceX11Image.cpp", + "WindowSurfaceX11SHM.cpp", "WindowSurfaceXRender.cpp", -@@ -146,7 +152,7 @@ LOCAL_INCLUDES += [ - "/widget/headless", - ] - --if CONFIG["MOZ_X11"]: -+if CONFIG["MOZ_X11"] or CONFIG["MOZ_WAYLAND"]: - LOCAL_INCLUDES += [ - "/widget/x11", ] +- EXPORTS.mozilla.widget += [ +- "CompositorWidgetChild.h", +- "CompositorWidgetParent.h", +- "GtkCompositorWidget.h", +- "InProcessGtkCompositorWidget.h", +- ] ++ ++UNIFIED_SOURCES += [ ++ "CompositorWidgetChild.cpp", ++ "CompositorWidgetParent.cpp", ++ "InProcessGtkCompositorWidget.cpp", ++ "nsUserIdleServiceGTK.cpp", ++] ++ ++EXPORTS.mozilla.widget += [ ++ "CompositorWidgetChild.h", ++ "CompositorWidgetParent.h", ++ "GtkCompositorWidget.h", ++ "InProcessGtkCompositorWidget.h", ++] + + if CONFIG["NS_PRINTING"]: + UNIFIED_SOURCES += [ diff --git a/widget/gtk/mozgtk/mozgtk.c b/widget/gtk/mozgtk/mozgtk.c -index a8c88fc..cc9ca81 100644 +index 677f9b3561..b8cb7de58e 100644 --- a/widget/gtk/mozgtk/mozgtk.c +++ b/widget/gtk/mozgtk/mozgtk.c -@@ -649,7 +649,7 @@ STUB(gtk_color_chooser_get_rgba) - STUB(gtk_color_chooser_set_use_alpha) - #endif +@@ -6,6 +6,7 @@ --#ifndef GTK3_SYMBOLS -+#if !defined(GTK3_SYMBOLS) && defined(MOZ_X11) - // Only define the following workaround when using GTK3, which we detect - // by checking if GTK3 stubs are not provided. - # include + #include "mozilla/Types.h" + ++#if defined(MOZ_X11) + #include + // Bug 1271100 + // We need to trick system Cairo into not using the XShm extension due to +@@ -19,3 +20,4 @@ + // ever can remove this workaround for system Cairo, we'll need something + // to replace it for that purpose. + MOZ_EXPORT Bool XShmQueryExtension(Display* aDisplay) { return False; } ++#endif diff --git a/widget/gtk/nsClipboard.cpp b/widget/gtk/nsClipboard.cpp -index ce2a8ab..ae75bbb 100644 +index 74379651b9..a89e8fd8e0 100644 --- a/widget/gtk/nsClipboard.cpp +++ b/widget/gtk/nsClipboard.cpp @@ -9,7 +9,9 @@ @@ -697,7 +656,7 @@ index ce2a8ab..ae75bbb 100644 #if defined(MOZ_WAYLAND) # include "nsClipboardWayland.h" #endif -@@ -33,7 +35,9 @@ +@@ -32,7 +34,9 @@ #include "imgIContainer.h" #include @@ -707,25 +666,23 @@ index ce2a8ab..ae75bbb 100644 #include "mozilla/Encoding.h" -@@ -96,13 +100,13 @@ nsClipboard::~nsClipboard() { +@@ -95,10 +99,12 @@ nsClipboard::~nsClipboard() { NS_IMPL_ISUPPORTS(nsClipboard, nsIClipboard, nsIObserver) nsresult nsClipboard::Init(void) { +#if defined(MOZ_X11) - if (gfxPlatformGtk::GetPlatform()->IsX11Display()) { + if (widget::GdkIsX11Display()) { mContext = MakeUnique(); -#if defined(MOZ_WAYLAND) -- } else { +- } else if (widget::GdkIsWaylandDisplay()) { + } +#elif defined(MOZ_WAYLAND) ++ if (widget::GdkIsWaylandDisplay()) { mContext = MakeUnique(); #endif -- } - NS_ASSERTION(mContext, "Missing nsRetrievalContext for nsClipboard!"); - - nsCOMPtr os = mozilla::services::GetObserverService(); + } else { diff --git a/widget/gtk/nsDeviceContextSpecG.cpp b/widget/gtk/nsDeviceContextSpecG.cpp -index cc6ad21..3564733 100644 +index b7891d67b5..abe6b82bc0 100644 --- a/widget/gtk/nsDeviceContextSpecG.cpp +++ b/widget/gtk/nsDeviceContextSpecG.cpp @@ -6,7 +6,9 @@ @@ -738,7 +695,7 @@ index cc6ad21..3564733 100644 #include "mozilla/Logging.h" #include "mozilla/Services.h" -@@ -45,7 +47,9 @@ using namespace mozilla; +@@ -46,7 +48,9 @@ using namespace mozilla; using mozilla::gfx::IntSize; using mozilla::gfx::PrintTarget; using mozilla::gfx::PrintTargetPDF; @@ -748,7 +705,7 @@ index cc6ad21..3564733 100644 nsDeviceContextSpecGTK::nsDeviceContextSpecGTK() : mGtkPrintSettings(nullptr), mGtkPageSetup(nullptr) {} -@@ -118,12 +122,16 @@ already_AddRefed nsDeviceContextSpecGTK::MakePrintTarget() { +@@ -119,12 +123,15 @@ already_AddRefed nsDeviceContextSpecGTK::MakePrintTarget() { return PrintTargetPDF::CreateOrNull(stream, size); } @@ -760,46 +717,45 @@ index cc6ad21..3564733 100644 ? PrintTargetPS::PORTRAIT : PrintTargetPS::LANDSCAPE); +#endif -+ + return nullptr; } #define DECLARE_KNOWN_MONOCHROME_SETTING(key_, value_) {"cups-" key_, value_}, diff --git a/widget/gtk/nsDragService.cpp b/widget/gtk/nsDragService.cpp -index c4d486e..6191cc0 100644 +index 6983dc1b2c..2852e232b9 100644 --- a/widget/gtk/nsDragService.cpp +++ b/widget/gtk/nsDragService.cpp @@ -23,7 +23,11 @@ #include "prthread.h" #include #include -+#ifdef MOZ_WAYLAND -+#include -+#else ++#ifdef MOZ_X11 #include ++#else ++#include +#endif #include "nsCRT.h" #include "mozilla/BasicEvents.h" #include "mozilla/Services.h" -@@ -32,7 +36,6 @@ - #include "mozilla/ScopeExit.h" +@@ -33,7 +37,6 @@ + #include "mozilla/WidgetUtilsGtk.h" #include "GRefPtr.h" -#include "gfxXlibSurface.h" #include "gfxContext.h" #include "nsImageToPixbuf.h" #include "nsPresContext.h" -@@ -49,6 +52,8 @@ +@@ -50,6 +53,8 @@ #ifdef MOZ_WAYLAND # include "nsClipboardWayland.h" # include "gfxPlatformGtk.h" +#else -+#include "gfxXlibSurface.h" ++# include "gfxXlibSurface.h" #endif using namespace mozilla; diff --git a/widget/gtk/nsGtkKeyUtils.cpp b/widget/gtk/nsGtkKeyUtils.cpp -index c8b18e4..59acefa 100644 +index f4c7030a37..6c5af5394b 100644 --- a/widget/gtk/nsGtkKeyUtils.cpp +++ b/widget/gtk/nsGtkKeyUtils.cpp @@ -12,10 +12,12 @@ @@ -816,7 +772,7 @@ index c8b18e4..59acefa 100644 #include "X11UndefineNone.h" #include "IMContextWrapper.h" #include "WidgetUtils.h" -@@ -52,7 +54,7 @@ LazyLogModule gKeymapWrapperLog("KeymapWrapperWidgets"); +@@ -51,7 +53,7 @@ LazyLogModule gKeymapWrapperLog("KeymapWrapperWidgets"); KeymapWrapper* KeymapWrapper::sInstance = nullptr; guint KeymapWrapper::sLastRepeatableHardwareKeyCode = 0; @@ -825,41 +781,42 @@ index c8b18e4..59acefa 100644 KeymapWrapper::RepeatState KeymapWrapper::sRepeatState = KeymapWrapper::NOT_PRESSED; -@@ -347,9 +349,11 @@ KeymapWrapper::KeymapWrapper() +@@ -346,9 +348,11 @@ KeymapWrapper::KeymapWrapper() g_object_ref(mGdkKeymap); +#ifdef MOZ_X11 - if (gfxPlatformGtk::GetPlatform()->IsX11Display()) { + if (GdkIsX11Display()) { InitXKBExtension(); } +#endif Init(); } -@@ -366,16 +370,18 @@ void KeymapWrapper::Init() { +@@ -365,16 +369,19 @@ void KeymapWrapper::Init() { mModifierKeys.Clear(); memset(mModifierMasks, 0, sizeof(mModifierMasks)); +#ifdef MOZ_X11 - if (gfxPlatformGtk::GetPlatform()->IsX11Display()) { + if (GdkIsX11Display()) { InitBySystemSettingsX11(); - } +- } ++ } else { +#endif #ifdef MOZ_WAYLAND - else { -- InitBySystemSettingsWayland(); -- } -+ InitBySystemSettingsWayland(); + InitBySystemSettingsWayland(); ++#endif ++#ifdef MOZ_X11 + } ++ gdk_window_add_filter(nullptr, FilterEvents, this); #endif -+#ifdef MOZ_X11 - gdk_window_add_filter(nullptr, FilterEvents, this); -+#endif +- gdk_window_add_filter(nullptr, FilterEvents, this); MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, ("%p Init, CapsLock=0x%X, NumLock=0x%X, " -@@ -388,6 +394,7 @@ void KeymapWrapper::Init() { +@@ -387,6 +394,7 @@ void KeymapWrapper::Init() { GetModifierMask(SUPER), GetModifierMask(HYPER))); } @@ -867,17 +824,7 @@ index c8b18e4..59acefa 100644 void KeymapWrapper::InitXKBExtension() { PodZero(&mKeyboardState); -@@ -448,7 +455,9 @@ void KeymapWrapper::InitXKBExtension() { - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, - ("%p InitXKBExtension, Succeeded", this)); - } -+#endif - -+#ifdef MOZ_X11 - void KeymapWrapper::InitBySystemSettingsX11() { - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, - ("%p InitBySystemSettingsX11, mGdkKeymap=%p", this, mGdkKeymap)); -@@ -620,6 +629,7 @@ void KeymapWrapper::InitBySystemSettingsX11() { +@@ -619,6 +627,7 @@ void KeymapWrapper::InitBySystemSettingsX11() { XFreeModifiermap(xmodmap); XFree(xkeymap); } @@ -885,7 +832,7 @@ index c8b18e4..59acefa 100644 #ifdef MOZ_WAYLAND void KeymapWrapper::SetModifierMask(xkb_keymap* aKeymap, -@@ -777,7 +787,9 @@ void KeymapWrapper::InitBySystemSettingsWayland() { +@@ -776,7 +785,9 @@ void KeymapWrapper::InitBySystemSettingsWayland() { #endif KeymapWrapper::~KeymapWrapper() { @@ -895,7 +842,7 @@ index c8b18e4..59acefa 100644 if (mOnKeysChangedSignalHandle) { g_signal_handler_disconnect(mGdkKeymap, mOnKeysChangedSignalHandle); } -@@ -788,6 +800,7 @@ KeymapWrapper::~KeymapWrapper() { +@@ -787,6 +798,7 @@ KeymapWrapper::~KeymapWrapper() { MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, ("%p Destructor", this)); } @@ -903,7 +850,7 @@ index c8b18e4..59acefa 100644 /* static */ GdkFilterReturn KeymapWrapper::FilterEvents(GdkXEvent* aXEvent, GdkEvent* aGdkEvent, -@@ -901,6 +914,7 @@ GdkFilterReturn KeymapWrapper::FilterEvents(GdkXEvent* aXEvent, +@@ -900,6 +912,7 @@ GdkFilterReturn KeymapWrapper::FilterEvents(GdkXEvent* aXEvent, return GDK_FILTER_CONTINUE; } @@ -911,7 +858,7 @@ index c8b18e4..59acefa 100644 static void ResetBidiKeyboard() { // Reset the bidi keyboard settings for the new GdkKeymap -@@ -1761,6 +1775,7 @@ void KeymapWrapper::InitKeyEvent(WidgetKeyboardEvent& aKeyEvent, +@@ -1760,6 +1773,7 @@ void KeymapWrapper::InitKeyEvent(WidgetKeyboardEvent& aKeyEvent, // state. It means if there're some pending modifier key press or // key release events, the result isn't what we want. guint modifierState = aGdkKeyEvent->state; @@ -919,7 +866,7 @@ index c8b18e4..59acefa 100644 GdkDisplay* gdkDisplay = gdk_display_get_default(); if (aGdkKeyEvent->is_modifier && GdkIsX11Display(gdkDisplay)) { Display* display = gdk_x11_display_get_xdisplay(gdkDisplay); -@@ -1778,6 +1793,7 @@ void KeymapWrapper::InitKeyEvent(WidgetKeyboardEvent& aKeyEvent, +@@ -1777,6 +1791,7 @@ void KeymapWrapper::InitKeyEvent(WidgetKeyboardEvent& aKeyEvent, } } } @@ -927,7 +874,7 @@ index c8b18e4..59acefa 100644 InitInputEvent(aKeyEvent, modifierState); switch (aGdkKeyEvent->keyval) { -@@ -2024,6 +2040,7 @@ bool KeymapWrapper::IsLatinGroup(guint8 aGroup) { +@@ -2023,6 +2038,7 @@ bool KeymapWrapper::IsLatinGroup(guint8 aGroup) { return result; } @@ -935,7 +882,7 @@ index c8b18e4..59acefa 100644 bool KeymapWrapper::IsAutoRepeatableKey(guint aHardwareKeyCode) { uint8_t indexOfArray = aHardwareKeyCode / 8; MOZ_ASSERT(indexOfArray < ArrayLength(mKeyboardState.auto_repeats), -@@ -2031,6 +2048,7 @@ bool KeymapWrapper::IsAutoRepeatableKey(guint aHardwareKeyCode) { +@@ -2030,6 +2046,7 @@ bool KeymapWrapper::IsAutoRepeatableKey(guint aHardwareKeyCode) { char bitMask = 1 << (aHardwareKeyCode % 8); return (mKeyboardState.auto_repeats[indexOfArray] & bitMask) != 0; } @@ -944,7 +891,7 @@ index c8b18e4..59acefa 100644 /* static */ bool KeymapWrapper::IsBasicLatinLetterOrNumeral(uint32_t aCharCode) { diff --git a/widget/gtk/nsGtkKeyUtils.h b/widget/gtk/nsGtkKeyUtils.h -index 07d60c2..aebb482 100644 +index 07d60c27a6..43df8095fd 100644 --- a/widget/gtk/nsGtkKeyUtils.h +++ b/widget/gtk/nsGtkKeyUtils.h @@ -13,7 +13,9 @@ @@ -957,17 +904,11 @@ index 07d60c2..aebb482 100644 #ifdef MOZ_WAYLAND # include # include -@@ -309,6 +311,7 @@ class KeymapWrapper { - */ - int mXKBBaseEventCode; - -+#ifdef MOZ_X11 - /** - * Only auto_repeats[] stores valid value. If you need to use other - * members, you need to listen notification events for them. -@@ -316,6 +319,7 @@ class KeymapWrapper { +@@ -315,7 +317,9 @@ class KeymapWrapper { + * See a call of XkbSelectEventDetails() with XkbControlsNotify in * InitXKBExtension(). */ ++#ifdef MOZ_X11 XKeyboardState mKeyboardState; +#endif @@ -982,58 +923,43 @@ index 07d60c2..aebb482 100644 enum RepeatState { NOT_PRESSED, FIRST_PRESS, REPEATING }; static RepeatState sRepeatState; -diff --git a/widget/gtk/nsNativeThemeGTK.cpp b/widget/gtk/nsNativeThemeGTK.cpp -index 9761cde..832455c 100644 ---- a/widget/gtk/nsNativeThemeGTK.cpp -+++ b/widget/gtk/nsNativeThemeGTK.cpp -@@ -838,7 +838,9 @@ static void DrawThemeWithCairo(gfxContext* aContext, DrawTarget* aDrawTarget, - const nsIntSize& aDrawSize, - GdkRectangle& aGDKRect, - nsITheme::Transparency aTransparency) { -+#ifdef MOZ_X11 - bool isX11Display = gfxPlatformGtk::GetPlatform()->IsX11Display(); -+#endif - static auto sCairoSurfaceSetDeviceScalePtr = - (void (*)(cairo_surface_t*, double, double))dlsym( - RTLD_DEFAULT, "cairo_surface_set_device_scale"); diff --git a/widget/gtk/nsPrintDialogGTK.cpp b/widget/gtk/nsPrintDialogGTK.cpp -index 9c1a72a..1bda87c 100644 +index 48e9b6521f..461e6b2502 100644 --- a/widget/gtk/nsPrintDialogGTK.cpp +++ b/widget/gtk/nsPrintDialogGTK.cpp -@@ -25,7 +25,12 @@ +@@ -26,7 +26,11 @@ #include "nsIObserverService.h" // for gdk_x11_window_get_xid +#ifdef MOZ_X11 #include -+#endif -+#ifdef MOZ_WAYLAND ++#else +#include +#endif #include #include #include -@@ -526,6 +531,7 @@ static void wayland_window_handle_exported(GdkWindow* window, +@@ -526,6 +530,7 @@ static void wayland_window_handle_exported(GdkWindow* window, static gboolean window_export_handle(GtkWindow* window, GtkWindowHandleExported callback, gpointer user_data) { +#ifdef MOZ_X11 - if (gfxPlatformGtk::GetPlatform()->IsX11Display()) { + if (GdkIsX11Display()) { GdkWindow* gdk_window = gtk_widget_get_window(GTK_WIDGET(window)); char* handle_str; -@@ -536,8 +542,9 @@ static gboolean window_export_handle(GtkWindow* window, +@@ -536,8 +541,9 @@ static gboolean window_export_handle(GtkWindow* window, g_free(handle_str); return true; } +#endif #ifdef MOZ_WAYLAND -- else { -+ if (!gfxPlatformGtk::GetPlatform()->IsX11Display()) { +- else if (GdkIsWaylandDisplay()) { ++ if (GdkIsWaylandDisplay()) { GdkWindow* gdk_window = gtk_widget_get_window(GTK_WIDGET(window)); WaylandWindowHandleExportedData* data; diff --git a/widget/gtk/nsUserIdleServiceGTK.cpp b/widget/gtk/nsUserIdleServiceGTK.cpp -index 884d52a..23bb2d6 100644 +index 884d52a6ca..d865b9a236 100644 --- a/widget/gtk/nsUserIdleServiceGTK.cpp +++ b/widget/gtk/nsUserIdleServiceGTK.cpp @@ -17,6 +17,7 @@ using mozilla::LogLevel; @@ -1061,19 +987,19 @@ index 884d52a..23bb2d6 100644 if (!mozilla::widget::GdkIsX11Display()) { return; } -@@ -57,16 +61,23 @@ static void Initialize() { +@@ -57,16 +61,22 @@ static void Initialize() { MOZ_LOG(sIdleLog, LogLevel::Warning, ("Failed to get XSSAllocInfo!\n")); if (!_XSSQueryInfo) MOZ_LOG(sIdleLog, LogLevel::Warning, ("Failed to get XSSQueryInfo!\n")); +- +#endif - sInitialized = true; } -nsUserIdleServiceGTK::nsUserIdleServiceGTK() : mXssInfo(nullptr) { -+nsUserIdleServiceGTK::nsUserIdleServiceGTK() ++nsUserIdleServiceGTK::nsUserIdleServiceGTK() +#ifdef MOZ_X11 -+: mXssInfo(nullptr) ++: mXssInfo(nullptr) +#endif +{ Initialize(); @@ -1086,7 +1012,7 @@ index 884d52a..23bb2d6 100644 // It is not safe to unload libXScrnSaver until each display is closed because // the library registers callbacks through XESetCloseDisplay (Bug 397607). -@@ -88,6 +99,7 @@ bool nsUserIdleServiceGTK::PollIdleTime(uint32_t* aIdleTime) { +@@ -88,6 +98,7 @@ bool nsUserIdleServiceGTK::PollIdleTime(uint32_t* aIdleTime) { // Ask xscreensaver about idle time: *aIdleTime = 0; @@ -1094,7 +1020,7 @@ index 884d52a..23bb2d6 100644 // We might not have a display (cf. in xpcshell) Display* dplay = GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); if (!dplay) { -@@ -107,6 +119,7 @@ bool nsUserIdleServiceGTK::PollIdleTime(uint32_t* aIdleTime) { +@@ -107,6 +118,7 @@ bool nsUserIdleServiceGTK::PollIdleTime(uint32_t* aIdleTime) { *aIdleTime = mXssInfo->idle; return true; } @@ -1103,10 +1029,10 @@ index 884d52a..23bb2d6 100644 MOZ_LOG(sIdleLog, LogLevel::Warning, ("XSSQueryExtension returned false!\n")); return false; diff --git a/widget/gtk/nsUserIdleServiceGTK.h b/widget/gtk/nsUserIdleServiceGTK.h -index 9b9ba31..ac2a6c1 100644 +index 9b9ba31846..8f83aee584 100644 --- a/widget/gtk/nsUserIdleServiceGTK.h +++ b/widget/gtk/nsUserIdleServiceGTK.h -@@ -9,10 +9,13 @@ +@@ -9,6 +9,7 @@ #define nsUserIdleServiceGTK_h__ #include "nsUserIdleService.h" @@ -1114,13 +1040,7 @@ index 9b9ba31..ac2a6c1 100644 #include #include #include -+#endif - -+#ifdef MOZ_X11 - typedef struct { - Window window; // Screen saver window - int state; // ScreenSaver(Off,On,Disabled) -@@ -21,6 +24,7 @@ typedef struct { +@@ -21,6 +22,7 @@ typedef struct { unsigned long idle; // milliseconds idle unsigned long event_mask; // event stuff } XScreenSaverInfo; @@ -1128,7 +1048,7 @@ index 9b9ba31..ac2a6c1 100644 class nsUserIdleServiceGTK : public nsUserIdleService { public: -@@ -40,7 +44,9 @@ class nsUserIdleServiceGTK : public nsUserIdleService { +@@ -40,7 +42,9 @@ class nsUserIdleServiceGTK : public nsUserIdleService { private: ~nsUserIdleServiceGTK(); @@ -1139,7 +1059,7 @@ index 9b9ba31..ac2a6c1 100644 protected: nsUserIdleServiceGTK(); diff --git a/widget/gtk/nsWidgetFactory.cpp b/widget/gtk/nsWidgetFactory.cpp -index d649c7e..70b47d5 100644 +index d649c7e0bf..70b47d5124 100644 --- a/widget/gtk/nsWidgetFactory.cpp +++ b/widget/gtk/nsWidgetFactory.cpp @@ -20,9 +20,7 @@ @@ -1170,73 +1090,61 @@ index d649c7e..70b47d5 100644 nsresult nsWidgetGtk2ModuleCtor() { return nsAppShellInit(); } diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp -index 828f506..9f392fa 100644 +index f78ce835ef..fdd3580b72 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp -@@ -25,7 +25,6 @@ +@@ -57,7 +57,6 @@ #include "mozilla/UniquePtrExtensions.h" #include "mozilla/WidgetUtils.h" #include "mozilla/WritingModes.h" -#include "mozilla/X11Util.h" #include "mozilla/XREAppData.h" - #include "mozilla/dom/Document.h" - #include "mozilla/dom/WheelEventBinding.h" -@@ -53,23 +52,26 @@ + #include "NativeKeyBindings.h" + #include "nsAppDirectoryServiceDefs.h" +@@ -89,7 +88,6 @@ + #include "ScreenHelperGTK.h" + #include "SystemTimeConverter.h" #include "WidgetUtilsGtk.h" +-#include "mozilla/X11Util.h" - #include --#include - - #ifdef MOZ_WAYLAND - # include - #endif /* MOZ_WAYLAND */ - - #ifdef MOZ_X11 -+# include - # include - # include - # include - # include - # include -+# include "mozilla/X11Util.h" - #endif /* MOZ_X11 */ - - #include - - #if defined(MOZ_WAYLAND) -+# include -+# include - # include - # include "nsView.h" + #ifdef ACCESSIBILITY + # include "mozilla/a11y/LocalAccessible.h" +@@ -97,19 +95,23 @@ + # include "nsAccessibilityService.h" #endif -@@ -129,11 +131,11 @@ using namespace mozilla::widget; - #include "mozilla/layers/APZInputBridge.h" - #include "mozilla/layers/IAPZCTreeManager.h" +#include "GLContextEGL.h" // for GLContextEGL::FindVisual() +#include "GtkCompositorWidget.h" #ifdef MOZ_X11 - # include "mozilla/gfx/gfxVars.h" ++# include "mozilla/X11Util.h" + # include + # include + # include + # include + # include "gfxXlibSurface.h" # include "GLContextGLX.h" // for GLContextGLX::FindVisual() -# include "GLContextEGL.h" // for GLContextEGL::FindVisual() --# include "GtkCompositorWidget.h" - # include "gfxXlibSurface.h" # include "WindowSurfaceX11Image.h" # include "WindowSurfaceX11SHM.h" -@@ -155,8 +157,11 @@ using namespace mozilla; - using namespace mozilla::gfx; - using namespace mozilla::widget; + # include "WindowSurfaceXRender.h" + #endif + #ifdef MOZ_WAYLAND ++# include ++# include + # include "nsIClipboard.h" + # include "nsView.h" + #endif +@@ -119,7 +121,9 @@ using namespace mozilla::gfx; using namespace mozilla::layers; --using mozilla::gl::GLContextEGL; + using namespace mozilla::widget; + using mozilla::gl::GLContextEGL; +#ifdef MOZ_X11 using mozilla::gl::GLContextGLX; -+#else -+using mozilla::gl::GLContextEGL; +#endif // Don't put more than this many rects in the dirty region, just fluff // out to the bounding-box if there are more -@@ -324,6 +329,7 @@ void nsWindow::WithSettingsChangesIgnored(const std::function& aFn) { +@@ -278,6 +282,7 @@ bool nsWindow::sTransparentMainWindow = false; namespace mozilla { @@ -1244,7 +1152,7 @@ index 828f506..9f392fa 100644 class CurrentX11TimeGetter { public: explicit CurrentX11TimeGetter(GdkWindow* aWindow) -@@ -371,6 +377,7 @@ class CurrentX11TimeGetter { +@@ -325,6 +330,7 @@ class CurrentX11TimeGetter { GdkWindow* mWindow; TimeStamp mAsyncUpdateStart; }; @@ -1252,28 +1160,15 @@ index 828f506..9f392fa 100644 } // namespace mozilla -@@ -477,8 +484,11 @@ nsWindow::nsWindow() { - mCreated = false; - mHandleTouchEvent = false; - mIsDragPopup = false; -+#ifdef MOZ_X11 - mIsX11Display = gfxPlatformGtk::GetPlatform()->IsX11Display(); -- -+#else -+ mIsX11Display = false; -+#endif - mContainer = nullptr; - mGdkWindow = nullptr; - mShell = nullptr; -@@ -1939,6 +1949,7 @@ void nsWindow::SetSizeMode(nsSizeMode aMode) { +@@ -2342,6 +2348,7 @@ void nsWindow::SetSizeMode(nsSizeMode aMode) { } static bool GetWindowManagerName(GdkWindow* gdk_window, nsACString& wmName) { +#ifdef MOZ_X11 - if (!gfxPlatformGtk::GetPlatform()->IsX11Display()) { + if (!GdkIsX11Display()) { return false; } -@@ -2005,6 +2016,7 @@ static bool GetWindowManagerName(GdkWindow* gdk_window, nsACString& wmName) { +@@ -2408,6 +2415,7 @@ static bool GetWindowManagerName(GdkWindow* gdk_window, nsACString& wmName) { } wmName = reinterpret_cast(prop_return); @@ -1281,15 +1176,16 @@ index 828f506..9f392fa 100644 return true; } -@@ -2062,6 +2074,7 @@ void nsWindow::GetWorkspaceID(nsAString& workspaceID) { - if (!mIsX11Display || !mShell) { +@@ -2465,6 +2473,8 @@ void nsWindow::GetWorkspaceID(nsAString& workspaceID) { + if (!GdkIsX11Display() || !mShell) { return; } ++ +#ifdef MOZ_X11 // Get the gdk window for this widget. GdkWindow* gdk_window = gtk_widget_get_window(mShell); if (!gdk_window) { -@@ -2090,6 +2103,7 @@ void nsWindow::GetWorkspaceID(nsAString& workspaceID) { +@@ -2493,6 +2503,7 @@ void nsWindow::GetWorkspaceID(nsAString& workspaceID) { workspaceID.AppendInt((int32_t)wm_desktop[0]); g_free(wm_desktop); @@ -1297,23 +1193,24 @@ index 828f506..9f392fa 100644 } void nsWindow::MoveToWorkspace(const nsAString& workspaceIDStr) { -@@ -2099,6 +2113,7 @@ void nsWindow::MoveToWorkspace(const nsAString& workspaceIDStr) { +@@ -2501,7 +2512,7 @@ void nsWindow::MoveToWorkspace(const nsAString& workspaceIDStr) { + if (NS_FAILED(rv) || !workspaceID || !GdkIsX11Display() || !mShell) { return; } - +- +#ifdef MOZ_X11 // Get the gdk window for this widget. GdkWindow* gdk_window = gtk_widget_get_window(mShell); if (!gdk_window) { -@@ -2132,6 +2147,7 @@ void nsWindow::MoveToWorkspace(const nsAString& workspaceIDStr) { +@@ -2535,6 +2546,7 @@ void nsWindow::MoveToWorkspace(const nsAString& workspaceIDStr) { SubstructureNotifyMask | SubstructureRedirectMask, &xevent); XFlush(xdisplay); +#endif } - typedef void (*SetUserTimeFunc)(GdkWindow* aWindow, guint32 aTimestamp); -@@ -2172,9 +2188,13 @@ guint32 nsWindow::GetLastUserInputTime() { + using SetUserTimeFunc = void (*)(GdkWindow*, guint32); +@@ -2575,9 +2587,13 @@ guint32 nsWindow::GetLastUserInputTime() { // button and key releases. Therefore use the most recent of // gdk_x11_display_get_user_time and the last time that we have seen. GdkDisplay* gdkDisplay = gdk_display_get_default(); @@ -1327,7 +1224,7 @@ index 828f506..9f392fa 100644 if (sLastUserInputTime != GDK_CURRENT_TIME && TimestampIsNewerThan(sLastUserInputTime, timestamp)) { -@@ -2331,6 +2351,7 @@ void nsWindow::UpdateClientOffsetFromFrameExtents() { +@@ -2735,6 +2751,7 @@ void nsWindow::UpdateClientOffsetFromFrameExtents() { return; } @@ -1335,7 +1232,7 @@ index 828f506..9f392fa 100644 GdkAtom cardinal_atom = gdk_x11_xatom_to_atom(XA_CARDINAL); GdkAtom type_returned; -@@ -2364,6 +2385,7 @@ void nsWindow::UpdateClientOffsetFromFrameExtents() { +@@ -2768,6 +2785,7 @@ void nsWindow::UpdateClientOffsetFromFrameExtents() { LOG(("nsWindow::UpdateClientOffsetFromFrameExtents [%p] %d,%d\n", (void*)this, mClientOffset.x, mClientOffset.y)); @@ -1343,7 +1240,7 @@ index 828f506..9f392fa 100644 } LayoutDeviceIntPoint nsWindow::GetClientOffset() { -@@ -2373,6 +2395,7 @@ LayoutDeviceIntPoint nsWindow::GetClientOffset() { +@@ -2778,6 +2796,7 @@ LayoutDeviceIntPoint nsWindow::GetClientOffset() { gboolean nsWindow::OnPropertyNotifyEvent(GtkWidget* aWidget, GdkEventProperty* aEvent) { @@ -1351,74 +1248,62 @@ index 828f506..9f392fa 100644 if (aEvent->atom == gdk_atom_intern("_NET_FRAME_EXTENTS", FALSE)) { UpdateClientOffsetFromFrameExtents(); return FALSE; -@@ -2381,6 +2404,7 @@ gboolean nsWindow::OnPropertyNotifyEvent(GtkWidget* aWidget, +@@ -2786,7 +2805,7 @@ gboolean nsWindow::OnPropertyNotifyEvent(GtkWidget* aWidget, if (GetCurrentTimeGetter()->PropertyNotifyHandler(aWidget, aEvent)) { return TRUE; } +- +#endif - return FALSE; } -@@ -2517,9 +2541,11 @@ void* nsWindow::GetNativeData(uint32_t aDataType) { + +@@ -2924,9 +2943,11 @@ void* nsWindow::GetNativeData(uint32_t aDataType) { + return GetToplevelWidget(); case NS_NATIVE_WINDOW_WEBRTC_DEVICE_ID: - case NS_NATIVE_SHAREABLE_WINDOW: -+#ifdef MOZ_X1 - if (mIsX11Display) { ++#ifdef MOZ_X11 + if (GdkIsX11Display()) { return (void*)GDK_WINDOW_XID(gdk_window_get_toplevel(mGdkWindow)); } +#endif NS_WARNING( - "nsWindow::GetNativeData(): " - "NS_NATIVE_SHAREABLE_WINDOW / NS_NATIVE_WINDOW_WEBRTC_DEVICE_ID is " -@@ -2541,9 +2567,11 @@ void* nsWindow::GetNativeData(uint32_t aDataType) { + "nsWindow::GetNativeData(): NS_NATIVE_WINDOW_WEBRTC_DEVICE_ID is not " + "handled on Wayland!"); +@@ -2946,9 +2967,11 @@ void* nsWindow::GetNativeData(uint32_t aDataType) { case NS_NATIVE_OPENGL_CONTEXT: return nullptr; case NS_NATIVE_EGL_WINDOW: { +#ifdef MOZ_X11 - if (mIsX11Display) { + if (GdkIsX11Display()) { return mGdkWindow ? (void*)GDK_WINDOW_XID(mGdkWindow) : nullptr; } -+#endif // MOZ_X11 ++#endif #ifdef MOZ_WAYLAND if (mContainer) { return moz_container_wayland_get_egl_window(mContainer, -@@ -2882,8 +2910,13 @@ gboolean nsWindow::OnExposeEvent(cairo_t* cr) { +@@ -3289,8 +3312,13 @@ gboolean nsWindow::OnExposeEvent(cairo_t* cr) { nsIWidgetListener* listener = GetListener(); if (!listener) return FALSE; +#ifdef MOZ_X11 - LOGDRAW(("received expose event [%p] %p 0x%lx (rects follow):\n", this, - mGdkWindow, mIsX11Display ? gdk_x11_window_get_xid(mGdkWindow) : 0)); + LOG(("received expose event [%p] %p 0x%lx (rects follow):\n", this, + mGdkWindow, GdkIsX11Display() ? gdk_x11_window_get_xid(mGdkWindow) : 0)); +#else -+ LOGDRAW(("received expose event [%p] %p 0x%lx (rects follow):\n", this, -+ mGdkWindow, 0)); ++ LOG(("received expose event [%p] %p 0x%lx (rects follow):\n", this, ++ mGdkWindow, 0)); +#endif LayoutDeviceIntRegion exposeRegion; if (!ExtractExposeRegion(exposeRegion, cr)) { return FALSE; -@@ -3266,12 +3299,10 @@ void nsWindow::OnSizeAllocate(GtkAllocation* aAllocation) { - - mBounds.SizeTo(size); - --#ifdef MOZ_X11 - // Notify the GtkCompositorWidget of a ClientSizeChange - if (mCompositorWidgetDelegate) { - mCompositorWidgetDelegate->NotifyClientSizeChanged(GetClientSize()); - } --#endif - - // Gecko permits running nested event loops during processing of events, - // GtkWindow callers of gtk_widget_size_allocate expect the signal -@@ -3412,6 +3443,7 @@ void nsWindow::OnMotionNotifyEvent(GdkEventMotion* aEvent) { +@@ -3819,6 +3847,7 @@ void nsWindow::OnMotionNotifyEvent(GdkEventMotion* aEvent) { MOZ_ASSERT(gdk_window, "gdk_window_get_toplevel should not return null"); bool canDrag = true; +#ifdef MOZ_X11 - if (mIsX11Display) { + if (GdkIsX11Display()) { // Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=789054 // To avoid crashes disable double-click on WM without _NET_WM_MOVERESIZE. -@@ -3422,6 +3454,7 @@ void nsWindow::OnMotionNotifyEvent(GdkEventMotion* aEvent) { +@@ -3829,6 +3858,7 @@ void nsWindow::OnMotionNotifyEvent(GdkEventMotion* aEvent) { canDrag = false; } } @@ -1426,7 +1311,7 @@ index 828f506..9f392fa 100644 if (canDrag) { gdk_window_begin_move_drag(gdk_window, 1, aEvent->x_root, aEvent->y_root, -@@ -3911,16 +3944,20 @@ TimeStamp nsWindow::GetEventTimeStamp(guint32 aEventTime) { +@@ -4321,16 +4351,20 @@ TimeStamp nsWindow::GetEventTimeStamp(guint32 aEventTime) { int64_t tick = BaseTimeDurationPlatformUtils::TicksFromMilliseconds(timestampTime); eventTimeStamp = TimeStamp::FromSystemTime(tick); @@ -1448,15 +1333,15 @@ index 828f506..9f392fa 100644 mozilla::CurrentX11TimeGetter* nsWindow::GetCurrentTimeGetter() { MOZ_ASSERT(mGdkWindow, "Expected mGdkWindow to be set"); if (MOZ_UNLIKELY(!mCurrentTimeGetter)) { -@@ -3928,6 +3965,7 @@ mozilla::CurrentX11TimeGetter* nsWindow::GetCurrentTimeGetter() { +@@ -4338,6 +4372,7 @@ mozilla::CurrentX11TimeGetter* nsWindow::GetCurrentTimeGetter() { } return mCurrentTimeGetter.get(); } +#endif gboolean nsWindow::OnKeyPressEvent(GdkEventKey* aEvent) { - LOGFOCUS(("OnKeyPressEvent [%p]\n", (void*)this)); -@@ -4485,6 +4523,7 @@ static GdkWindow* CreateGdkWindow(GdkWindow* parent, GtkWidget* widget) { + LOG(("OnKeyPressEvent [%p]\n", (void*)this)); +@@ -4914,6 +4949,7 @@ static GdkWindow* CreateGdkWindow(GdkWindow* parent, GtkWidget* widget) { return window; } @@ -1464,73 +1349,31 @@ index 828f506..9f392fa 100644 // Configure GL visual on X11. We add alpha silently // if we use WebRender to workaround NVIDIA specific Bug 1663273. bool nsWindow::ConfigureX11GLVisual(bool aUseAlpha) { -@@ -4536,6 +4575,7 @@ bool nsWindow::ConfigureX11GLVisual(bool aUseAlpha) { +@@ -4965,6 +5001,7 @@ bool nsWindow::ConfigureX11GLVisual(bool aUseAlpha) { return true; } +#endif - nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent, - const LayoutDeviceIntRect& aRect, -@@ -5113,8 +5153,13 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent, + nsCString nsWindow::GetWindowNodeName() { + nsCString nodeName("Unknown"); +@@ -5552,9 +5589,15 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent, mWindowType == eWindowType_toplevel ? "Toplevel" : "Popup", mIsPIPWindow ? "PIP window" : "")); if (mShell) { +#ifdef MOZ_X11 LOG(("\tmShell %p mContainer %p mGdkWindow %p 0x%lx\n", mShell, mContainer, - mGdkWindow, mIsX11Display ? gdk_x11_window_get_xid(mGdkWindow) : 0)); + mGdkWindow, + GdkIsX11Display() ? gdk_x11_window_get_xid(mGdkWindow) : 0)); +#else + LOG(("\tmShell %p mContainer %p mGdkWindow %p 0x%lx\n", mShell, mContainer, -+ mGdkWindow, 0)); ++ mGdkWindow, ++ 0)); +#endif } else if (mContainer) { LOG(("\tmContainer %p mGdkWindow %p\n", mContainer, mGdkWindow)); } else if (mGdkWindow) { -@@ -5147,13 +5192,13 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent, - SetCompositorHint(GTK_WIDGET_COMPOSIDED_ENABLED); - } - } -+#endif - # ifdef MOZ_WAYLAND -- else if (!mIsX11Display) { -+ if (!mIsX11Display) { - mSurfaceProvider.Initialize(this); - WaylandStartVsync(); - } - # endif --#endif - - // Set default application name when it's empty. - if (mGtkWindowAppName.IsEmpty()) { -@@ -5266,13 +5311,11 @@ void nsWindow::NativeResize() { - gdk_window_resize(mGdkWindow, size.width, size.height); - } - --#ifdef MOZ_X11 - // Notify the GtkCompositorWidget of a ClientSizeChange - // This is different than OnSizeAllocate to catch initial sizing - if (mCompositorWidgetDelegate) { - mCompositorWidgetDelegate->NotifyClientSizeChanged(GetClientSize()); - } --#endif - - // Does it need to be shown because bounds were previously insane? - if (mNeedsShow && mIsShown) { -@@ -5326,13 +5369,11 @@ void nsWindow::NativeMoveResize() { - } - } - --#ifdef MOZ_X11 - // Notify the GtkCompositorWidget of a ClientSizeChange - // This is different than OnSizeAllocate to catch initial sizing - if (mCompositorWidgetDelegate) { - mCompositorWidgetDelegate->NotifyClientSizeChanged(GetClientSize()); - } --#endif - - // Does it need to be shown because bounds were previously insane? - if (mNeedsShow && mIsShown) { -@@ -6038,6 +6079,7 @@ void nsWindow::UpdateTitlebarTransparencyBitmap() { +@@ -6478,6 +6521,7 @@ void nsWindow::UpdateTitlebarTransparencyBitmap() { cairo_surface_destroy(surface); } @@ -1538,7 +1381,7 @@ index 828f506..9f392fa 100644 if (!mNeedsShow) { Display* xDisplay = GDK_WINDOW_XDISPLAY(mGdkWindow); Window xDrawable = GDK_WINDOW_XID(mGdkWindow); -@@ -6060,6 +6102,7 @@ void nsWindow::UpdateTitlebarTransparencyBitmap() { +@@ -6500,6 +6544,7 @@ void nsWindow::UpdateTitlebarTransparencyBitmap() { XFreePixmap(xDisplay, maskPixmap); } @@ -1546,15 +1389,24 @@ index 828f506..9f392fa 100644 } void nsWindow::GrabPointer(guint32 aTime) { -@@ -7609,6 +7652,7 @@ bool nsWindow::GetDragInfo(WidgetMouseEvent* aMouseEvent, GdkWindow** aWindow, +@@ -6772,7 +6817,7 @@ static bool IsFullscreenSupported(GtkWidget* aShell) { + GdkScreen* screen = gtk_widget_get_screen(aShell); + GdkAtom atom = gdk_atom_intern("_NET_WM_STATE_FULLSCREEN", FALSE); + return gdk_x11_screen_supports_net_wm_hint(screen, atom); +-#elif ++#else + return true; + #endif + } +@@ -8048,6 +8093,7 @@ bool nsWindow::GetDragInfo(WidgetMouseEvent* aMouseEvent, GdkWindow** aWindow, return false; } +#ifdef MOZ_X11 - if (mIsX11Display) { + if (GdkIsX11Display()) { // Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=789054 // To avoid crashes disable double-click on WM without _NET_WM_MOVERESIZE. -@@ -7624,6 +7668,7 @@ bool nsWindow::GetDragInfo(WidgetMouseEvent* aMouseEvent, GdkWindow** aWindow, +@@ -8063,6 +8109,7 @@ bool nsWindow::GetDragInfo(WidgetMouseEvent* aMouseEvent, GdkWindow** aWindow, } } } @@ -1562,37 +1414,32 @@ index 828f506..9f392fa 100644 // FIXME: It would be nice to have the widget position at the time // of the event, but it's relatively unlikely that the widget has -@@ -8326,16 +8371,25 @@ void nsWindow::GetCompositorWidgetInitData( +@@ -8794,6 +8841,7 @@ void nsWindow::GetCompositorWidgetInitData( mozilla::widget::CompositorWidgetInitData* aInitData) { - // Make sure the window XID is propagated to X server, we can fail otherwise - // in GPU process (Bug 1401634). -+#ifdef MOZ_X11 - if (mXDisplay && mXWindow != X11None) { - XFlush(mXDisplay); - } -+#endif + nsCString displayName; - bool isShaped = - mIsTransparent && !mHasAlphaVisual && !mTransparencyBitmapForTitlebar; +#ifdef MOZ_X11 + if (GdkIsX11Display() && mXWindow != X11None) { + // Make sure the window XID is propagated to X server, we can fail otherwise + // in GPU process (Bug 1401634). +@@ -8807,6 +8855,12 @@ void nsWindow::GetCompositorWidgetInitData( *aInitData = mozilla::widget::GtkCompositorWidgetInitData( - (mXWindow != X11None) ? mXWindow : (uintptr_t) nullptr, - mXDisplay ? nsCString(XDisplayString(mXDisplay)) : nsCString(), isShaped, - mIsX11Display, GetClientSize()); + (mXWindow != X11None) ? mXWindow : (uintptr_t) nullptr, displayName, + isShaped, GdkIsX11Display(), GetClientSize()); +#else + *aInitData = mozilla::widget::GtkCompositorWidgetInitData( + (uintptr_t) nullptr, -+ nsCString(), isShaped, -+ mIsX11Display, GetClientSize()); ++ nsCString(), 0, ++ 0, GetClientSize()); +#endif } #ifdef MOZ_WAYLAND diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h -index ce25727..c1ca03c 100644 +index 9525c0c6da..6818f7cad2 100644 --- a/widget/gtk/nsWindow.h +++ b/widget/gtk/nsWindow.h -@@ -89,7 +89,9 @@ typedef struct _GdkEventTouchpadPinch GdkEventTouchpadPinch; +@@ -90,7 +90,9 @@ typedef struct _GdkEventTouchpadPinch GdkEventTouchpadPinch; namespace mozilla { class TimeStamp; @@ -1602,31 +1449,17 @@ index ce25727..c1ca03c 100644 } // namespace mozilla -@@ -313,7 +315,9 @@ class nsWindow final : public nsBaseWidget { +@@ -271,7 +273,9 @@ class nsWindow final : public nsBaseWidget { WidgetEventTime GetWidgetEventTime(guint32 aEventTime); mozilla::TimeStamp GetEventTimeStamp(guint32 aEventTime); -+#ifdef MOZ_X11 ++#ifdef MOV_X11 mozilla::CurrentX11TimeGetter* GetCurrentTimeGetter(); +#endif virtual void SetInputContext(const InputContext& aContext, const InputContextAction& aAction) override; -@@ -550,12 +554,12 @@ class nsWindow final : public nsBaseWidget { - nsRefPtrHashtable, mozilla::dom::Touch> - mTouches; - -+ mozilla::widget::WindowSurfaceProvider mSurfaceProvider; - #ifdef MOZ_X11 - Display* mXDisplay; - Window mXWindow; - Visual* mXVisual; - int mXDepth; -- mozilla::widget::WindowSurfaceProvider mSurfaceProvider; - - bool ConfigureX11GLVisual(bool aUseAlpha); - #endif -@@ -717,7 +721,9 @@ class nsWindow final : public nsBaseWidget { +@@ -756,7 +760,9 @@ class nsWindow final : public nsBaseWidget { */ RefPtr mIMContext; @@ -1636,31 +1469,36 @@ index ce25727..c1ca03c 100644 static GtkWindowDecoration sGtkWindowDecoration; static bool sTransparentMainWindow; +@@ -807,6 +813,7 @@ class nsWindow final : public nsBaseWidget { + void DispatchRestoreEventAccessible(); + #endif + ++mozilla::widget::WindowSurfaceProvider mSurfaceProvider; + #ifdef MOZ_X11 + typedef enum {GTK_WIDGET_COMPOSIDED_DEFAULT = 0, + GTK_WIDGET_COMPOSIDED_DISABLED = 1, +@@ -816,7 +823,6 @@ class nsWindow final : public nsBaseWidget { + Window mXWindow; + Visual* mXVisual; + int mXDepth; +- mozilla::widget::WindowSurfaceProvider mSurfaceProvider; + + bool ConfigureX11GLVisual(bool aUseAlpha); + #endif diff --git a/widget/moz.build b/widget/moz.build -index eb70e4d..aa298da 100644 +index 07e6970e56..9d1fe19661 100644 --- a/widget/moz.build +++ b/widget/moz.build -@@ -266,13 +266,17 @@ if CONFIG["MOZ_INSTRUMENT_EVENT_LOOP"]: +@@ -258,7 +258,7 @@ if CONFIG["MOZ_INSTRUMENT_EVENT_LOOP"]: + EXPORTS.ipc = ["nsGUIEventIPC.h"] - if CONFIG["MOZ_X11"]: -- DIRS += ["x11"] - SOURCES += [ -- "GfxInfoX11.cpp", - "nsShmImage.cpp", - "WindowSurfaceX11SHM.cpp", - ] - +-if CONFIG["MOZ_X11"]: +if CONFIG["MOZ_X11"] or CONFIG["MOZ_WAYLAND"]: -+ DIRS += ["x11"] -+ SOURCES += [ -+ "GfxInfoX11.cpp", -+ ] -+ + DIRS += ["x11"] + if toolkit in ("cocoa", "windows"): - UNIFIED_SOURCES += [ - "nsBaseClipboard.cpp", -@@ -321,7 +325,7 @@ if toolkit == "windows": +@@ -305,7 +305,7 @@ if toolkit == "windows": "windows/PCompositorWidget.ipdl", "windows/PlatformWidgetTypes.ipdlh", ] @@ -1669,3 +1507,16 @@ index eb70e4d..aa298da 100644 IPDL_SOURCES = [ "gtk/PCompositorWidget.ipdl", "gtk/PlatformWidgetTypes.ipdlh", +diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build +index f882569..1acea03 100644 +--- a/widget/gtk/moz.build ++++ b/widget/gtk/moz.build +@@ -149,7 +149,7 @@ LOCAL_INCLUDES += [ + "/widget/headless", + ] + +-if CONFIG["MOZ_X11"]: ++if CONFIG["MOZ_X11"] or CONFIG["MOZ_WAYLAND"]: + LOCAL_INCLUDES += [ + "/widget/x11", + ] diff --git a/extra/firefox/sources b/extra/firefox/sources index 645f6d1f..261bcf83 100644 --- a/extra/firefox/sources +++ b/extra/firefox/sources @@ -1,5 +1,4 @@ -https://ftp.mozilla.org/pub/firefox/releases/89.0.2/source/firefox-89.0.2.source.tar.xz +https://ftp.mozilla.org/pub/firefox/releases/90.0/source/firefox-90.0.source.tar.xz https://ftp.gnu.org/gnu/autoconf/autoconf-2.13.tar.gz autoconf2.13/ https://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz yasm/ -patches/no-gtk2.patch patches/no-x11.patch diff --git a/extra/firefox/version b/extra/firefox/version index ce23661e..8a23f417 100644 --- a/extra/firefox/version +++ b/extra/firefox/version @@ -1 +1 @@ -89.0.2 1 +90.0 1