nwjs / nw.js

Call all Node.js modules directly from DOM/WebWorker and enable a new way of writing applications with all Web technologies.
https://nwjs.io
MIT License
40.35k stars 3.88k forks source link

Frameless window isn't maximized after minimizing and restoring it #6486

Open denneboomyo opened 6 years ago

denneboomyo commented 6 years ago

NWJS Version : 0.28.3 Operating System : Win10 v1709

Expected behavior

The frameless window remains maximized after minimizing and restoring it.

Actual behavior

After minimizing and restoring the frameless window, the window has blank space on the right side, a black border and a close button.

How to reproduce

package.json

{
    "name": "ResizeTest",
    "main": "index.html",
    "window": {
        "frame": false
    }
}

index.html

<html>
   <head></head>
   <body style="background-color: #181818;" onload="init();">
      <button onclick="nw.Window.get().minimize()" style="width:100px;height:30px">

      <script>
         function init() {
             nw.Window.get().maximize();
             nw.Window.get().setResizable(false);
         }
      </script>
   </body>
</html>
  1. Press the button on the top left to minimize the window.
  2. Press the app icon on the taskbar to restore the window.
  3. The window now isn't maximized, has a black border and a close button on the top right, which you can click to close the window.
bug

This issue didn't occure in nwjs v0.24.2

Christywl commented 6 years ago

I can reproduce this issue on Windows with nwjs-sdk-v0.28.3. Linux has a different issue:

  1. Press the button on the top left to minimize the window.
  2. Press the app icon to restore the window.
  3. The window now isn't maximized, it's a smaller window in the top left corner 6486
denneboomyo commented 6 years ago

The issue is also present on v0.29

denneboomyo commented 6 years ago

As a workaround for now, setting the window to non-resizable again after minimizing fixes this issue.

index.html

<html>
   <head></head>
   <body style="background-color: #181818;" onload="init();">
      <button onclick="minimize();" style="width:100px;height:30px">

      <script>
         function init() {
             nw.Window.get().maximize();
             nw.Window.get().setResizable(false);
         }

         function minimize() {
             nw.Window.get().minimize();
             nw.Window.get().setResizable(false);
         }
      </script>
   </body>
</html>