981 |
if (widget && GTK_WIDGET_TOPLEVEL (widget)) |
if (widget && GTK_WIDGET_TOPLEVEL (widget)) |
982 |
{ |
{ |
983 |
gint top, left, right, bottom; |
gint top, left, right, bottom; |
984 |
gint x, y, w, h, wb, d; |
gint x, y, w, h, d; |
985 |
|
GdkRectangle r; |
986 |
|
|
987 |
/* calculate our insets */ |
/* Configure events are not posted to the AWT event |
988 |
gdk_window_get_root_geometry (event->any.window, |
queue, and as such, the gdk/gtk peer functions will |
989 |
&x, &y, &w, &h, &wb, &d); |
be called back before postConfigureEvent |
990 |
|
returns. */ |
991 |
|
gdk_threads_leave (); |
992 |
|
|
993 |
/* We used to compute these based on the configure |
/* Calculate our insets. */ |
|
event's fields. However, that gives strange and |
|
|
apparently incorrect results. */ |
|
|
top = left = bottom = right = 0; |
|
994 |
|
|
995 |
/* configure events are not posted to the AWT event queue, |
/* When called from within the gdk_threads critical |
996 |
and as such, gdk/gtk will be called back before |
section these functions seem to return strange |
997 |
postConfigureEvent returns */ |
results, so we call them after |
998 |
gdk_threads_leave (); |
gdk_threads_leave. */ |
999 |
(*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr, |
gdk_window_get_geometry (event->any.window, |
1000 |
|
&x, &y, &w, &h, &d); |
1001 |
|
gdk_window_get_frame_extents (event->any.window, &r); |
1002 |
|
|
1003 |
|
top = y; |
1004 |
|
left = x; |
1005 |
|
bottom = r.height - h - y; |
1006 |
|
right = r.width - w - x; |
1007 |
|
|
1008 |
|
(*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr, |
1009 |
postConfigureEventID, |
postConfigureEventID, |
1010 |
(jint)event->configure.x, |
(jint) event->configure.x, |
1011 |
(jint)event->configure.y, |
(jint) event->configure.y, |
1012 |
(jint)event->configure.width, |
(jint) event->configure.width, |
1013 |
(jint)event->configure.height, |
(jint) event->configure.height, |
1014 |
(jint)top, |
(jint) top, |
1015 |
(jint)left, |
(jint) left, |
1016 |
(jint)bottom, |
(jint) bottom, |
1017 |
(jint)right); |
(jint) right); |
1018 |
gdk_threads_enter (); |
gdk_threads_enter (); |
1019 |
} |
} |
1020 |
} |
} |