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

[v0.47.2+] Non-resizable windows don't fullscreen properly #7657

Open
TheRealDannyyy opened this issue Jan 19, 2021 · 2 comments
Open

[v0.47.2+] Non-resizable windows don't fullscreen properly #7657

TheRealDannyyy opened this issue Jan 19, 2021 · 2 comments
Labels
bug has-min-repro Has a minimum reproduction

Comments

@TheRealDannyyy
Copy link

TheRealDannyyy commented Jan 19, 2021

NWJS Version: v0.47.2+
Operating System: Windows 10
Example Project: JSExecTester.zip

Expected behavior

Non-resizable windows should fullscreen properly as they did before the changes in v0.47.2 were applied. NWjs v0.47.1 and older work as expected for testing this.

Actual behavior

When entering fullscreen with a non-resizable window. The window just ends up on the top-left of the screen.

How to reproduce

  1. Download and unzip example project files and run NWjs v0.47.2+
  2. Enter document.documentElement.requestFullscreen(); inside the textbox
  3. Press the "Run" button and notice wrong fullscreen behavior
@TheRealDannyyy
Copy link
Author

TheRealDannyyy commented Apr 29, 2021

@rogerwang could this please be investigated?
I think I narrowed it down to the exact version with the code changes, that probably caused this issue.

@TheJaredWilcurt
Copy link
Member

If you want to have a window that can't be resized, but can enter and leave fullscreen, use these functions:

function fullscreen () {
  const win = nw.Window.get();
  win.setResizable(true);
  win.enterFullscreen();
  win.setResizable(false);
}
function restore () {
  const win = nw.Window.get();
  win.setResizable(true);
  win.leaveFullscreen();
  win.setResizable(false);
}

@ayushmanchhabra ayushmanchhabra added bug has-min-repro Has a minimum reproduction labels Oct 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug has-min-repro Has a minimum reproduction
Projects
None yet
Development

No branches or pull requests

3 participants