summaryrefslogtreecommitdiffstats
path: root/src
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 /src
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
Diffstat (limited to 'src')
-rw-r--r--src/x11_in_gtk2.c4
1 files changed, 3 insertions, 1 deletions
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);