Skip to content

Conversation

Kilian
Copy link
Contributor

@Kilian Kilian commented Jun 3, 2025

Linux systems don't correctly calculate the offset of elements in the page when the WM draws the browserWindow Chrome. This causes getBoundingClientRect to return values that are incorrect when used outside of the browserWindow. This adds an optional offset attribute to browser-action-list to tweak the offset of the popup to take this into account.

Fixes #121


✅ By sending this pull request, I agree to the Contributor License Agreement of this project.

@Kilian Kilian changed the title add new offset attribute to browser-action-list to determine the offset add new offset attribute to browser-action-list to determine the popup offset Jun 3, 2025
@samuelmaddock
Copy link
Owner

Manually including an offset isn't necessary in this case. The underlying issue was that the popup didn't consider the native titlebar height (0f1fded).

@Kilian
Copy link
Contributor Author

Kilian commented Jun 17, 2025

That is incorrect. The calculation you do here results in a nativeTitlebarHeight of 0 because getBounds and getContentBounds are identical on linux. Did you verify it isn't also 0 for you?

A manual offset value is still needed to fix this issue and is also more broadly useful.

@Kilian
Copy link
Contributor Author

Kilian commented Jun 17, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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