Skip to content

Migrate custom size/position types to those from the dpi crate#275

Merged
prokopyl merged 9 commits into
nextfrom
dpi-crate
Jun 22, 2026
Merged

Migrate custom size/position types to those from the dpi crate#275
prokopyl merged 9 commits into
nextfrom
dpi-crate

Conversation

@prokopyl

@prokopyl prokopyl commented Jun 21, 2026

Copy link
Copy Markdown
Member

This PR removes the WindowInfo, Size, Point, PhySize and PhyPoint types, and replaces them with types from the dpi crate.

This provides usability improvements compared to the old types, as well as better ecosystem integration (since those types are used widely in the Rust GUI ecosystem).

This change also enables a couple more improvements, which this PR provides:

  • Use the dpi::Size type in WindowOpenOptions::size and WindowContext::resize, allowing users to pass either physical or logical sizes.
  • Move the WindowEvent::Resized event to its own WindowContext::resized handler, properly indicating that window resizes are not an event that can be captured or ignored.
  • Introduce a new WindowSize type used in the resized handler, providing both physical and logical sizes with the guarantee that one of them came directly from the underlying platform APIs. This prevents having to do back-and-forth conversions that can be lossy due to rounding.

@prokopyl prokopyl changed the base branch from master to next June 21, 2026 10:40
@prokopyl prokopyl changed the title Dpi crate Migrate custom size/position types to those from the dpi crate Jun 22, 2026
@prokopyl prokopyl marked this pull request as ready for review June 22, 2026 23:50
@prokopyl prokopyl merged commit cc28453 into next Jun 22, 2026
14 checks passed
@prokopyl prokopyl deleted the dpi-crate branch June 22, 2026 23:53
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.

1 participant