827 |
static guint button_number = -1; |
static guint button_number = -1; |
828 |
static jint click_count = 1; |
static jint click_count = 1; |
829 |
static int hasBeenDragged; |
static int hasBeenDragged; |
830 |
|
union widget_union w; |
831 |
|
|
832 |
/* If it is not a focus change event, the widget must be realized already. |
/* If it is not a focus change event, the widget must be realized already. |
833 |
If not, ignore the event (Gtk+ will do the same). */ |
If not, ignore the event (Gtk+ will do the same). */ |
834 |
if (!(event->type == GDK_FOCUS_CHANGE || GTK_WIDGET_REALIZED(widget))) |
if (!(event->type == GDK_FOCUS_CHANGE || GTK_WIDGET_REALIZED(widget))) |
835 |
return FALSE; |
return FALSE; |
836 |
|
|
837 |
/* Do not handle propagated events. AWT has its own propagation rules */ |
/* Do not handle propagated events. AWT has its own propagation rules */ |
838 |
gdk_window_get_user_data (event->any.window, (void **) &event_widget); |
w.widget = &event_widget; |
839 |
|
gdk_window_get_user_data (event->any.window, w.void_widget); |
840 |
if (event_widget != widget) |
if (event_widget != widget) |
841 |
return FALSE; |
return FALSE; |
842 |
|
|
1124 |
va_end (ap); |
va_end (ap); |
1125 |
} |
} |
1126 |
|
|
1127 |
|
/* |
1128 |
|
* Attach a Java object that is backed by widget. This callback is |
1129 |
|
* called after the widget's window has been realized. That way, we |
1130 |
|
* can be sure that widget->window is non-NULL, and so can have data |
1131 |
|
* connected to it. |
1132 |
|
*/ |
1133 |
|
void connect_awt_hook_cb (GtkWidget *widget __attribute__((unused)), |
1134 |
|
jobject peer) |
1135 |
|
{ |
1136 |
|
void *ptr; |
1137 |
|
|
1138 |
|
ptr = NSA_GET_PTR (gdk_env, peer); |
1139 |
|
|
1140 |
|
connect_awt_hook (gdk_env, peer, 1, GTK_WIDGET (ptr)->window); |
1141 |
|
|
1142 |
|
gdk_threads_leave (); |
1143 |
|
|
1144 |
|
(*gdk_env)->CallVoidMethod (gdk_env, peer, setCursorID); |
1145 |
|
|
1146 |
|
gdk_threads_enter (); |
1147 |
|
} |