diff options
author | David Robillard <d@drobilla.net> | 2012-12-20 01:33:24 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-12-20 01:33:24 +0000 |
commit | 417ec1d48361b0a0a464a4090cc90d00a55c4522 (patch) | |
tree | 0e20f84aa51b8c863eab89361615e31ad35fd071 | |
parent | 74a4c2f441b939f8ce3a7b629c15b001578d7e6b (diff) | |
download | suil-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-- | NEWS | 3 | ||||
-rw-r--r-- | src/x11_in_gtk2.c | 4 |
2 files changed, 5 insertions, 2 deletions
@@ -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); |