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

Maximizing an always on top transparent frameless window causes the bottom to overflow under the taskbar #6204

Closed
Yonezpt opened this issue Oct 13, 2017 · 9 comments
Assignees

Comments

@Yonezpt
Copy link

Yonezpt commented Oct 13, 2017

NWJS Version : SDK 26.0 beta 1
Operating System : Win7 x64

Expected behavior

The bottom of the window should not go under the taskbar when maximized.

Actual behavior

The bottom of the window goes under the taskbar when maximized.

How to reproduce

Basic app template with window frame set to false, transparent set to true and always_on_top set to true
Maximize app and check the bottom of the window under the windows taskbar

Resulting behavior illustrated:

ss

Expected behavior:

ss

@rogerwang
Copy link
Member

rogerwang commented Oct 13, 2017 via email

@Yonezpt Yonezpt changed the title Maximizing a transparent frameless window causes the bottom to overflow under the taskbar Maximizing an always on top transparent frameless window causes the bottom to overflow under the taskbar Oct 13, 2017
@Yonezpt
Copy link
Author

Yonezpt commented Oct 13, 2017

@rogerwang The problem is still there and I just noticed that I failed to include another detail so that this issue can be reproduced. I have updated the main issue with the missing detail. The window also needs to be set to always_on_top: true. Without that, the problem does not exist.

So to summarize: Frameless + transparent + always on top causes this issue, even with the latest RC1 you just shared. Removing either one of those three options makes the window behave correctly when maximized.

@jtg-gg
Copy link
Member

jtg-gg commented Oct 13, 2017

@Yonezpt can you sent us your sample app ?

@Yonezpt
Copy link
Author

Yonezpt commented Oct 13, 2017

@jtg-gg Certainly, sorry for the delay. This sample app makes use of the package.nw folder method. The contents of that folder are the two files below:

package.json

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

index.html

<!DOCTYPE html>
<html>
    <head>
    </head>
    <body style="background: #e2e2e2">
        <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>

@ubaidu15
Copy link

set frame to false and always on top to true, refresh it and compile again, or start with a new name of project and copy the code

@Yonezpt
Copy link
Author

Yonezpt commented Oct 15, 2017

@ubaidu15 that is not a solution and it is not something I didn't already know:

Removing either one of those three options makes the window behave correctly when maximized.

that's simply avoiding the problem which is not what I want, otherwise I would not have opened this issue at all if I didn't want a transparent frameless window with the option to stay always on top.

@jtg-gg jtg-gg self-assigned this Oct 16, 2017
@Christywl
Copy link
Contributor

I try the sample and can reproduce it on Windows 8.1 with nwjs-sdk-v0.25.4.
image

@jtg-gg
Copy link
Member

jtg-gg commented Oct 17, 2017

@Yonezpt I've made a fix, here nwjs/chromium.src#97
@rogerwang please accept my pull request for nw25, please also patch nw26

@rogerwang
Copy link
Member

@jtg-gg thanks. Merged into nw26 master patch. Not merged into nw25 because there is no 0.25 release any more -- 0.26.0 will be released before tomorrow.

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

5 participants