Hello list,

With the help of Thomas Fitzsimmons I prepared the attached patch that
fixes the drawing in embedded windows. With gcjwebplugin I saw a shifted
droplet when visiting http://www.classpath.org/. The attached patch
fixes this.

Ok to commit?


Cheers,
Michael


2006-02-15  Michael Koch  <[EMAIL PROTECTED]>

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c
        (Java_gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer_create):
        Make sure the embedded window gets no decorations.
        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
        (window_get_frame_extents): Return early of the window has no
        decorations.
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c
===================================================================
RCS file: 
/sources/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c,v
retrieving revision 1.7
diff -u -r1.7 gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c   11 Jul 
2005 23:27:43 -0000      1.7
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c   14 Feb 
2006 22:03:42 -0000
@@ -1,6 +1,6 @@
 /* gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c -- Native
    implementation of GtkEmbeddedWindowPeer
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -53,6 +53,8 @@
 
   window = gtk_plug_new ((GdkNativeWindow) socket_id);
 
+  gtk_window_set_decorated (window, FALSE);
+
   fixed = gtk_fixed_new ();
   gtk_container_add (GTK_CONTAINER (window), fixed);
 
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
===================================================================
RCS file: 
/sources/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c,v
retrieving revision 1.62
diff -u -r1.62 gnu_java_awt_peer_gtk_GtkWindowPeer.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c   15 Nov 2005 
22:50:53 -0000      1.62
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c   14 Feb 2006 
22:03:42 -0000
@@ -1,5 +1,6 @@
 /* gtkwindowpeer.c -- Native implementation of GtkWindowPeer
-   Copyright (C) 1998, 1999, 2002, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2002, 2004, 2005, 2006
+   Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -1437,21 +1438,21 @@
 
   /* Guess frame extents in case _NET_FRAME_EXTENTS is not
      supported. */
-  if (gtk_window_get_decorated (GTK_WINDOW (window)))
-    {
-      *top = 23;
-      *left = 6;
-      *bottom = 6;
-      *right = 6;
-    }
-  else
+  if (!gtk_window_get_decorated (GTK_WINDOW (window)))
     {
       *top = 0;
       *left = 0;
       *bottom = 0;
       *right = 0;
+
+      return;
     }
 
+  *top = 23;
+  *left = 6;
+  *bottom = 6;
+  *right = 6;
+
   /* Request that the window manager set window's
      _NET_FRAME_EXTENTS property. */
   request_frame_extents (window);

Reply via email to