This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gui][PATCH] only send configure events to visible top-levelwindows
- From: Thomas Fitzsimmons <fitzsim at redhat dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Wed, 26 May 2004 21:52:10 -0400
- Subject: [gui][PATCH] only send configure events to visible top-levelwindows
Hi,
I committed this patch to java-gui-branch. Without it, windows can be
shown at the wrong size. If an attempt is made to set the size of a GTK
window before it is made visible, the window will receive a configure
event containing the default size allocation decided by GTK (200x200).
In some cases, this invalid allocation was overriding the size set by
the program.
Tom
2004-05-26 Thomas Fitzsimmons <fitzsim@redhat.com>
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
(pre_event_handler): Only post configure events to visible
top-level windows.
Index: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
===================================================================
RCS file: /cvs/gcc/gcc/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c,v
retrieving revision 1.19.2.7
diff -u -r1.19.2.7 gnu_java_awt_peer_gtk_GtkEvents.c
--- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c 17 May 2004 19:49:03 -0000 1.19.2.7
+++ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c 27 May 2004 01:42:21 -0000
@@ -989,11 +989,9 @@
break;
case GDK_CONFIGURE:
{
- /* GtkWidget *widget;
-
- gdk_window_get_user_data (event->any.window, (void **) &widget); */
-
- if (widget && GTK_WIDGET_TOPLEVEL (widget))
+ /* Only send configure events to visible top-level windows. */
+ if (widget && GTK_WIDGET_TOPLEVEL (widget)
+ && GTK_WIDGET_VISIBLE (widget))
{
/* Configure events are not posted to the AWT event
queue, and as such, the gdk/gtk peer functions will