Skip to content

Conversation

@JustForFun88
Copy link
Contributor

This pull request makes the hwnd field of the Window struct private and updates the codebase to use the explicit Window type or dedicated ID structs (such as BorderId, StackbarId) instead of raw isize handles. This makes all window management logic self-documenting, safer, and easier to maintain.

Motivation & Benefits:

  • All data structures and APIs now use intention-revealing types instead of ambiguous integers (e.g., ReaperNotification(pub HashMap<Window, (usize, usize)>)).
  • Removes isize identifiers from related structs, introducing clear ID types.
  • Improves type safety and enforces encapsulation, making the API and overall codebase more robust and understandable.
  • The code is now more self-documenting — window-related logic is explicit and easy to follow at a glance.

Key Refactorings:

  • Hidden now holds a private Window field instead of isize.
  • Stackbar now uses a StackbarId struct that wraps a Window.
  • Border now stores a BorderId and tracking_window: Window instead of raw handles.

Other Notes:

@JustForFun88 JustForFun88 changed the title Private window internals refactor (window): replace raw isize window handles with self-documenting Window and custom ID types Jun 28, 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.

1 participant