electron / electron

:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS
https://electronjs.org
MIT License
114.39k stars 15.43k forks source link

[Bug]: Linux BrowserWindow "resize" emitted during "move", and vice versa #42629

Open safris opened 4 months ago

safris commented 4 months ago

Preflight Checklist

Electron Version

30.0.1

What operating system are you using?

Ubuntu

Operating System Version

Ubuntu 22.04

What arch are you using?

arm64 (including Apple Silicon)

Last Known Working Electron version

No response

Expected Behavior

In the attached GIST, console.log("m") occurs for BrowserWindow.on("move"), and console.log("r") occurs for BrowserWindow.on("resize").

Expected Behavior:

  1. That when the window is moved, only "m" is seen being outputted in the console.
  2. That when the window is resized, only "r" is seen being outputted in the console.

Actual Behavior

Three distinct use-cases:

  1. ❌ When the window is moved, "m" and "r" are seen in the console. This is not expected.
  2. ❌ When the window is resized via the upper-left-hand and upper-right-hand corners, and left-hand border and top border, "m" and "r" are seen in the console. This is not expected.
  3. ✅ When the window is resized via the lower-left-hand and lower-right-hand corners, and right-hand border, "r" is seen in the console. This is expected.

It seems that if the title bar is either moved or resized, both "move" and "resize" events are emitted. If other parts of the window are moved or resized, "move" and "resize" are emitted respectfully to the correct action.

I've also tried with frame=false, and the behavior is the same.

This issue seems to be related to #28134.

Testcase Gist URL

https://gist.github.com/safris/bb9e06b50d82e83f787a1b52f94b3f3c

Additional Information

No response

codebytere commented 4 months ago

@safris i'm unable to reproduce using the provided version and Ubuntu. I see r only when expected, and m only when expected. Is there anything else necessary to see the unexpected behavior?

safris commented 3 months ago

@codebytere, I'm surprised you cannot reproduce this, because this definitely happens for me. I just ran the attached GIST, and when I move the window I see this in my terminal:

image

Note that I'm testing from a Parallels VM on arm64 architecture with Ubuntu running the Cinnamon desktop environment.

electron-issue-triage[bot] commented 3 weeks ago

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

safris commented 3 weeks ago

Bump