diff options
author | Thomas Fitzsimmons <fitzsim@redhat.com> | 2003-10-09 00:26:29 +0000 |
---|---|---|
committer | Thomas Fitzsimmons <fitzsim@gcc.gnu.org> | 2003-10-09 00:26:29 +0000 |
commit | 23a555b077d77c46a1690eb90c029d40a33ea5c5 (patch) | |
tree | e8c4b26ac43e59bc2b91154944ca054acfa5b1ae /libjava/java | |
parent | ba401f2f1fe18f83efe35676cf1c530f195cbdeb (diff) | |
download | gcc-23a555b077d77c46a1690eb90c029d40a33ea5c5.zip gcc-23a555b077d77c46a1690eb90c029d40a33ea5c5.tar.gz gcc-23a555b077d77c46a1690eb90c029d40a33ea5c5.tar.bz2 |
GtkButtonPeer.java (handleEvent): Remove modality check.
2003-10-08 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/awt/peer/gtk/GtkButtonPeer.java (handleEvent): Remove
modality check.
* gnu/java/awt/peer/gtk/GtkDialogPeer.java (initializeInsets):
Initialize insets to use latest insets.
* gnu/java/awt/peer/gtk/GtkFramePeer.java: Likewise.
* gnu/java/awt/peer/gtk/GtkWindowPeer.java (latestInsets): New
field.
(postConfigureEvent): Update latestInsets field when insets
change. Remove call to setSize. Move validate call outside of
if blocks.
(setVisible): Call setBounds before showing window.
(nativeSetVisible): New native method.
* java/awt/Window.java (show): Show visible owned windows.
(hide): Hide visible owned windows.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
(awt_event_handler): Implement modality using GTK grabs.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
(global_gtk_window_group): New global variable.
(gtkInit): Initialize global_gtk_window_group.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (create):
Clamp width and height values to at least 1. Add this window to
the global GTK window group.
(setVisible): Rename to nativeSetVisible.
(setup_window): Remove function.
(setSize): Clamp width and height values to at least 1.
(nativeSetBounds): Likewise.
(gdk_window_get_root_geometry): Remove function.
* jni/gtk-peer/gtkpeer.h: Remove gdk_window_get_root_geometry
and setup_window declarations. Declare global_gtk_window_group.
From-SVN: r72252
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/awt/Window.java | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/libjava/java/awt/Window.java b/libjava/java/awt/Window.java index 3554bf5..ad4aec7 100644 --- a/libjava/java/awt/Window.java +++ b/libjava/java/awt/Window.java @@ -209,7 +209,8 @@ public class Window extends Container implements Accessible } /** - * Makes this window visible and brings it to the front. + * Shows on-screen this window and any of its owned windows for whom + * isVisible returns true. */ public void show() { @@ -218,6 +219,26 @@ public class Window extends Container implements Accessible if (peer == null) addNotify(); + // Show visible owned windows. + synchronized (ownedWindows) + { + Iterator e = ownedWindows.iterator(); + while(e.hasNext()) + { + Window w = (Window)(((Reference) e.next()).get()); + if (w != null) + { + if (w.isVisible()) + w.getPeer().setVisible(true); + } + else + // Remove null weak reference from ownedWindows. + // Unfortunately this can't be done in the Window's + // finalize method because there is no way to guarantee + // synchronous access to ownedWindows there. + e.remove(); + } + } validate(); super.show(); toFront(); @@ -225,6 +246,7 @@ public class Window extends Container implements Accessible public void hide() { + // Hide visible owned windows. synchronized (ownedWindows) { Iterator e = ownedWindows.iterator(); @@ -232,16 +254,14 @@ public class Window extends Container implements Accessible { Window w = (Window)(((Reference) e.next()).get()); if (w != null) - w.hide(); + { + if (w.isVisible() && w.getPeer() != null) + w.getPeer().setVisible(false); + } else - // Remove null weak reference from ownedWindows. - // Unfortunately this can't be done in the Window's - // finalize method because there is no way to guarantee - // synchronous access to ownedWindows there. e.remove(); } } - super.hide(); } |