classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Patch: FYI: Fix GtkWindowPeer inset calculations


From: Thomas Fitzsimmons
Subject: [cp-patches] Patch: FYI: Fix GtkWindowPeer inset calculations
Date: Fri, 22 Apr 2005 16:24:03 -0400

Hi,

This patch fixes GtkWindowPeer calculations on window managers that
properly support the _NET_FRAME_EXTENTS and _NET_REQUEST_FRAME_EXTENTS
window manager hints.  The window must be realized before
_NET_REQUEST_FRAME_EXTENTS is used to query the extents of the window.
This patch causes GtkWindowPeer to be realized just after the realize
handler is connected to the window widget's "realize" signal.  The
realize handler properly sets the GtkWindowPeer's insets.

Without this patch, Window.pack used wrong insets in its size
calculations if called before the Window was shown.  This caused Swing
windows to be laid out incorrectly.

Tom

2005-04-22  Thomas Fitzsimmons  <address@hidden>

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
        (connectSignals): Realize the window widget after connecting
        signals.

Index: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
===================================================================
RCS file: 
/cvs/gcc/gcc/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c,v
retrieving revision 1.33
diff -u -r1.33 gnu_java_awt_peer_gtk_GtkWindowPeer.c
--- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c  22 Feb 2005 06:13:03 
-0000      1.33
+++ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c  21 Apr 2005 22:22:02 
-0000
@@ -252,6 +252,13 @@
   g_signal_connect_after (G_OBJECT (ptr), "realize",
                           G_CALLBACK (connect_awt_hook_cb), *gref);
 
+
+  /* Realize the window here so that its frame extents are known now.
+     That way Window.pack can operate with the accurate insets
+     returned by the window manager rather than the default
+     estimates. */
+  gtk_widget_realize (GTK_WIDGET (ptr));
+
   gdk_threads_leave ();
 }
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]