Java Code Examples for sun.awt.windows.WWindowPeer#reshape()

The following examples show how to use sun.awt.windows.WWindowPeer#reshape() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: D3DGraphicsDevice.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void addFSWindowListener(Window w) {
    // if the window is not a toplevel (has an owner) we have to use the
    // real toplevel to enter the full-screen mode with (4933099).
    if (!(w instanceof Frame) && !(w instanceof Dialog) &&
        (realFSWindow = getToplevelOwner(w)) != null)
    {
        ownerOrigBounds = realFSWindow.getBounds();
        WWindowPeer fp = (WWindowPeer)realFSWindow.getPeer();

        ownerWasVisible = realFSWindow.isVisible();
        Rectangle r = w.getBounds();
        // we use operations on peer instead of component because calling
        // them on component will take the tree lock
        fp.reshape(r.x, r.y, r.width, r.height);
        fp.setVisible(true);
    } else {
        realFSWindow = w;
    }

    fsWindowWasAlwaysOnTop = realFSWindow.isAlwaysOnTop();
    ((WWindowPeer)realFSWindow.getPeer()).setAlwaysOnTop(true);

    fsWindowListener = new D3DFSWindowAdapter();
    realFSWindow.addWindowListener(fsWindowListener);
}
 
Example 2
Source File: D3DGraphicsDevice.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void addFSWindowListener(Window w) {
    // if the window is not a toplevel (has an owner) we have to use the
    // real toplevel to enter the full-screen mode with (4933099).
    if (!(w instanceof Frame) && !(w instanceof Dialog) &&
        (realFSWindow = getToplevelOwner(w)) != null)
    {
        ownerOrigBounds = realFSWindow.getBounds();
        WWindowPeer fp = (WWindowPeer)realFSWindow.getPeer();

        ownerWasVisible = realFSWindow.isVisible();
        Rectangle r = w.getBounds();
        // we use operations on peer instead of component because calling
        // them on component will take the tree lock
        fp.reshape(r.x, r.y, r.width, r.height);
        fp.setVisible(true);
    } else {
        realFSWindow = w;
    }

    fsWindowWasAlwaysOnTop = realFSWindow.isAlwaysOnTop();
    ((WWindowPeer)realFSWindow.getPeer()).setAlwaysOnTop(true);

    fsWindowListener = new D3DFSWindowAdapter();
    realFSWindow.addWindowListener(fsWindowListener);
}
 
Example 3
Source File: D3DGraphicsDevice.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void addFSWindowListener(Window w) {
    // if the window is not a toplevel (has an owner) we have to use the
    // real toplevel to enter the full-screen mode with (4933099).
    if (!(w instanceof Frame) && !(w instanceof Dialog) &&
        (realFSWindow = getToplevelOwner(w)) != null)
    {
        ownerOrigBounds = realFSWindow.getBounds();
        WWindowPeer fp = (WWindowPeer)realFSWindow.getPeer();

        ownerWasVisible = realFSWindow.isVisible();
        Rectangle r = w.getBounds();
        // we use operations on peer instead of component because calling
        // them on component will take the tree lock
        fp.reshape(r.x, r.y, r.width, r.height);
        fp.setVisible(true);
    } else {
        realFSWindow = w;
    }

    fsWindowWasAlwaysOnTop = realFSWindow.isAlwaysOnTop();
    ((WWindowPeer)realFSWindow.getPeer()).setAlwaysOnTop(true);

    fsWindowListener = new D3DFSWindowAdapter();
    realFSWindow.addWindowListener(fsWindowListener);
}
 
