summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2013-01-19 16:26:52 -0800
committerDan Nicholson <dbn.lists@gmail.com>2013-01-19 16:26:52 -0800
commit47fc338f8ed28b44ba7cc9cebee3d2eb675e375f (patch)
treeb0118cd19f60963a86f6310a260e34017202f8f9
parent35ddf2903dd6c38bd27ae45e2868ee29f88b49e0 (diff)
Track whether the plugin is in- or out-of process
GtkPlug behaves differently in each instance, so we need to keep track of how the plugin is being run.
-rw-r--r--src/evbp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/evbp.c b/src/evbp.c
index fab3838..b6e6ff1 100644
--- a/src/evbp.c
+++ b/src/evbp.c
@@ -43,6 +43,7 @@ typedef struct evbp_priv {
NPP npp;
GtkWidget *plug;
GtkWidget *viewer;
+ gboolean in_process;
} evbp_priv_t;
static char *evbp_mime_string = NULL;
@@ -213,6 +214,13 @@ evbp_set_window(NPP instance, NPWindow *window)
window->height);
gtk_container_add(GTK_CONTAINER(priv->plug), priv->viewer);
gtk_widget_show(priv->plug);
+
+ /* Figure out whether the plugin is in the same process or not. If the
+ * plug is a toplevel widget, then it's out of process.
+ */
+ priv->in_process = !gtk_widget_is_toplevel(priv->plug);
+ g_debug("the plugin is %s-process",
+ priv->in_process ? "in" : "out-of");
}
return NPERR_NO_ERROR;