mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[PR #1494] refactor (window): replace raw isize window handles with self-documenting Window and custom ID types
#1429
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/LGUG2Z/komorebi/pull/1494
Author: @JustForFun88
Created: 6/28/2025
Status: 🔄 Open
Base:
master← Head:private_window_internals📝 Commits (5)
f9ea220Stop exposing Ring internals862a55fUseArc<str>andWsElementIdinstead ofString3020684make serialize and deserialize compact8cbf024MakeWindowinternals private.86b297fMake clippy happy📊 Changes
41 files changed (+1651 additions, -1663 deletions)
View changed files
📝
komorebi-bar/src/bar.rs(+18 -22)📝
komorebi-bar/src/main.rs(+13 -23)📝
komorebi-bar/src/widgets/battery.rs(+1 -1)📝
komorebi-bar/src/widgets/cpu.rs(+3 -3)📝
komorebi-bar/src/widgets/date.rs(+1 -1)📝
komorebi-bar/src/widgets/komorebi.rs(+10 -11)📝
komorebi-bar/src/widgets/komorebi_layout.rs(+2 -3)📝
komorebi-bar/src/widgets/memory.rs(+3 -3)📝
komorebi-bar/src/widgets/mod.rs(+5 -4)📝
komorebi-bar/src/widgets/network.rs(+2 -2)📝
komorebi-bar/src/widgets/storage.rs(+2 -2)📝
komorebi-bar/src/widgets/time.rs(+1 -1)📝
komorebi-bar/src/widgets/update.rs(+1 -1)📝
komorebi-gui/src/main.rs(+8 -8)📝
komorebi/src/animation/prefix.rs(+1 -1)📝
komorebi/src/border_manager/border.rs(+54 -37)📝
komorebi/src/border_manager/mod.rs(+152 -129)📝
komorebi/src/container.rs(+49 -67)📝
komorebi/src/core/mod.rs(+16 -1)📝
komorebi/src/focus_manager.rs(+5 -5)...and 21 more files
📄 Description
This pull request makes the
hwndfield of theWindowstruct private and updates the codebase to use the explicitWindowtype or dedicated ID structs (such asBorderId,StackbarId) instead of rawisizehandles. This makes all window management logic self-documenting, safer, and easier to maintain.Motivation & Benefits:
ReaperNotification(pub HashMap<Window, (usize, usize)>)).isizeidentifiers from related structs, introducing clear ID types.Key Refactorings:
Hiddennow holds a privateWindowfield instead ofisize.Stackbarnow uses aStackbarIdstruct that wraps aWindow.Bordernow stores aBorderIdandtracking_window: Windowinstead of raw handles.Other Notes:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.