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



commit 3068fc18b80beaa4e6afe4b79e9268764dc1d0a0
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Mon Sep 5 15:14:14 2016 +0200

    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.

 browser-plugin/EvBrowserPluginMain.cpp |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/browser-plugin/EvBrowserPluginMain.cpp b/browser-plugin/EvBrowserPluginMain.cpp
index a25bb2f..a54d1e0 100644
--- a/browser-plugin/EvBrowserPluginMain.cpp
+++ b/browser-plugin/EvBrowserPluginMain.cpp
@@ -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();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]