< prev index next >

src/java.desktop/windows/classes/sun/java2d/d3d/D3DGraphicsDevice.java

Print this page




 251     protected void addFSWindowListener(Window w) {
 252         // if the window is not a toplevel (has an owner) we have to use the
 253         // real toplevel to enter the full-screen mode with (4933099).
 254         if (!(w instanceof Frame) && !(w instanceof Dialog) &&
 255             (realFSWindow = getToplevelOwner(w)) != null)
 256         {
 257             ownerOrigBounds = realFSWindow.getBounds();
 258             WWindowPeer fp = (WWindowPeer)realFSWindow.getPeer();
 259 
 260             ownerWasVisible = realFSWindow.isVisible();
 261             Rectangle r = w.getBounds();
 262             // we use operations on peer instead of component because calling
 263             // them on component will take the tree lock
 264             fp.reshape(r.x, r.y, r.width, r.height);
 265             fp.setVisible(true);
 266         } else {
 267             realFSWindow = w;
 268         }
 269 
 270         fsWindowWasAlwaysOnTop = realFSWindow.isAlwaysOnTop();
 271         ((WWindowPeer)realFSWindow.getPeer()).setAlwaysOnTop(true);
 272 
 273         fsWindowListener = new D3DFSWindowAdapter();
 274         realFSWindow.addWindowListener(fsWindowListener);
 275     }
 276 
 277     @Override
 278     @SuppressWarnings("deprecation")
 279     protected void removeFSWindowListener(Window w) {
 280         realFSWindow.removeWindowListener(fsWindowListener);
 281         fsWindowListener = null;
 282 
 283         /**
 284          * Bug 4933099: There is some funny-business to deal with when this
 285          * method is called with a Window instead of a Frame.  See 4836744
 286          * for more information on this.  One side-effect of our workaround
 287          * for the problem is that the owning Frame of a Window may end
 288          * up getting resized during the fullscreen process.  When we
 289          * return from fullscreen mode, we should resize the Frame to
 290          * its original size (just like the Window is being resized
 291          * to its original size in GraphicsDevice).




 251     protected void addFSWindowListener(Window w) {
 252         // if the window is not a toplevel (has an owner) we have to use the
 253         // real toplevel to enter the full-screen mode with (4933099).
 254         if (!(w instanceof Frame) && !(w instanceof Dialog) &&
 255             (realFSWindow = getToplevelOwner(w)) != null)
 256         {
 257             ownerOrigBounds = realFSWindow.getBounds();
 258             WWindowPeer fp = (WWindowPeer)realFSWindow.getPeer();
 259 
 260             ownerWasVisible = realFSWindow.isVisible();
 261             Rectangle r = w.getBounds();
 262             // we use operations on peer instead of component because calling
 263             // them on component will take the tree lock
 264             fp.reshape(r.x, r.y, r.width, r.height);
 265             fp.setVisible(true);
 266         } else {
 267             realFSWindow = w;
 268         }
 269 
 270         fsWindowWasAlwaysOnTop = realFSWindow.isAlwaysOnTop();
 271         //((WWindowPeer)realFSWindow.getPeer()).setAlwaysOnTop(true);
 272 
 273         fsWindowListener = new D3DFSWindowAdapter();
 274         realFSWindow.addWindowListener(fsWindowListener);
 275     }
 276 
 277     @Override
 278     @SuppressWarnings("deprecation")
 279     protected void removeFSWindowListener(Window w) {
 280         realFSWindow.removeWindowListener(fsWindowListener);
 281         fsWindowListener = null;
 282 
 283         /**
 284          * Bug 4933099: There is some funny-business to deal with when this
 285          * method is called with a Window instead of a Frame.  See 4836744
 286          * for more information on this.  One side-effect of our workaround
 287          * for the problem is that the owning Frame of a Window may end
 288          * up getting resized during the fullscreen process.  When we
 289          * return from fullscreen mode, we should resize the Frame to
 290          * its original size (just like the Window is being resized
 291          * to its original size in GraphicsDevice).


< prev index next >