Example 4
Source File: D3DGraphicsDevice.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void addFSWindowListener(Window w) {
    // if the window is not a toplevel (has an owner) we have to use the
    // real toplevel to enter the full-screen mode with (4933099).
    if (!(w instanceof Frame) && !(w instanceof Dialog) &&
        (realFSWindow = getToplevelOwner(w)) != null)
    {
        ownerOrigBounds = realFSWindow.getBounds();
        WWindowPeer fp = (WWindowPeer)realFSWindow.getPeer();

        ownerWasVisible = realFSWindow.isVisible();
        Rectangle r = w.getBounds();
        // we use operations on peer instead of component because calling
        // them on component will take the tree lock
        fp.reshape(r.x, r.y, r.width, r.height);
        fp.setVisible(true);
    } else {
        realFSWindow = w;
    }

    fsWindowWasAlwaysOnTop = realFSWindow.isAlwaysOnTop();
    ((WWindowPeer)realFSWindow.getPeer()).setAlwaysOnTop(true);

    fsWindowListener = new D3DFSWindowAdapter();
    realFSWindow.addWindowListener(fsWindowListener);
}
 
Example 5
Source File: D3DGraphicsDevice.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void addFSWindowListener(Window w) {
    // if the window is not a toplevel (has an owner) we have to use the
    // real toplevel to enter the full-screen mode with (4933099).
    if (!(w instanceof Frame) && !(w instanceof Dialog) &&
        (realFSWindow = getToplevelOwner(w)) != null)
    {
        ownerOrigBounds = realFSWindow.getBounds();
        WWindowPeer fp = (WWindowPeer)realFSWindow.getPeer();

        ownerWasVisible = realFSWindow.isVisible();
        Rectangle r = w.getBounds();
        // we use operations on peer instead of component because calling
        // them on component will take the tree lock
        fp.reshape(r.x, r.y, r.width, r.height);
        fp.setVisible(true);
    } else {
        realFSWindow = w;
    }

    fsWindowWasAlwaysOnTop = realFSWindow.isAlwaysOnTop();
    ((WWindowPeer)realFSWindow.getPeer()).setAlwaysOnTop(true);

    fsWindowListener = new D3DFSWindowAdapter();
    realFSWindow.addWindowListener(fsWindowListener);
}
 
Example 6
Source File: D3DGraphicsDevice.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void addFSWindowListener(Window w) {
    // if the window is not a toplevel (has an owner) we have to use the
    // real toplevel to enter the full-screen mode with (4933099).
    if (!(w instanceof Frame) && !(w instanceof Dialog) &&
        (realFSWindow = getToplevelOwner(w)) != null)
    {
        ownerOrigBounds = realFSWindow.getBounds();
        WWindowPeer fp = (WWindowPeer)realFSWindow.getPeer();

        ownerWasVisible = realFSWindow.isVisible();
        Rectangle r = w.getBounds();
        // we use operations on peer instead of component because calling
        // them on component will take the tree lock
        fp.reshape(r.x, r.y, r.width, r.height);
        fp.setVisible(true);
    } else {
        realFSWindow = w;
    }

    fsWindowWasAlwaysOnTop = realFSWindow.isAlwaysOnTop();
    ((WWindowPeer)realFSWindow.getPeer()).setAlwaysOnTop(true);

    fsWindowListener = new D3DFSWindowAdapter();
    realFSWindow.addWindowListener(fsWindowListener);
}
 
Example 7
Source File: D3DGraphicsDevice.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void removeFSWindowListener(Window w) {
    realFSWindow.removeWindowListener(fsWindowListener);
    fsWindowListener = null;

    /**
     * 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).
     */
    WWindowPeer wpeer = (WWindowPeer)realFSWindow.getPeer();
    if (wpeer != null) {
        if (ownerOrigBounds != null) {
            // if the window went into fs mode before it was realized it
            // could have (0,0) dimensions
            if (ownerOrigBounds.width  == 0) ownerOrigBounds.width  = 1;
            if (ownerOrigBounds.height == 0) ownerOrigBounds.height = 1;
            wpeer.reshape(ownerOrigBounds.x,     ownerOrigBounds.y,
                          ownerOrigBounds.width, ownerOrigBounds.height);
            if (!ownerWasVisible) {
                wpeer.setVisible(false);
            }
            ownerOrigBounds = null;
        }
        if (!fsWindowWasAlwaysOnTop) {
            wpeer.setAlwaysOnTop(false);
        }
    }

    realFSWindow = null;
}
 
Example 8
Source File: D3DGraphicsDevice.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void removeFSWindowListener(Window w) {
    realFSWindow.removeWindowListener(fsWindowListener);
    fsWindowListener = null;

    /**
     * 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).
     */
    WWindowPeer wpeer = (WWindowPeer)realFSWindow.getPeer();
    if (wpeer != null) {
        if (ownerOrigBounds != null) {
            // if the window went into fs mode before it was realized it
            // could have (0,0) dimensions
            if (ownerOrigBounds.width  == 0) ownerOrigBounds.width  = 1;
            if (ownerOrigBounds.height == 0) ownerOrigBounds.height = 1;
            wpeer.reshape(ownerOrigBounds.x,     ownerOrigBounds.y,
                          ownerOrigBounds.width, ownerOrigBounds.height);
            if (!ownerWasVisible) {
                wpeer.setVisible(false);
            }
            ownerOrigBounds = null;
        }
        if (!fsWindowWasAlwaysOnTop) {
            wpeer.setAlwaysOnTop(false);
        }
    }

    realFSWindow = null;
}
 
Example 9
Source File: D3DGraphicsDevice.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void removeFSWindowListener(Window w) {
    realFSWindow.removeWindowListener(fsWindowListener);
    fsWindowListener = null;

    /**
     * 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).
     */
    WWindowPeer wpeer = (WWindowPeer)realFSWindow.getPeer();
    if (wpeer != null) {
        if (ownerOrigBounds != null) {
            // if the window went into fs mode before it was realized it
            // could have (0,0) dimensions
            if (ownerOrigBounds.width  == 0) ownerOrigBounds.width  = 1;
            if (ownerOrigBounds.height == 0) ownerOrigBounds.height = 1;
            wpeer.reshape(ownerOrigBounds.x,     ownerOrigBounds.y,
                          ownerOrigBounds.width, ownerOrigBounds.height);
            if (!ownerWasVisible) {
                wpeer.setVisible(false);
            }
            ownerOrigBounds = null;
        }
        if (!fsWindowWasAlwaysOnTop) {
            wpeer.setAlwaysOnTop(false);
        }
    }

    realFSWindow = null;
}
 
Example 10
Source File: D3DGraphicsDevice.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void removeFSWindowListener(Window w) {
    realFSWindow.removeWindowListener(fsWindowListener);
    fsWindowListener = null;

    /**
     * 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).
     */
    WWindowPeer wpeer = (WWindowPeer)realFSWindow.getPeer();
    if (wpeer != null) {
        if (ownerOrigBounds != null) {
            // if the window went into fs mode before it was realized it
            // could have (0,0) dimensions
            if (ownerOrigBounds.width  == 0) ownerOrigBounds.width  = 1;
            if (ownerOrigBounds.height == 0) ownerOrigBounds.height = 1;
            wpeer.reshape(ownerOrigBounds.x,     ownerOrigBounds.y,
                          ownerOrigBounds.width, ownerOrigBounds.height);
            if (!ownerWasVisible) {
                wpeer.setVisible(false);
            }
            ownerOrigBounds = null;
        }
        if (!fsWindowWasAlwaysOnTop) {
            wpeer.setAlwaysOnTop(false);
        }
    }

    realFSWindow = null;
}
 
Example 11
Source File: D3DGraphicsDevice.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void removeFSWindowListener(Window w) {
    realFSWindow.removeWindowListener(fsWindowListener);
    fsWindowListener = null;

    /**
     * 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).
     */
    WWindowPeer wpeer = (WWindowPeer)realFSWindow.getPeer();
    if (wpeer != null) {
        if (ownerOrigBounds != null) {
            // if the window went into fs mode before it was realized it
            // could have (0,0) dimensions
            if (ownerOrigBounds.width  == 0) ownerOrigBounds.width  = 1;
            if (ownerOrigBounds.height == 0) ownerOrigBounds.height = 1;
            wpeer.reshape(ownerOrigBounds.x,     ownerOrigBounds.y,
                          ownerOrigBounds.width, ownerOrigBounds.height);
            if (!ownerWasVisible) {
                wpeer.setVisible(false);
            }
            ownerOrigBounds = null;
        }
        if (!fsWindowWasAlwaysOnTop) {
            wpeer.setAlwaysOnTop(false);
        }
    }

    realFSWindow = null;
}
 
