// the desktop properties dialog, for example), so
// we need to record it every time prior to
// entering the fullscreen mode.
defaultDisplayMode = null;
}
WWindowPeer peer = (WWindowPeer)old.getPeer();
if (peer != null) {
synchronized(peer) {
peer.destroyBuffers();
exitFullScreenExclusive(isDDEnabledOnDevice(),
screen, peer);
}
}
/**
* Bug 4933099: There is some funny-business to deal with when this
* method is called with a Window instead of a Frame. See 4836744
* for more information on this. One side-effect of our workaround
* for the problem is that the owning Frame of a Window may end
* up getting resized during the fullscreen process. When we
* return from fullscreen mode, we should resize the Frame to
* its original size (just like the Window is being resized
* to its original size in GraphicsDevice).
*/
if (!(old instanceof Frame)) {
Frame owner = getToplevelOwner(old);
if (owner != null && ownerWindowedModeBounds != null) {
owner.setBounds(ownerWindowedModeBounds);
}
ownerWindowedModeBounds = null;
}
}
super.setFullScreenWindow(w);
if (w != null) {
// always record the default display mode prior to going
// fullscreen
defaultDisplayMode = getDisplayMode();
// Bug 4933099
if (!(w instanceof Frame)) {
Frame owner = getToplevelOwner(w);
if (owner != null) {
ownerWindowedModeBounds = owner.getBounds();
// These will get set for the native window in
// any case. Set them here so that resetting them
// later actually does the right thing
owner.setBounds(w.getBounds());
}
}
// Enter full screen exclusive mode.
WWindowPeer peer = (WWindowPeer)w.getPeer();
synchronized(peer) {
enterFullScreenExclusive(isDDEnabledOnDevice(),
screen, peer);
// Note: removed replaceSurfaceData() call because
// changing the window size or making it visible
// will cause this anyway, and both of these events happen
// as part of switching into fullscreen mode.
}
// fix for 4868278
peer.updateGC();
peer.resetTargetGC();
}
}