electron icon indicating copy to clipboard operation
electron copied to clipboard

更新electron31.2.1后, mainWindow.unmaximize()没反应[Bug]:

Open KuanyaLiao opened this issue 1 year ago • 1 comments

Preflight Checklist

Electron Version

31.2.1

What operating system(s) are you using?

Windows

Operating System Version

Windows11

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

if (mainWindow && !mainWindow.isDestroyed()) { console.log('maxsize1'); if (mainWindow.isMaximized()) { console.log('maxsize2'); try { mainWindow.unmaximize() console.log('unmaximize'); } catch (error) { console.log('error', error); } } else { console.log('maxsize3'); mainWindow.maximize() } }

打印结果maxsize maxsize1 maxsize2 unmaximize 界面没反应

Actual Behavior

if (mainWindow && !mainWindow.isDestroyed()) { console.log('maxsize1'); if (mainWindow.isMaximized()) { console.log('maxsize2'); try { mainWindow.unmaximize() console.log('unmaximize'); } catch (error) { console.log('error', error); } } else { console.log('maxsize3'); mainWindow.maximize() } }

Testcase Gist URL

No response

Additional Information

No response

KuanyaLiao avatar Jul 26 '24 03:07 KuanyaLiao

Hello @KuanyaLiao. Thanks for reporting this and helping to make Electron better!

Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.

Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.

Now adding the https://github.com/electron/electron/labels/blocked%2Fneed-repro label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.

Unfortunately, without a way to reproduce this issue, we're unable to continue investigation. This issue has been closed and will not be monitored further. If you're able to provide a minimal test case that reproduces this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.

我在macOS下使用 33.2.1 下使用以下代码无法缩小窗口

if (win.isMaximized()) {
	win.unmaximize()
} else {
	win.maximize()
}

biubiukam avatar Dec 05 '24 16:12 biubiukam