Example 12
Source File: D3DGraphicsDevice.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void removeFSWindowListener(Window w) {
    realFSWindow.removeWindowListener(fsWindowListener);
    fsWindowListener = null;

    /**
     * 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).
     */
    WWindowPeer wpeer = (WWindowPeer)realFSWindow.getPeer();
    if (wpeer != null) {
        if (ownerOrigBounds != null) {
            // if the window went into fs mode before it was realized it
            // could have (0,0) dimensions
            if (ownerOrigBounds.width  == 0) ownerOrigBounds.width  = 1;
            if (ownerOrigBounds.height == 0) ownerOrigBounds.height = 1;
            wpeer.reshape(ownerOrigBounds.x,     ownerOrigBounds.y,
                          ownerOrigBounds.width, ownerOrigBounds.height);
            if (!ownerWasVisible) {
                wpeer.setVisible(false);
            }
            ownerOrigBounds = null;
        }
        if (!fsWindowWasAlwaysOnTop) {
            wpeer.setAlwaysOnTop(false);
        }
    }

    realFSWindow = null;
}
 
Example 13
Source File: D3DGraphicsDevice.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void configDisplayMode(final int screen, final WindowPeer w,
                                 final int width, final int height,
                                 final int bitDepth, final int refreshRate)
{
    // we entered fs mode via gdi
    if (!fsStatus) {
        super.configDisplayMode(screen, w, width, height, bitDepth,
                                refreshRate);
        return;
    }

    final WWindowPeer wpeer = (WWindowPeer)realFSWindow.getPeer();

    // REMIND: we do this before we switch the display mode, so
    // the dimensions may be exceeding the dimensions of the screen,
    // is this a problem?

    // update the bounds of the owner frame
    if (getFullScreenWindow() != realFSWindow) {
        Rectangle screenBounds = getDefaultConfiguration().getBounds();
        wpeer.reshape(screenBounds.x, screenBounds.y, width, height);
    }

    D3DRenderQueue rq = D3DRenderQueue.getInstance();
    rq.lock();
    try {
        rq.flushAndInvokeNow(new Runnable() {
            public void run() {
                long hwnd = wpeer.getHWnd();
                if (hwnd == 0l) {
                    // window is disposed
                    return;
                }
                // REMIND: do we really need a window here?
                // we should probably just use the current one
                configDisplayModeNative(screen, hwnd, width, height,
                                        bitDepth, refreshRate);
            }
        });
    } finally {
        rq.unlock();
    }
}
 
Example 14
Source File: D3DGraphicsDevice.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void configDisplayMode(final int screen, final WindowPeer w,
                                 final int width, final int height,
                                 final int bitDepth, final int refreshRate)
{
    // we entered fs mode via gdi
    if (!fsStatus) {
        super.configDisplayMode(screen, w, width, height, bitDepth,
                                refreshRate);
        return;
    }

    final WWindowPeer wpeer = (WWindowPeer)realFSWindow.getPeer();

    // REMIND: we do this before we switch the display mode, so
    // the dimensions may be exceeding the dimensions of the screen,
    // is this a problem?

    // update the bounds of the owner frame
    if (getFullScreenWindow() != realFSWindow) {
        Rectangle screenBounds = getDefaultConfiguration().getBounds();
        wpeer.reshape(screenBounds.x, screenBounds.y, width, height);
    }

    D3DRenderQueue rq = D3DRenderQueue.getInstance();
    rq.lock();
    try {
        rq.flushAndInvokeNow(new Runnable() {
            public void run() {
                long hwnd = wpeer.getHWnd();
                if (hwnd == 0l) {
                    // window is disposed
                    return;
                }
                // REMIND: do we really need a window here?
                // we should probably just use the current one
                configDisplayModeNative(screen, hwnd, width, height,
                                        bitDepth, refreshRate);
            }
        });
    } finally {
        rq.unlock();
    }
}
 
Example 15
Source File: D3DGraphicsDevice.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void configDisplayMode(final int screen, final WindowPeer w,
                                 final int width, final int height,
                                 final int bitDepth, final int refreshRate)
{
    // we entered fs mode via gdi
    if (!fsStatus) {
        super.configDisplayMode(screen, w, width, height, bitDepth,
                                refreshRate);
        return;
    }
    final WWindowPeer wpeer = AWTAccessor.getComponentAccessor()
                                         .getPeer(realFSWindow);

    // REMIND: we do this before we switch the display mode, so
    // the dimensions may be exceeding the dimensions of the screen,
    // is this a problem?

    // update the bounds of the owner frame
    if (getFullScreenWindow() != realFSWindow) {
        Rectangle screenBounds = getDefaultConfiguration().getBounds();
        wpeer.reshape(screenBounds.x, screenBounds.y, width, height);
    }

    D3DRenderQueue rq = D3DRenderQueue.getInstance();
    rq.lock();
    try {
        rq.flushAndInvokeNow(new Runnable() {
            public void run() {
                long hwnd = wpeer.getHWnd();
                if (hwnd == 0l) {
                    // window is disposed
                    return;
                }
                // REMIND: do we really need a window here?
                // we should probably just use the current one
                configDisplayModeNative(screen, hwnd, width, height,
                                        bitDepth, refreshRate);
            }
        });
    } finally {
        rq.unlock();
    }
}
 
Example 16
Source File: D3DGraphicsDevice.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void configDisplayMode(final int screen, final WindowPeer w,
                                 final int width, final int height,
                                 final int bitDepth, final int refreshRate)
{
    // we entered fs mode via gdi
    if (!fsStatus) {
        super.configDisplayMode(screen, w, width, height, bitDepth,
                                refreshRate);
        return;
    }

    final WWindowPeer wpeer = (WWindowPeer)realFSWindow.getPeer();

    // REMIND: we do this before we switch the display mode, so
    // the dimensions may be exceeding the dimensions of the screen,
    // is this a problem?

    // update the bounds of the owner frame
    if (getFullScreenWindow() != realFSWindow) {
        Rectangle screenBounds = getDefaultConfiguration().getBounds();
        wpeer.reshape(screenBounds.x, screenBounds.y, width, height);
    }

    D3DRenderQueue rq = D3DRenderQueue.getInstance();
    rq.lock();
    try {
        rq.flushAndInvokeNow(new Runnable() {
            public void run() {
                long hwnd = wpeer.getHWnd();
                if (hwnd == 0l) {
                    // window is disposed
                    return;
                }
                // REMIND: do we really need a window here?
                // we should probably just use the current one
                configDisplayModeNative(screen, hwnd, width, height,
                                        bitDepth, refreshRate);
            }
        });
    } finally {
        rq.unlock();
    }
}
 
Example 17
Source File: D3DGraphicsDevice.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void configDisplayMode(final int screen, final WindowPeer w,
                                 final int width, final int height,
                                 final int bitDepth, final int refreshRate)
{
    // we entered fs mode via gdi
    if (!fsStatus) {
        super.configDisplayMode(screen, w, width, height, bitDepth,
                                refreshRate);
        return;
    }

    final WWindowPeer wpeer = (WWindowPeer)realFSWindow.getPeer();

    // REMIND: we do this before we switch the display mode, so
    // the dimensions may be exceeding the dimensions of the screen,
    // is this a problem?

    // update the bounds of the owner frame
    if (getFullScreenWindow() != realFSWindow) {
        Rectangle screenBounds = getDefaultConfiguration().getBounds();
        wpeer.reshape(screenBounds.x, screenBounds.y, width, height);
    }

    D3DRenderQueue rq = D3DRenderQueue.getInstance();
    rq.lock();
    try {
        rq.flushAndInvokeNow(new Runnable() {
            public void run() {
                long hwnd = wpeer.getHWnd();
                if (hwnd == 0l) {
                    // window is disposed
                    return;
                }
                // REMIND: do we really need a window here?
                // we should probably just use the current one
                configDisplayModeNative(screen, hwnd, width, height,
                                        bitDepth, refreshRate);
            }
        });
    } finally {
        rq.unlock();
    }
}
 
Example 18
Source File: D3DGraphicsDevice.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void configDisplayMode(final int screen, final WindowPeer w,
                                 final int width, final int height,
                                 final int bitDepth, final int refreshRate)
{
    // we entered fs mode via gdi
    if (!fsStatus) {
        super.configDisplayMode(screen, w, width, height, bitDepth,
                                refreshRate);
        return;
    }

    final WWindowPeer wpeer = (WWindowPeer)realFSWindow.getPeer();

    // REMIND: we do this before we switch the display mode, so
    // the dimensions may be exceeding the dimensions of the screen,
    // is this a problem?

    // update the bounds of the owner frame
    if (getFullScreenWindow() != realFSWindow) {
        Rectangle screenBounds = getDefaultConfiguration().getBounds();
        wpeer.reshape(screenBounds.x, screenBounds.y, width, height);
    }

    D3DRenderQueue rq = D3DRenderQueue.getInstance();
    rq.lock();
    try {
        rq.flushAndInvokeNow(new Runnable() {
            public void run() {
                long hwnd = wpeer.getHWnd();
                if (hwnd == 0l) {
                    // window is disposed
                    return;
                }
                // REMIND: do we really need a window here?
                // we should probably just use the current one
                configDisplayModeNative(screen, hwnd, width, height,
                                        bitDepth, refreshRate);
            }
        });
    } finally {
        rq.unlock();
    }
}
 
Example 19
Source File: D3DGraphicsDevice.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void configDisplayMode(final int screen, final WindowPeer w,
                                 final int width, final int height,
                                 final int bitDepth, final int refreshRate)
{
    // we entered fs mode via gdi
    if (!fsStatus) {
        super.configDisplayMode(screen, w, width, height, bitDepth,
                                refreshRate);
        return;
    }

    final WWindowPeer wpeer = (WWindowPeer)realFSWindow.getPeer();

    // REMIND: we do this before we switch the display mode, so
    // the dimensions may be exceeding the dimensions of the screen,
    // is this a problem?

    // update the bounds of the owner frame
    if (getFullScreenWindow() != realFSWindow) {
        Rectangle screenBounds = getDefaultConfiguration().getBounds();
        wpeer.reshape(screenBounds.x, screenBounds.y, width, height);
    }

    D3DRenderQueue rq = D3DRenderQueue.getInstance();
    rq.lock();
    try {
        rq.flushAndInvokeNow(new Runnable() {
            public void run() {
                long hwnd = wpeer.getHWnd();
                if (hwnd == 0l) {
                    // window is disposed
                    return;
                }
                // REMIND: do we really need a window here?
                // we should probably just use the current one
                configDisplayModeNative(screen, hwnd, width, height,
                                        bitDepth, refreshRate);
            }
        });
    } finally {
        rq.unlock();
    }
}
 
Example 20
Source File: D3DGraphicsDevice.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void configDisplayMode(final int screen, final WindowPeer w,
                                 final int width, final int height,
                                 final int bitDepth, final int refreshRate)
{
    // we entered fs mode via gdi
    if (!fsStatus) {
        super.configDisplayMode(screen, w, width, height, bitDepth,
                                refreshRate);
        return;
    }

    final WWindowPeer wpeer = (WWindowPeer)realFSWindow.getPeer();

    // REMIND: we do this before we switch the display mode, so
    // the dimensions may be exceeding the dimensions of the screen,
    // is this a problem?

    // update the bounds of the owner frame
    if (getFullScreenWindow() != realFSWindow) {
        Rectangle screenBounds = getDefaultConfiguration().getBounds();
        wpeer.reshape(screenBounds.x, screenBounds.y, width, height);
    }

    D3DRenderQueue rq = D3DRenderQueue.getInstance();
    rq.lock();
    try {
        rq.flushAndInvokeNow(new Runnable() {
            public void run() {
                long hwnd = wpeer.getHWnd();
                if (hwnd == 0l) {
                    // window is disposed
                    return;
                }
                // REMIND: do we really need a window here?
                // we should probably just use the current one
                configDisplayModeNative(screen, hwnd, width, height,
                                        bitDepth, refreshRate);
            }
        });
    } finally {
        rq.unlock();
    }
}