electron-browser-shell icon indicating copy to clipboard operation
electron-browser-shell copied to clipboard

[electron-chrome-extensions] popups in incorrect place when drawn with frame on linux

Open Kilian opened this issue 9 months ago • 2 comments

if the browserwindow has a frame on linux (at least), then popups are placed at the wrong height and overlap the icon:

Image

Kilian avatar Mar 05 '25 16:03 Kilian

Ok, so the issue is that when the bounds get returned:

  • height is the inner height (excluding the top frame, same as doing document.documentElement.getBoundingClientRect())
  • x is the position at the top of the frame

getContentBounds returns the same values so is not a solution. If we can know the bottom offset of the window then we can use that together with the (consistent) height to find the right offset.

Kilian avatar Mar 06 '25 10:03 Kilian

Ok so this is a known issue: https://github.com/electron/electron/issues/3183

@samuelmaddock would you be willing to make POSITION_PADDING configurable so I can adapt it depending on the platform?

Kilian avatar Mar 06 '25 14:03 Kilian

@samuelmaddock the difference between getBounds() and getContentBounds() is 0 on linux, so this issue is not solved. (I previously mentioned this here: https://github.com/samuelmaddock/electron-browser-shell/issues/121#issuecomment-2703431398 )

Kilian avatar Jun 17 '25 09:06 Kilian