diff options
author | Dan Nicholson <dbn.lists@gmail.com> | 2013-01-19 16:26:52 -0800 |
---|---|---|
committer | Dan Nicholson <dbn.lists@gmail.com> | 2013-01-19 16:26:52 -0800 |
commit | 47fc338f8ed28b44ba7cc9cebee3d2eb675e375f (patch) | |
tree | b0118cd19f60963a86f6310a260e34017202f8f9 | |
parent | 35ddf2903dd6c38bd27ae45e2868ee29f88b49e0 (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.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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; |