Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frameless transparent window is maximizing/overflowing outside window limits #6248

Closed
Yonezpt opened this issue Oct 30, 2017 · 3 comments
Closed
Assignees

Comments

@Yonezpt
Copy link

Yonezpt commented Oct 30, 2017

NWJS Version : SDK 0.27.0-beta1 and SDK 0.26.2
Operating System : Win7 x64 and Win10 x64

Expected behavior

The top, right and bottom limits should be respected when maximizing the window

Actual behavior

The window content goes beyond the expected limits when maximized

How to reproduce

Sample app with window set to transparent frameless.

Using package.nw method, sample can be found below

package.json

{
    "author": "test",
    "description": "test",
    "main": "index.html",
    "name": "test",
    "version": "1.0.0",
    "window": {
        "frame": false,
        "transparent": true
    }
}

index.html

<!DOCTYPE html>
<html style="background:rgba(0,0,0,0.5);height:100%">
    <head>
    </head>
    <body>
        <div style="background:red;position:absolute;right:0;top:0;">TEXT</div>
        <button onclick="resize();return false;">Click to maximize/restore</button>
        <script>
                var is_maximized = false;
                var gui = require("nw.gui");
                var win = gui.Window.get();

                win.on("restore", () => is_maximized = false);
                win.on("maximize", () => is_maximized = true);

                function resize() {
                    if (is_maximized) {
                        win.restore();
                    } else {
                        win.maximize();
                    }
                }
        </script>
    </body>
</html>

Expected behavior:

Screenshot showing the expected behavior of the top right corner when the app is maximized

ss1

Current behavior:

Screenshot showing the problem at the same location

ss2

Screenshot showing the problem at the bottom right position when changing the TEXT style from top: 0 to bottom: 0

ss3

The entire top, right and bottom areas go beyond the expected limits.

This might be a consequence of the fix for #6221, #6219 or #6204

@Christywl
Copy link
Contributor

I can reproduce this issue on Windows with nwjs-sdk-v0.26.2 and v0.27.0-beta1.

@jtg-gg
Copy link
Member

jtg-gg commented Nov 1, 2017

@rogerwang I've made a pull request nwjs/chromium.src#99 for nw27
please also patch nw26

@rogerwang
Copy link
Member

This is fixed in git and will be available in the next nightly build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants