Commit 3068fc18 authored by Carlos Garcia Campos's avatar Carlos Garcia Campos Committed by Carlos Garcia Campos
Browse files

browser-plugin: Do not claim we support loading documents in Wayland

The plugin requires XEmbed, so when running on wayland we should return
with an error from NP_Initialize and NULL as the list of supported MIME
types in NP_GetMIMEDescription.
parent 0556b47c
......@@ -22,6 +22,7 @@
#include "EvMemoryUtils.h"
#include "npfunctions.h"
#include "npruntime.h"
#include <gdk/gdkwayland.h>
static NPNetscapeFuncs *browser;
static unique_gptr<char> mimeDescription;
......@@ -198,6 +199,11 @@ NPError NP_Initialize(NPNetscapeFuncs *browserFuncs, NPPluginFuncs *pluginFuncs)
gtk_init(nullptr, nullptr);
#ifdef GDK_WINDOWING_WAYLAND
if (GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default()))
return NPERR_GENERIC_ERROR;
#endif
browser = browserFuncs;
initializePluginFuncs(pluginFuncs);
......@@ -267,6 +273,11 @@ const char *NP_GetMIMEDescription()
if (!ev_init())
return nullptr;
#ifdef GDK_WINDOWING_WAYLAND
if (GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default()))
return nullptr;
#endif
GString *mimeDescriptionStr = g_string_new(nullptr);
GList *typesInfo = ev_backends_manager_get_all_types_info();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment