Some macOS focus/input tweaks, plus a few other minor fixes#332
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
🚧 Files skipped from review as they are similar to previous changes (10)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR adds macOS SDL helper code and dialog handling, updates native file dialog lifecycle tracking, adjusts viewer skin XML, and rebuilds the parcel overlay during minimap reshape. ChangesmacOS SDL dialog focus flow
Viewer skin markup updates
Minimap parcel overlay refresh
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@indra/newview/llsdlfiledialog.h`:
- Around line 84-86: `SDL_DialogFileCallback` is doing dialog-close work off the
main thread via `trampoline()` and `LLWindowSDL::exitDialog()`. Update
`trampoline()` so it only decodes the result and then posts the close/focus
handling back to the main thread, where `LLWindowSDL::exitDialog()` can safely
update `mDialogDepth` and trigger `SDL_RaiseWindow()`/focus restoration.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: eb500ca3-c53e-4117-94a7-6c5f0a932f06
📒 Files selected for processing (4)
indra/llwindow/llwindowsdl.cppindra/llwindow/llwindowsdl.hindra/newview/llappviewer.cppindra/newview/llsdlfiledialog.h
🚧 Files skipped from review as they are similar to previous changes (1)
- indra/newview/llappviewer.cpp
LLNetMap::reshape() recreated only the object image and recomputed mObjectMapTPM from its size, but never recreated the parcel image. Since createImage() snaps the texture to a power of two from the widget diagonal, a resize that pushed the object image up a size (e.g. 128->256) left the parcel image at the old size. renderPropertyLinesForRegion() then plotted region/parcel coordinates with the object-derived mObjectMapTPM into the smaller parcel texture, rasterizing the sim border and parcel lines at the object/parcel size ratio (2x) -- so boundaries snapped to twice the sim size at each power-of-two threshold. Recreate the parcel image alongside the object image in reshape() so the two textures always share a size, which is the invariant mObjectMapTPM relies on. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
SDL3's Cocoa backend auto-creates a default menu bar whose Window > Close item binds Cmd+W to performClose:, which intercepts the shortcut before the viewer's own control|W accelerator and tears down the window (read as a quit request by the SDL backend). Strip that key equivalent after init so Cmd+W falls through to File.CloseWindow (close frontmost floater, or no-op). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The async SDL file picker (used by uploads) returns to the normal frame loop, which services the modeless dialog via SDL_PumpEvents. Once the dialog takes key focus the loop starts applying BackgroundYieldTime, starving the dialog into laggy scrolling/typing. Track open dialogs and skip the yield while one is up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
SDL shows the file picker as a sheet and, on close, only reactivates the app (no makeKeyWindow), so the viewer is left with no key window: keystrokes hit no responder and AppKit beeps. Re-key the window on the next main-queue turn (after SDL's own reactivation) so it becomes key again and SDL emits FOCUS_GAINED, restoring input. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The SDL3 file picker tracked its own open state with a parallel atomic counter and a standalone focus-restore static. Fold both into the existing beforeDialog/afterDialog path so mDialogDepth is the single source of truth: show() and trampoline() now bracket the dialog via enterDialog/exitDialog, which also drops fullscreen and mouselook for its duration like the blocking pickers do. The macOS key-window restore stays scoped to the file dialog so message boxes are unaffected, and the frame-loop yield gate queries the same depth via dialogOpen(). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
9800cde to
d47ade0
Compare
Several quick adjustments, thought it'd be better to bundle these. Let me know if you'd prefer any pulled out, or changed.
macOS focus/input related
Plus few minor fixes
Show distance toggle for name tags
Normal radio input no longer partially obscured by the "choose from/save to inventory" button