electron: [Bug]: Window CSD borders at the wrong position on ozone-wayland

Preflight Checklist

Electron Version

31.0.0

What operating system(s) are you using?

Other Linux

Operating System Version

Arch Linux, rolling

What arch are you using?

x64

Last Known Working Electron version

30

Expected Behavior

gambar

Actual Behavior

gambar

https://github.com/user-attachments/assets/f5e2c36f-2df3-44b4-a38e-1cdc593d1ad7

Testcase Gist URL

No response

Additional Information

Both test cases are run with:
--ozone-platform-hint=auto on GNOME wayland as electron only shows CSD titlebar in GNOME Wayland or Weston compositor. To notice the wrong border either install the rounded-window-corner-reloaded gnome extension and enable outline, or try to drag window titlebar to the top and see where it stops as per video.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 5
  • Comments: 19 (4 by maintainers)

Most upvoted comments

Did some digging about the resize bug #44543 - This may also be caused by #42681 and #41769

I’ve noticed two main issues here:

  1. Incorrect CSD Borders (affects v31) This issue
  2. Can’t resize the client window (affects v32 and v33) - #44543

It’s possible these could be linked to the same root cause, but I figured it’s worth pointing them out separately. After retesting, it looks like the CSD border problem is fixed in v33, but now there’s a new bug where the client window cannot be resized.

I’ve attached an image of the two builds as comparison to illustrate that the CSD border issue is no longer inset, and v33 displays correctly without an inset. However, it now lacks window resizing controls at the edges when hovering the mouse over them.

Quick note: the CSD border issue stands out more if you’re using a rounded window extension on Gnome since it highlights the edge. Without it, the issue is less obvious but still there, just without the shader effect drawing attention to it.

Both issues exist only on the Ozone Wayland backend, X11 is fine.

Image attached (Left v31, Right v33) Image

I’m not sure if I’m experiencing the same issue, but many Electron apps cannot be resized at all (this includes Visual Studio Code 1.95, Signal, and Discord). I don’t get any window resizing borders at all. Now it seems that this bug was introduced in a recent Electron release, as Visual Studio Code 1.94.2 is still working.

Here are the versions for 1.95 (not resizeable):

Version: 1.95.0
Commit: 912bb683695358a54ae0c670461738984cbb5b95
Date: 2024-10-28T20:16:24.561Z
Electron: 32.2.1
ElectronBuildId: 10427718
Chromium: 128.0.6613.186
Node.js: 20.18.0
V8: 12.8.374.38-electron.0
OS: Linux x64 6.11.5-arch1-1

And here for 1.94 (resizeable):

Version: 1.94.2
Commit: 384ff7382de624fb94dbaf6da11977bba1ecd427
Date: 2024-10-09T16:08:44.566Z
Electron: 30.5.1
ElectronBuildId: 10262041
Chromium: 124.0.6367.243
Node.js: 20.16.0
V8: 12.4.254.20-electron.0
OS: Linux x64 6.11.5-arch1-1

I’m running Arch Linux on GNOME/Wayland (fractional scaling enabled). Resizing worked up until (and including) Electron 31, it doesn’t work in Electron 32 and 33.

@cbrnr thanks! if someone’s willing who knows how to reproduce this, the build artifacts from my PR to fix #44543 should help verify this.

Thanks Shelley! This issue only occurred pre https://github.com/electron/electron/pull/42746, which i describe in my bisect on the resize issue https://github.com/electron/electron/issues/44543#issuecomment-2599659491

Testing your PR artifact, it does indeed fix the resize issue on Wayland, and the CSD issue described here hasn’t made a comeback so I would say it’s no longer an issue.

Image

@EmptyVisual oops sorry for delay! what you’re saying would make this the offending diff: https://github.com/electron/electron/compare/v31.0.0-alpha.5...v31.0.0-beta.1 - i agree with you that it’s likely https://github.com/electron/electron/commit/dff980c9c20da444fb853b6983eb75d48714b486! been a bit thinly spread but i can try to refocus on this 😃