openai / openai/codex

[Windows] Desktop pet hit-testing and dragging break after moving or resizing the pet

Open
#42,190 15 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug pets windows-os
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

Summary

The Codex desktop pet renders correctly, but its interactive area can become detached from its visible position after the pet is dragged or resized.

Mouse input may pass through the pet and activate the window underneath. This affects not only the pet itself, but also controls displayed around it, such as chat, voice, and close buttons.

A related issue occurs when the Codex main window is positioned underneath the pet: clicking may continue to work, but dragging stops working.

Environment

  • Codex desktop app version: 26.831.1445.0
  • Platform: Windows
  • Display configuration: Multi-monitor setup, 2560×1440 displays at 100% scaling
  • Affected pets: Reproduced with both built-in and custom pets

No account identifiers, local paths, window handles, process IDs, or display IDs are included in this report.

Steps to reproduce

Case 1: Interaction breaks after dragging or resizing
  1. Enable the desktop pet.
  2. Use the pet reset option.
  3. Confirm that the pet is initially clickable and draggable.
  4. Drag the pet to another position.
  5. Try hovering over or clicking the pet again.
  6. Resize the pet and test its interactive area again.
Case 2: Dragging fails over the Codex main window
  1. Position the Codex main window underneath the desktop pet.
  2. Click the pet and confirm that clicking may still work.
  3. Attempt to drag the pet.
  4. Observe that dragging does not start or stops immediately.
  5. Move the Codex main window away from underneath the pet and try again.

Actual behavior

  • The pet model and visual animations continue to render normally.
  • Mouse events can pass through the pet to the content underneath.
  • In some states, only a small portion near the top-left of the pet remains interactive.
  • Controls such as chat, voice, and close buttons may also become non-interactive.
  • Hover and click animations may stop receiving pointer events.
  • Resetting the pet temporarily restores interaction, but the pet may jump to another position.
  • Dragging the pet again can cause the problem to return.
  • Resizing the pet can unexpectedly change its position.
  • When the Codex main window is underneath the pet, clicking may work while dragging does not.
  • Restarting the app or switching to another pet does not reliably resolve the issue.

Expected behavior

  • The visible pet bounds and interactive bounds should always remain aligned.
  • Hover, click, controls, and dragging should work across the entire visible pet.
  • Dragging should work regardless of which application window is underneath the pet.
  • Resizing should preserve the pet’s anchor position unless repositioning is explicitly required.
  • Moving or resizing the pet should immediately recalculate its hit-test region.
  • Behavior should remain correct across multiple monitors and display scaling configurations.

Frequency

The issue was consistently reproducible after moving or resizing the pet.

It also reappeared after a Codex desktop app update recreated the pet overlay window.

Troubleshooting already attempted

  • Restarted the Codex desktop app
  • Restarted Windows
  • Switched between multiple pets
  • Reset the pet
  • Reset the stored pet state
  • Repositioned and resized the pet

These actions either had no effect or only fixed the issue temporarily.

Diagnostic observations

The problem appears to be related to the transparent, always-on-top pet overlay rather than the pet asset itself.

The overlay continues rendering correctly while pointer routing fails. A diagnostic workaround that handled window movement natively and separately forwarded hover/click events restored the expected behavior. This suggests that the failure may involve overlay hit-testing, pointer capture, or coordinate synchronization.

Possible areas to investigate:

  • Interaction between Electron setIgnoreMouseEvents and pointer capture on Windows
  • WS_EX_TRANSPARENT or equivalent transparent-window hit-testing
  • Loss of pointer-move events when another Codex window is underneath the overlay
  • Stale hit-test bounds after moving or resizing the pet
  • Mixing display-independent coordinates with physical screen pixels
  • Per-monitor DPI conversion and display-bound recalculation
  • Overlay window recreation after an application update

These are diagnostic inferences rather than confirmed implementation details.

Suggested direction

A native hit-test approach may be more reliable:

  • Return an interactive hit-test result for the pet and its controls
  • Return a transparent hit-test result only for empty overlay areas
  • Use native pointer capture or native window dragging for the pet body
  • Keep animation events separate from the authoritative window movement
  • Recalculate bounds after drag, resize, DPI, display, or overlay-window changes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Codex desktop pet's transparent, always-on-top overlay entry point and reproduce both dragging cases on Windows. Inspect the interaction around Electron setIgnoreMouseEvents, pointer capture, overlay movement, resizing, and display or DPI changes. Done means the visible and interactive bounds stay aligned, controls receive input, and dragging works when another Codex window is underneath.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.