From 0eae777fd06f637d1f6ea06e854698822afcaf8e Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 3 Jul 2026 09:19:54 +0200 Subject: [PATCH] Issue #3132 Follow-up: only include gtk2xtbin.h on GTK targets. PR #3133 caused build breakage on non-gtk platforms by unconditionally including the header (because the def defaults to true in configure) This also reorganizes the configure script to add a check for MOZ_WIDGET_GTK (hoisted up a little) so the new configure entry is simply ignored on non-GTK targets. --- dom/plugins/ipc/PluginInstanceChild.cpp | 2 +- dom/plugins/ipc/PluginInstanceChild.h | 2 +- old-configure.in | 47 ++++++++++++++----------- 3 files changed, 28 insertions(+), 23 deletions(-) diff --git a/dom/plugins/ipc/PluginInstanceChild.cpp b/dom/plugins/ipc/PluginInstanceChild.cpp index 61e56a9438..b250cfaf94 100644 --- a/dom/plugins/ipc/PluginInstanceChild.cpp +++ b/dom/plugins/ipc/PluginInstanceChild.cpp @@ -4679,7 +4679,7 @@ PluginInstanceChild::Destroy() mPendingAsyncCalls.Clear(); -#ifdef MOZ_ENABLE_NPAPI_GTK2 +#if defined(MOZ_WIDGET_GTK) && defined (MOZ_ENABLE_NPAPI_GTK2) if (mWindow.type == NPWindowTypeWindow && !mXEmbed) { xt_client_xloop_destroy(); } diff --git a/dom/plugins/ipc/PluginInstanceChild.h b/dom/plugins/ipc/PluginInstanceChild.h index 57b88a30fb..63fb92115e 100644 --- a/dom/plugins/ipc/PluginInstanceChild.h +++ b/dom/plugins/ipc/PluginInstanceChild.h @@ -36,7 +36,7 @@ #include -#ifdef MOZ_ENABLE_NPAPI_GTK2 +#if defined(MOZ_WIDGET_GTK) && defined(MOZ_ENABLE_NPAPI_GTK2) #include "gtk2xtbin.h" #endif diff --git a/old-configure.in b/old-configure.in index 721cb87894..0652d4e141 100644 --- a/old-configure.in +++ b/old-configure.in @@ -2135,6 +2135,16 @@ if test -z "$XULRUNNER_STUB_NAME"; then fi AC_SUBST(XULRUNNER_STUB_NAME) +dnl ======================================================== + +dnl there are a lot of tests on MOZ_ENABLE_GTK below, that are more convenient +dnl to keep that way than testing against MOZ_WIDGET_TOOLKIT +case "$MOZ_WIDGET_TOOLKIT" in +gtk*) + MOZ_ENABLE_GTK=1 + ;; +esac + dnl ======================================================== dnl = NPAPI support dnl ======================================================== @@ -2146,25 +2156,28 @@ MOZ_ARG_DISABLE_BOOL(npapi, MOZ_ENABLE_NPAPI=, MOZ_ENABLE_NPAPI=1) -MOZ_ENABLE_NPAPI_GTK2=1 - -MOZ_ARG_DISABLE_BOOL(npapi-gtk2, -[ --disable-npapi-gtk2 Disable GTK2 support for NPAPI plugins ], - MOZ_ENABLE_NPAPI_GTK2=, - MOZ_ENABLE_NPAPI_GTK2=1) - if test "$MOZ_ENABLE_NPAPI" then AC_DEFINE(MOZ_ENABLE_NPAPI) fi -if test "$MOZ_ENABLE_NPAPI" -a "$MOZ_ENABLE_NPAPI_GTK2" -then - AC_DEFINE(MOZ_ENABLE_NPAPI_GTK2) -fi - AC_SUBST(MOZ_ENABLE_NPAPI) -AC_SUBST(MOZ_ENABLE_NPAPI_GTK2) + +if test -n "$MOZ_ENABLE_GTK" ; then + MOZ_ENABLE_NPAPI_GTK2=1 + + MOZ_ARG_DISABLE_BOOL(npapi-gtk2, + [ --disable-npapi-gtk2 Disable GTK2 support for NPAPI plugins ], + MOZ_ENABLE_NPAPI_GTK2=, + MOZ_ENABLE_NPAPI_GTK2=1) + + if test "$MOZ_ENABLE_NPAPI" -a "$MOZ_ENABLE_NPAPI_GTK2" + then + AC_DEFINE(MOZ_ENABLE_NPAPI_GTK2) + fi + + AC_SUBST(MOZ_ENABLE_NPAPI_GTK2) +fi dnl ======================================================== dnl = @@ -2205,14 +2218,6 @@ cocoa) esac -dnl there are a lot of tests on MOZ_ENABLE_GTK below, that are more convenient -dnl to keep that way than testing against MOZ_WIDGET_TOOLKIT -case "$MOZ_WIDGET_TOOLKIT" in -gtk*) - MOZ_ENABLE_GTK=1 - ;; -esac - if test "$MOZ_WIDGET_TOOLKIT" = gtk2 -a -z "$MOZ_ENABLE_NPAPI_GTK2"; then AC_MSG_ERROR([--disable-npapi-gtk2 cannot be used with GTK2 browser builds.]) fi