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]: minWidth no longer working #32608

Closed
3 tasks done
t57ser opened this issue Jan 25, 2022 · 4 comments · Fixed by #32628
Closed
3 tasks done

[Bug]: minWidth no longer working #32608

t57ser opened this issue Jan 25, 2022 · 4 comments · Fixed by #32628
Labels
17-x-y bug 🪲 bug/regression ↩️ A new version of Electron broke something
Projects

Comments

@t57ser
Copy link
Contributor

t57ser commented Jan 25, 2022

Preflight Checklist

Electron Version

17.0.0-beta.7

What operating system are you using?

Windows

Operating System Version

Windows 10 19042.985

What arch are you using?

x64

Last Known Working Electron version

16

Expected Behavior

Setting minWidth for a browserWindow during creation should work

Actual Behavior

minWidth does not work (minHeight does)

const { app, BrowserWindow } = require("electron");

function init() {
	let browserWindow1 = new BrowserWindow({
		show: true,
		minWidth: 500,
		minHeight: 500,
	});
}

app.on("ready", () => {
	init();
});

Note: It works when using browserWindow1.setMinimumSize(500, 500);

Testcase Gist URL

No response

Additional Information

No response

@codebytere
Copy link
Member

codebytere commented Jan 25, 2022

Looks like this regressed in v17.0.0-alpha.3...v17.0.0-alpha.4 and within that, b6f8a16 seems like the likely culprit - cc @CezaryKulakowski

@codebytere codebytere added 17-x-y bug/regression ↩️ A new version of Electron broke something labels Jan 25, 2022
@CezaryKulakowski
Copy link
Contributor

My changes are in method HWNDMessageHandler::SizeWindowToAspectRatio which is called only when aspect ratio is set on the BrowserWindow. As test case from this bug doesn't set it I'd suspect that some change in the chromium intake causes the problem. I'll take a look at a later time.

@CezaryKulakowski
Copy link
Contributor

I can confirm that it's definitely not caused by b6f8a16. My change modifies file ui/views/win/hwnd_message_handler.cc which is being compiled only on Windows and the regression with minWidth can be observed also on macOS.

@nornagon
Copy link
Member

lol found it, it's this:

image

|| short-circuits, | does not.

@VerteDinde VerteDinde added this to Fixed For Next Release in 17-x-y Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
17-x-y bug 🪲 bug/regression ↩️ A new version of Electron broke something
Projects
17-x-y
Fixed For Next Release
Development

Successfully merging a pull request may close this issue.

4 participants