summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-12-20 01:33:24 +0000
committerDavid Robillard <d@drobilla.net>2012-12-20 01:33:24 +0000
commit417ec1d48361b0a0a464a4090cc90d00a55c4522 (patch)
tree0e20f84aa51b8c863eab89361615e31ad35fd071
parent74a4c2f441b939f8ce3a7b629c15b001578d7e6b (diff)
downloadsuil-417ec1d48361b0a0a464a4090cc90d00a55c4522.tar.gz
suil-417ec1d48361b0a0a464a4090cc90d00a55c4522.tar.bz2
suil-417ec1d48361b0a0a464a4090cc90d00a55c4522.zip
Fix crash in x11_in_gtk2 when event_filter fires before widget is realized.
git-svn-id: http://svn.drobilla.net/lad/trunk/suil@4864 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--NEWS3
-rw-r--r--src/x11_in_gtk2.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 70903f4..6e02961 100644
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,10 @@
suil (0.6.7) unstable;
+ * Fix crash in x11_in_gtk2 when event_filter fires before widget is realized
* Use libgtk-x11-2.0.so.0 (with .0 suffix) by default which is available on
systems without the dev package
- -- David Robillard <d@drobilla.net> Wed, 19 Dec 2012 18:25:49 -0500
+ -- David Robillard <d@drobilla.net> Wed, 19 Dec 2012 20:32:53 -0500
suil (0.6.6) stable;
diff --git a/src/x11_in_gtk2.c b/src/x11_in_gtk2.c
index cc33992..fd3547a 100644
--- a/src/x11_in_gtk2.c
+++ b/src/x11_in_gtk2.c
@@ -135,7 +135,9 @@ event_filter(GdkXEvent* xevent, GdkEvent* event, gpointer data)
{
SuilX11Wrapper* wrap = (SuilX11Wrapper*)data;
XEvent* ev = (XEvent*)xevent;
- if (wrap->instance->handle && (ev->type == KeyPress || ev->type == KeyRelease)) {
+ if (wrap->instance &&
+ wrap->instance->handle &&
+ (ev->type == KeyPress || ev->type == KeyRelease)) {
// Forward keyboard events to UI window
XSendEvent(ev->xkey.display, (Window)wrap->instance->ui_widget, 1, 0, ev);
XSync(ev->xkey.display, TRUE);