Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 29 additions & 8 deletions bundles/org.eclipse.swt/Eclipse SWT/common/library/callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -1641,6 +1641,10 @@ JNIEXPORT void JNICALL CALLBACK_NATIVE(unbind)
int i;
for (i=0; i<MAX_CALLBACKS; i++) {
if (callbackData[i].callback != NULL && (*env)->IsSameObject(env, callback, callbackData[i].callback)) {
#ifdef DEBUG_CALL_PRINTS
fprintf(stderr, "SWT-JNI: Unbinding callback[%02d]\n", i);
fflush(stderr);
#endif
if (callbackData[i].callback != NULL) (*env)->DeleteGlobalRef(env, callbackData[i].callback);
if (callbackData[i].object != NULL) (*env)->DeleteGlobalRef(env, callbackData[i].object);
memset(&callbackData[i], 0, sizeof(CALLBACK_DATA));
Expand Down Expand Up @@ -1863,14 +1867,31 @@ jlong callback(int index, ...)
}

if (!isPrinted && (i == callbackData[index].arg_GdkEvent)) {
const GdkEventAny* event = (const GdkEventAny*)arg;
fprintf(stderr,
"%p [GdkEvent type=%d window=%p [%s]] ",
event,
event->type,
event->window,
glibTypeNameFromInstance(event->window)
);
#if GDK_MAJOR_VERSION == 4
GdkEvent* event = (GdkEvent*)arg;
fprintf(stderr,
"%p [GdkEvent type=%d device=%p [%s] display=%p [%s] surface=%p [%s]] ",
event,
gdk_event_get_event_type(event),
gdk_event_get_device(event),
glibTypeNameFromInstance(gdk_event_get_device(event)),
gdk_event_get_display(event),
glibTypeNameFromInstance(gdk_event_get_display(event)),
gdk_event_get_surface(event),
glibTypeNameFromInstance(gdk_event_get_surface(event))
);
#elif GDK_MAJOR_VERSION == 3
const GdkEventAny* event = (const GdkEventAny*)arg;
fprintf(stderr,
"%p [GdkEvent type=%d window=%p [%s]] ",
event,
event->type,
event->window,
glibTypeNameFromInstance(event->window)
);
#else
#error Unsupported GDK version
#endif

isPrinted = 1;
}
Expand Down
Loading