diff options
author | Roman Kennke <roman@kennke.org> | 2006-10-18 22:09:15 +0000 |
---|---|---|
committer | Roman Kennke <roman@kennke.org> | 2006-10-18 22:09:15 +0000 |
commit | 3fb3b2dca64325b1e95376b22ee8b16dfdfafa6d (patch) | |
tree | 7f7959c0a20ae250b9a1ad8c8bfa4e3c897d5bee /java | |
parent | ed77968e223e822b5375f3e866abf2b998149faa (diff) | |
download | classpath-3fb3b2dca64325b1e95376b22ee8b16dfdfafa6d.tar.gz |
2006-10-18 Roman Kennke <kennke@aicas.com>
PR 27091
* gnu/java/awt/peer/gtk/GtkFramePeer.java
(maximize): New native method.
(unmaximize): New native method.
(iconify): New native method.
(deiconify): New native method.
(getState): Implemented.
(setState): Implemented.
* gnu/java/awt/peer/gtk/GtkWindowPeer.java
(oldState): Rename to windowState and made protected, so that
the FramePeer can access it.
(postWindowEvent): Handle state change events more gently and
correctly.
* java/awt/Frame.java
(getState): Fetch state from getExtendedState().
(setExtendedState): Update the peer. Check if the state change
is actually supported.
(getExtendedState): Update the state from the peer.
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
(maximize): New method.
(unmaximize): New method.
(iconify): New method.
(deiconify): New method.
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
(AWT_FRAME_NORMAL): New macro.
(AWT_FRAME_ICONIFIED): New macro.
(AWT_FRAME_MAXIMIZED_BOTH): New macro.
(window_window_state_cb): Rewritten to handle window state changes
more gently (mostly on the java side of the world).
* include/gnu_java_awt_peer_gtk_GtkFramePeer.h: Regenerated.
Diffstat (limited to 'java')
-rw-r--r-- | java/awt/Frame.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/java/awt/Frame.java b/java/awt/Frame.java index e0c0d1ff3..d45be1ca5 100644 --- a/java/awt/Frame.java +++ b/java/awt/Frame.java @@ -536,8 +536,7 @@ public class Frame extends Window implements MenuContainer public int getState() { - // FIXME: State might have changed in the peer... Must check. - return (state & ICONIFIED) != 0 ? ICONIFIED : NORMAL; + return (getExtendedState() & ICONIFIED) != 0 ? ICONIFIED : NORMAL; } /** @@ -545,7 +544,13 @@ public class Frame extends Window implements MenuContainer */ public void setExtendedState(int state) { - this.state = state; + if (getToolkit().isFrameStateSupported(state)) + { + this.state = state; + FramePeer p = (FramePeer) peer; + if (p != null) + p.setState(state); + } } /** @@ -553,6 +558,9 @@ public class Frame extends Window implements MenuContainer */ public int getExtendedState() { + FramePeer p = (FramePeer) peer; + if (p != null) + state = p.getState(); return state; } |