Skip to content

Some macOS focus/input tweaks, plus a few other minor fixes#332

Merged
RyeMutt merged 9 commits into
AlchemyViewer:developfrom
gwigz:gwigz/various-fixes
Jun 28, 2026
Merged

Some macOS focus/input tweaks, plus a few other minor fixes#332
RyeMutt merged 9 commits into
AlchemyViewer:developfrom
gwigz:gwigz/various-fixes

Conversation

@gwigz

@gwigz gwigz commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

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

  • Stop ⌘+W from calling quit
  • Avoid background-yield while a native file dialog is open
    • Somehow it was making the upload dialog laggy, just disabled it while an upload modal is open at the moment, this might be a fair bit on the hacky side?
  • Restore window focus after a native file dialog closes

Plus few minor fixes

  • Add a show-distance toggle for name tag options
  • Some overlapping in tools
  • Mini-map parcel boundaries scaling to 2x sim size on resize

SCR-20260627-jiky

Show distance toggle for name tags

SCR-20260627-jihm

Normal radio input no longer partially obscured by the "choose from/save to inventory" button

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: eaac8c1e-34ea-43f8-8879-ddd1bc3b62ed

📥 Commits

Reviewing files that changed from the base of the PR and between 9800cde and d47ade0.

📒 Files selected for processing (11)
  • indra/llwindow/CMakeLists.txt
  • indra/llwindow/llsdl.cpp
  • indra/llwindow/llsdl_macos.h
  • indra/llwindow/llsdl_macos.mm
  • indra/llwindow/llwindowsdl.cpp
  • indra/llwindow/llwindowsdl.h
  • indra/newview/llappviewer.cpp
  • indra/newview/llnetmap.cpp
  • indra/newview/llsdlfiledialog.h
  • indra/newview/skins/default/xui/en/panel_preferences_general.xml
  • indra/newview/skins/default/xui/en/panel_tools_texture.xml
🚧 Files skipped from review as they are similar to previous changes (10)
  • indra/llwindow/llsdl_macos.h
  • indra/llwindow/CMakeLists.txt
  • indra/llwindow/llsdl.cpp
  • indra/newview/skins/default/xui/en/panel_preferences_general.xml
  • indra/llwindow/llsdl_macos.mm
  • indra/newview/llnetmap.cpp
  • indra/newview/llsdlfiledialog.h
  • indra/llwindow/llwindowsdl.h
  • indra/newview/skins/default/xui/en/panel_tools_texture.xml
  • indra/llwindow/llwindowsdl.cpp

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added a new “Distance” option for avatar name tags in Preferences.
    • Minimap resizing now refreshes parcel overlay images.
  • Bug Fixes
    • Improved macOS native file dialog behavior so focus/fullscreen mouselook are restored correctly after dialogs close.
    • Fixed macOS SDL close-shortcut handling so Cmd+W closes the viewer window as expected.
    • Prevented unintended “quit on last window close” behavior and suppressed background sleep/yield while a native dialog is open.
  • Style
    • Updated Preferences and Texture tools panel UI spacing/formatting (no functional changes).

Walkthrough

The 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.

Changes

macOS SDL dialog focus flow

Layer / File(s) Summary
Build wiring and declarations
indra/llwindow/CMakeLists.txt, indra/llwindow/llsdl_macos.h
The llwindow target adds the macOS Objective-C++ helper source and header, and the helper header declares the exported macOS-specific functions.
SDL init and macOS helpers
indra/llwindow/llsdl.cpp, indra/llwindow/llsdl_macos.mm
SDL initialization includes the macOS helper, disables quit-on-last-window-close, clears the default Cocoa Close shortcut, and defines the macOS helper implementations.
Dialog lifecycle and focus restoration
indra/llwindow/llwindowsdl.h, indra/llwindow/llwindowsdl.cpp, indra/newview/llsdlfiledialog.h, indra/newview/llappviewer.cpp
LLWindowSDL declares and implements dialog bracketing helpers, LLSDLFileDialog enters and exits the dialog bracket around async file dialogs, and LLAppViewer skips background yield while a native dialog is open.

Viewer skin markup updates

Layer / File(s) Summary
Preferences panel controls
indra/newview/skins/default/xui/en/panel_preferences_general.xml
The general preferences panel adds the name-tag distance checkbox and reformats nearby radio groups and spacing.
Texture tools spacing
indra/newview/skins/default/xui/en/panel_tools_texture.xml
The texture tools panel normalizes XML formatting and adjusts several control offsets and padding values.

Minimap parcel overlay refresh

Layer / File(s) Summary
Reshape overlay regeneration
indra/newview/llnetmap.cpp
LLNetMap::reshape() now rebuilds the parcel image when the control is reshaped.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

Hop, hop—Cmd+W found its way,
Dialogs yield, then focus stays.
Panels shift and minimaps gleam,
A rabbit nods at the tidy stream. 🐰

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the changes, but it omits the required Related Issues, Checklist, and Additional Notes sections from the template. Add the missing template sections, especially a linked issue, the checklist items, and any extra notes or testing context.
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and matches the PR's main macOS focus/input fixes plus minor UI/layout updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 262f80c and 1fc3679.

📒 Files selected for processing (4)
  • indra/llwindow/llwindowsdl.cpp
  • indra/llwindow/llwindowsdl.h
  • indra/newview/llappviewer.cpp
  • indra/newview/llsdlfiledialog.h
🚧 Files skipped from review as they are similar to previous changes (1)
  • indra/newview/llappviewer.cpp

Comment thread indra/newview/llsdlfiledialog.h Outdated
gwigz and others added 9 commits June 27, 2026 20:55
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>
@RyeMutt RyeMutt force-pushed the gwigz/various-fixes branch from 9800cde to d47ade0 Compare June 28, 2026 00:55
@RyeMutt RyeMutt merged commit 3725517 into AlchemyViewer:develop Jun 28, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants