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

[Bug]: Maximizing/Minimizing/Etc A Frameless Window Has No Animations On Windows 11 #33152

Closed
3 tasks done
nobu-sh opened this issue Mar 5, 2022 · 7 comments
Closed
3 tasks done

Comments

@nobu-sh
Copy link

nobu-sh commented Mar 5, 2022

Preflight Checklist

Electron Version

17.1,0

What operating system are you using?

Windows

Operating System Version

Microsoft Windows 11 Pro 10.0.22000 Build 22000

What arch are you using?

x64

Last Known Working Electron version

14.2.5

Expected Behavior

When setting frame in web preferences to false and creating my own app bar with -webkit-app-region: drag; (as shown in docs) when double clicking the area or dragging to the top to maximize the window, it should transition between sizes smoothly with an animation.

Actual Behavior

It statically changes sizes. Instantly going from one size to another without the smooth transition.

Testcase Gist URL

https://gist.github.com/nobu-sh/cf9c56ab9fd8488d3a1327a6f048789b

Additional Information

Video to go along with the gist linked:

2022-03-04.20-01-15.mp4

For context, fullscreening is an instant static movement. Normally is a smooth transition from windowed to fullscreen.

@FlysoftBeta
Copy link

i have the same problem and it causes by #32692
so my solution is:
if (process.platform == "win32") {
// ffi-napi
var set_style = new Library("user32.dll", {
"SetWindowLongA": ["int", ["int", "int", "long"]]
});
const WS_THICKFRAME = 0x00040000;
const WS_CAPTION = 0x00C00000;
const WS_OVERLAPPED = 0x00C00000;
const WS_MAXIMIZEBOX = 0x00010000;
const WS_MINIMIZEBOX = 0x00020000;
var style = WS_CAPTION | WS_OVERLAPPED | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
set_style.SetWindowLongA(window.getNativeWindowHandle().readUint32LE(), -16, style);
}

@FlysoftBeta
Copy link

i have the same problem and it causes by #32692 so my solution is: if (process.platform == "win32") { // ffi-napi var set_style = new Library("user32.dll", { "SetWindowLongA": ["int", ["int", "int", "long"]] }); const WS_THICKFRAME = 0x00040000; const WS_CAPTION = 0x00C00000; const WS_OVERLAPPED = 0x00C00000; const WS_MAXIMIZEBOX = 0x00010000; const WS_MINIMIZEBOX = 0x00020000; var style = WS_CAPTION | WS_OVERLAPPED | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX; set_style.SetWindowLongA(window.getNativeWindowHandle().readUint32LE(), -16, style); }

the problem appears in electron v14.2.6

@nobu-sh
Copy link
Author

nobu-sh commented Mar 5, 2022

Thankyou for sharing this, very interesting; However, it does not appear to work for me. It results in a border and no window haha. Appears to not fully initialize now.

image

I just ended up downgrading to v13.6.9 where the issue is not present!

@FlysoftBeta
Copy link

Well, you can use 14.2.5,it is newer than 13.6.9 and the problem wont appear in 14.2.5

@nobu-sh
Copy link
Author

nobu-sh commented Mar 5, 2022

Ah alright thanks, will try that out!

@xpirt
Copy link

xpirt commented Mar 8, 2022

I think it's a duplicate of the issue #32993.

@mlaurencin
Copy link
Contributor

I agree, this looks like a duplicate of #32993. Please continue any further discussion in that issue instead. You may also want to subscribe there for updates.

Because we treat our issues list as the project team's backlog, we close duplicates to focus our work and not have to touch the same chunk of code for the same reason multiple times. This is also why we may mark something as duplicate that isn't an exact duplicate but is closely related.

@dsanders11 dsanders11 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 2023
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