Skip to content

Refactor User32.kt: extract utility functions into focused utility objects#3935

Merged
guiyanakuang merged 1 commit intomainfrom
refactor/issue-3934-extract-user32-utils
Feb 24, 2026
Merged

Refactor User32.kt: extract utility functions into focused utility objects#3935
guiyanakuang merged 1 commit intomainfrom
refactor/issue-3934-extract-user32-utils

Conversation

@guiyanakuang
Copy link
Copy Markdown
Member

@guiyanakuang guiyanakuang commented Feb 23, 2026

Closes #3934

Summary

  • Extract process/app info utilities (getThreadId, getExeFilePath, getFileDescription, isInstalledFromMicrosoftStore) into WindowsProcessUtils
  • Extract window focus management (bringToFront, backToBack, bringToBackAndPaste, paste, findPasteWindow) into WindowsFocusUtils
  • Extract icon utilities (extractAndSaveIcon, hiconToImage) into WindowsIconUtils
  • Slim User32.kt from ~560 lines to ~130 lines — retains only JNA interface declarations, INSTANCE, and Win32 constants
  • Update all callers: WinAppWindowManager, WinAppInfo, DesktopAppLaunch

Test plan

  • ./gradlew ktlintFormat passes
  • ./gradlew app:desktopTest — all 209 tests pass
  • Manual verification on Windows: clipboard, window focus, icon extraction

@guiyanakuang guiyanakuang merged commit c664e30 into main Feb 24, 2026
2 checks passed
@guiyanakuang guiyanakuang deleted the refactor/issue-3934-extract-user32-utils branch February 24, 2026 04:10
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.

Refactor User32.kt: extract utility functions into focused utility objects

1 participant