From 5e25e3099f2674b6d2302fcf9431c3326f6691cc Mon Sep 17 00:00:00 2001 From: bsp2 Date: Sun, 21 Oct 2018 01:09:55 +0200 Subject: [PATCH] query editor rect; pump X11 events --- other/vst2_debug_host/vst2_debug_host.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/other/vst2_debug_host/vst2_debug_host.cpp b/other/vst2_debug_host/vst2_debug_host.cpp index 06ddea8c..49714522 100644 --- a/other/vst2_debug_host/vst2_debug_host.cpp +++ b/other/vst2_debug_host/vst2_debug_host.cpp @@ -165,11 +165,15 @@ void open_and_close(void) { if(NULL != effect) { + ERect *rect = 0; + effect->dispatcher(effect, effEditGetRect, 0, 0, (void*)&rect, 0.0f); + printf("xxx effEditGetRect returned left=%d top=%d right=%d bottom=%d\n", rect->left, rect->top, rect->right, rect->bottom); #ifndef YAC_WIN32 - w = XCreateSimpleWindow(d, RootWindow(d, s), 10, 10, 100, 100, 1, - BlackPixel(d, s), WhitePixel(d, s)); - XSelectInput(d, w, ExposureMask | KeyPressMask); + w = XCreateSimpleWindow(d, RootWindow(d, s), rect->left, rect->top, (rect->right - rect->left), (rect->bottom - rect->top), 1, + BlackPixel(d, s), WhitePixel(d, s) + ); + XSelectInput(d, w, ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask | ButtonMotionMask | FocusChangeMask); XMapRaised(d, w); XFlush(d); #endif @@ -193,10 +197,17 @@ void open_and_close(void) { } else { - printf("xxx XEventProc found... calling\n"); void (* eventProc) (void * event); + int evIdx = 0; eventProc = (void (*) (void* event))result; - eventProc(NULL); + printf("xxx XEventProc found\n"); + for(;;) + { + XEvent xev; + XNextEvent(d, &xev); + printf("xxx call XEventProc[%d]\n", evIdx++); + eventProc(&xev); + } } #endif