diff options
author | Dan Nicholson <dbn.lists@gmail.com> | 2013-02-23 22:04:33 -0800 |
---|---|---|
committer | Dan Nicholson <dbn.lists@gmail.com> | 2013-02-23 22:06:45 -0800 |
commit | 17a838b9b101dae9dac0a72f81f0892ee01dadd6 (patch) | |
tree | cb5206a98a8088ff7beda0295790985d7b033c89 /src | |
parent | 95fb67d69f4638a97ed69f01fc758c7d2a48b2dd (diff) |
evbp: Protect against SetWindow after plug has been destroyed
For some reason, Epiphany (WebKitGtk) likes to send a last SetWindow
even as it's in the process of destroying the widget. Check whether the
plug is still a GtkWindow before telling it to resize to the Window
we're being told about.
Diffstat (limited to 'src')
-rw-r--r-- | src/evbp.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -202,10 +202,14 @@ evbp_set_window(NPP instance, NPWindow *window) /* Create a plug from the window id or just resize the existing one * appropriately. */ if (priv->plug) { - g_debug("resizing existing plug to %ux%u", window->width, - window->height); - gtk_window_resize(GTK_WINDOW(priv->plug), window->width, - window->height); + /* epiphany likes to throw one more set_window even after the widget + * has been destroyed. */ + if (GTK_IS_WINDOW(priv->plug)) { + g_debug("resizing existing plug to %ux%u", window->width, + window->height); + gtk_window_resize(GTK_WINDOW(priv->plug), window->width, + window->height); + } } else { Window id = (Window)window->window; |