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

BrowserWindow 'maximize' and 'unmaximize' events not firing when calling maximize()/unmaximize() with thickFrame: false #27851

Closed
3 tasks done
markleutloff opened this issue Feb 22, 2021 · 9 comments
Labels
11-x-y 12-x-y bug 🪲 component/BrowserWindow has-repro-gist Issue can be reproduced with code at https://gist.github.com/

Comments

@markleutloff
Copy link

markleutloff commented Feb 22, 2021

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    • 11.3.0
    • 12.0.0-beta.27
  • Operating System:
    • Windows 10

Expected Behavior

maximize and unmaximize events should be fired.

Actual Behavior

maximize and unmaximize events are not fired.

To Reproduce

Gist: https://gist.github.com/2b3846eb9e357acb8137efe5ee6d0a52

Create a window with thickFrame set to false and attach event listeners to "maximize" and "unmaxmize", then call window.maximize() dns window.unmaximize()

const mainWindow = new BrowserWindow({
 thickFrame: false
})

mainWindow.on("maximize", () => console.log("maximized"));
mainWindow.on("unmaximize", () => console.log("unmaximized"));

setInterval(() => {
 if (mainWindow.isMaximized())
   mainWindow.unmaximize();
 else
   mainWindow.maximize();
}, 2000);
@Liupeng8
Copy link

have the same issue

@suedama1756
Copy link

I believe this is related to this issue: #27838 as electron is not properly calling the the win32 API showWindow which in turn not fire the event.

@0xENDER
Copy link

0xENDER commented Feb 22, 2021

Yup, the window events are kinda messed up on Windows... #26076

@codebytere
Copy link
Member

codebytere commented Feb 24, 2021

cc @mlaurencin - might be a good one to look at!

@ckerr ckerr added 11-x-y 12-x-y component/BrowserWindow bug 🪲 has-repro-gist Issue can be reproduced with code at https://gist.github.com/ and removed platform/windows labels Feb 24, 2021
@kochelmonster
Copy link

kochelmonster commented Mar 20, 2021

I have the same issue with a frameless BrowserWindow, but in Linux/Gnome.
electron version: 12.0.1

@mlaurencin
Copy link
Contributor

Hi @markleutloff this PR may have fixed your issue. Can you try upgrading to either version 11.4.3 or 12.0.3 and see if you the events are firing for you now?

@kochelmonster
Copy link

Tried it out with Linux/Gnome
version 12.0.5: No maximize/unmaximize events.
version 11.4.3: maximize/unmaximize events are send.

@markleutloff
Copy link
Author

@mlaurencin Thank you, I did test it with 11.4.3, 12.0.3 and 12.0.5, all fired the events for me. Tested on my Win10 machine.

@mlaurencin
Copy link
Contributor

@markleutloff Great to hear.

@kochelmonster Since you are experiencing this issue on a different version number and OS than was originally reported, could you open a new issue with your specific situation? This can ensure that the right things are being tested, and allow other maintainers to understand the situation more clearly.

I will close this issue for now, but if someone is still experiencing this on Windows 10, even after testing the versions in this comment, then it may be considered for reopening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
11-x-y 12-x-y bug 🪲 component/BrowserWindow has-repro-gist Issue can be reproduced with code at https://gist.github.com/
Projects
None yet
Development

No branches or pull requests

9 participants