Skip to content

refactor: use gin::Wrappable for electron::api::Screen - #49506

Merged
ckerr merged 1 commit into
mainfrom
refactor/gin-wrappable-api-screen
Jan 25, 2026
Merged

ckerr merged 1 commit into
mainfrom
refactor/gin-wrappable-api-screen

Conversation

@ckerr

@ckerr ckerr commented Jan 23, 2026 •

Copy link
Copy Markdown
Member

Description of Change

Part of #47922.

This PR migrates electron::api::Screen to inherit from gin::Wrappable instead of from gin_helper::DeprecatedWrappable.

Checklist

Release Notes

Notes: none.

@ckerr ckerr added the semver/patch backwards-compatible bug fixes label Jan 23, 2026
@ckerr
ckerr requested a review from a team as a code owner January 23, 2026 18:00
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Jan 23, 2026
@ckerr ckerr mentioned this pull request Jan 23, 2026
2 tasks done
@ckerr ckerr changed the title refactgor: use gin::Wrappable for electron::api::Screen refactor: use gin::Wrappable for electron::api::Screen Jan 23, 2026
@ckerr
ckerr force-pushed the refactor/gin-wrappable-api-screen branch from a6d505a to bf8e646 Compare January 24, 2026 03:48
@alfeddlove

This comment was marked as off-topic.

@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Jan 24, 2026
@ckerr
ckerr merged commit e8250f9 into main Jan 25, 2026
@release-clerk

release-clerk Bot commented Jan 25, 2026

Copy link
Copy Markdown

No Release Notes

@ckerr
ckerr deleted the refactor/gin-wrappable-api-screen branch January 25, 2026 19:46
Comment on lines +80 to +83
// Use `display::Screen::Get()` here, not our cached `screen_`:
// during shutdown, it can get torn down before us.
if (auto* screen = display::Screen::Get())
screen->RemoveObserver(this);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ckerr I missed this new iteration change, if the api class is outliving the cached screen then we also need a similar check in

return screen_->GetCursorScreenPoint();
to protect against use-after-free.

ckerr added a commit that referenced this pull request Jan 26, 2026
ckerr added a commit that referenced this pull request Jan 27, 2026
jkleinsc pushed a commit that referenced this pull request Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-backport semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants