Skip to content

window management: bump almost maximize to 90%, suppress resize anima…#397

Merged
shobhit99 merged 3 commits into
mainfrom
windw-mgmt-fixes
May 15, 2026
Merged

window management: bump almost maximize to 90%, suppress resize anima…#397
shobhit99 merged 3 commits into
mainfrom
windw-mgmt-fixes

Conversation

@shobhit99
Copy link
Copy Markdown
Contributor

Increase the "Almost Maximize" layout from 80% to 90% of the work area (both native Swift path and JS fallback). Also suppress the window resize animation for all window management commands by temporarily toggling AXEnhancedUserInterface off on the target app before setting bounds.

…tion

Increase the "Almost Maximize" layout from 80% to 90% of the work area
(both native Swift path and JS fallback). Also suppress the window resize
animation for all window management commands by temporarily toggling
AXEnhancedUserInterface off on the target app before setting bounds.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bec375a4f6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/native/window-adjust.swift Outdated

if hasPid {
let appRef = AXUIElementCreateApplication(pid)
AXUIElementSetAttributeValue(appRef, "AXEnhancedUserInterface" as CFString, kCFBooleanTrue)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore AXEnhancedUserInterface to prior value, not always true

setWindowFrame unconditionally writes AXEnhancedUserInterface = true after resizing, even though it never reads the app’s previous value. For apps that already had this attribute set to false (or a non-default value), every window-management command now permanently flips their setting, which is a behavior regression outside this function’s scope. Capture the original attribute value and restore that value instead of forcing true.

Useful? React with 👍 / 👎.

Comment on lines +321 to 325
AXUIElementSetAttributeValue(appRef, "AXEnhancedUserInterface" as CFString, kCFBooleanFalse)
}

var point = CGPoint(x: frame.x, y: frame.y)
guard let pointValue = AXValueCreate(.cgPoint, &point) else { return false }
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Re-enable AXEnhancedUserInterface on all early returns

After setting AXEnhancedUserInterface to false, the function can still return early through later guard failures, which skips the restore block and leaves the target app in the disabled state. This can happen when AX value creation fails (for example, if a computed frame is invalid/non-finite), so cleanup needs to run on every exit path (e.g., via defer) once the attribute has been toggled.

Useful? React with 👍 / 👎.

shobhit99 and others added 2 commits May 16, 2026 00:41
Instead of unconditionally restoring to true, read the app's existing
value before disabling it and restore that exact value afterwards.
Prevents permanently flipping the attribute for apps that had it
explicitly set to false or unset.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@shobhit99 shobhit99 merged commit 6fef59c into main May 15, 2026
1 check passed
@shobhit99 shobhit99 deleted the windw-mgmt-fixes branch May 15, 2026 19:59
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