Second half of the NVIDIA black screen (#3). With the visual fix the
compositor gets a window surface and drawables recycle, but the window
stays black: after CARenderer draws, the back buffer reads back black and
even a glClear to blue changes nothing. GL_DRAW_BUFFER and GL_READ_BUFFER
are GL_NONE.
CALayerContext -setSubwindow: creates the context and then notifies the
layer tree; CAMetalLayer -_setContext: makes the context current (to
create its textures) before any window surface is attached. Per
EGL_KHR_surfaceless_context, a context first made current without a
default framebuffer starts with DRAW_BUFFER = NONE, and attaching a
window later doesn't change it. NVIDIA follows that; Mesa resets it on
bind, which is why AMD works.
After CGLContextMakeCurrentAndAttachToWindow in -renderLayer:, set the
draw and read buffers to GL_BACK.
On NVIDIA (RTX 2070 SUPER, driver 615.78, Xwayland) the game showed a
black screen and logged "Metal Device timed out giving us a Drawable to
present" every second (#3).
X11Window picked its visual with glXChooseVisual, which on NVIDIA returns
a GLX-only visual (0x304 here). NVIDIA's EGL configs only map to the
default visual (0x69) and the 32-bit one (0x99), so CGLGetWindow's
eglCreateWindowSurface failed with EGL_BAD_CONFIG for the window and its
subwindows, for every one of the 40 window configs. CGLGetWindow returns
NULL without logging, CALayerContext keeps _cglWindow == NULL, -render
returns before prepareMetalLayers, and CAMetalLayer never gets its three
drawables back. Mesa accepts the GLX visual, which is why AMD works.
Use the default visual when it is TrueColor with depth >= 24, falling
back to glXChooseVisual otherwise. This also fixes every other Darling
window on NVIDIA: plain AppKit windows (title bars included),
layer-backed views and NSOpenGLView were all black without it.
League enters relative mouse mode on GNOME (Xwayland) and inside gamescope, but
keeps a visible cursor and warps it every frame at its own mouse speed. Xwayland
cannot move a visible pointer, so those warps never took effect: the virtual
cursor, where clicks land, drifted hundreds of pixels from the cursor on screen
and never reached the screen edges, which also stopped edge panning.
Where warps are not honoured, the virtual cursor now follows the physical
pointer and the game's warps leave it in place. With a hidden cursor, or on a
server that honours warps, nothing changes. The host model test gains a case
replaying the drift from an in-game trace.
Tested manually in the practice tool under gamescope 3.16.31 on GNOME 51 with
AMD RADV: clicks land on the cursor and edge panning works.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Port the fullscreen policy omitted when adapting PR #12. Track requested fullscreen state across frame and style changes, exclude unmanaged windows, and use EWMH REMOVE when leaving fullscreen.
Extend the native geometry probe and document passive tracing for the reported vertical click offset, whose cause remains unconfirmed.
CGDisplayScreenSize returned 0x0 for any display with EDID (upstream left
that branch unimplemented). League divides by it for its camera aspect
ratio, so the view-projection x row became NaN: every 3D vertex was
discarded, the scene showed only its blue clear colour, and world clicks
were ignored. Read the size from the EDID detailed timing (mm) or basic
parameters (cm), fall back to 96 dpi, and use the main display for an
unknown id.
CGDisplayCopyAllDisplayModes returned NULL for display 0 (a window off
every screen), which League passes straight to CFArrayGetCount. Fall back
to the main display, then to an empty array.
Add riot-display-modes-check covering both for the main display,
display 0 and an unknown id.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Adapt the geometry fix from PR #12 to the current relative-mouse implementation. Keep display IDs independent of primary-first screen ordering, translate window and pointer coordinates consistently, and invalidate geometry on both RandR event types.
Handle failed RandR snapshots and free EDID data. Add isolated native geometry regression coverage and use the configured SDK when linking the X11 probe.
Validated all 30 component patches, the X11 and CoreGraphics builds, six native geometry groups, and the existing relative-mouse checks. The user confirmed the installed fix works on 2026-10-16.
Co-authored-by: Maka <[email protected]>
CGAssociateMouseAndMouseCursorPosition(false) used to warp the pointer to the
window center, freeze the reported position there and treat the game's own
CGWarpMouseCursorPosition calls as motion. On Xwayland, which ignores warps
while the cursor is visible, this left League's cursor stuck in the middle.
The backend now keeps a frozen virtual cursor: physical motion only produces
deltas (deltaY positive downwards), application warps move the virtual cursor
and their echoes are dropped, mouseLocation returns it, and the pointer is only
warped back where the server honours warps. The grab no longer uses the
invalid FocusChangeMask and is released and retaken across focus changes.
setCursor: no longer re-sends XDefineCursor/XFlush when the window already has
that cursor; League set it about 190 times per second.
Also carries the opt-in input trace (/tmp/rclol-input-trace in the guest).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Traverse the layer tree before compositing so nested Metal layers consume queued drawables and recycle their pool. Add a nested presentation probe covering pool reuse and Vulkan-to-OpenGL pixel readback.
NVIDIA's GL rejects GL_LINEAR_TILING_EXT with GL_INVALID_VALUE, so the
linear internal image could not be imported and the window stayed black.
Pick the tiling by GL_VENDOR; other drivers keep linear.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
NSApplication's attention timer calls -[CGWindow flashWindow], which X11Window
did not override; the base class raised an uncaught abstract-invocation
exception and LeagueClientUx aborted (and restarted every ~50s). Mark the
window as demanding attention through _NET_WM_STATE instead.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Wait up to 2 s for the cancellation callback instead of one 50 ms run-loop
pass, count only callbacks without stored addresses so a completed lookup
cannot pass as a cancellation, print the failing stage, and have the runner
require the exact success line since Darling can exit zero after a trap.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
League sets framebufferOnly=NO on its CAMetalLayer, and QuartzCore read
that as needing host-visible coherent memory, so the game's final
render target and the linear image handed to OpenGL both lived in
system RAM (type 2 on the RX 6600) and crossed PCIe every frame.
framebufferOnly=NO only lets Metal sample or blit the texture: nothing
maps either image (replaceRegion aborts, getBytes is a stub, Indium
maps only Shared/Managed buffers).
Drawables now take the first allowed DEVICE_LOCAL type whatever
framebufferOnly says; the guest file /tmp/metal-no-drawable-vram
restores the old placement. metal-device.log shows drawable-vram=on and
storage=vram.
A native EGL/RADV test exported the drawable's linear image from VRAM
and imported it into GL with no errors and identical pixels. In a
practice-tool baron fight on the RX 6600 with the same champion it ran
about 20 FPS faster and the same when idle; not yet measured in an ARAM.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
find_package(LLVM CONFIG) also searches <prefix>/llvm/lib/cmake/llvm for
every PATH entry, before the system prefixes. With /opt/rocm/bin on PATH
it found ROCm's LLVM 22.0.0git, whose llvm-config reports no shared
library, and 6d6159b's fallback to the llvm-config on PATH then rejected
the system LLVM 23 because its major differs from the ROCm headers, so a
fresh configure failed (issue #1).
Before find_package, keep LLVM_DIR only if the llvm-config next to it
reports a shared library; otherwise, or when LLVM_DIR is unset, use the
llvm-config on PATH that does and take its --cmakedir. A working pinned
LLVM_DIR is left alone.
Checked with a fake ROCm prefix on PATH: plain find_package picks it;
the new code picks /usr/lib/cmake/llvm (LLVM 23) on a fresh configure,
replaces a cached ROCm LLVM_DIR, and keeps a working cached
/usr/lib64/cmake/llvm. A standalone configure of Indium with the fake
ROCm on PATH completes with the system LLVM.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Indium and QuartzCore took the first memory type a resource allowed. The
Vulkan spec orders a type with no flags before every DEVICE_LOCAL type,
and NVIDIA exposes such system-RAM types, so on NVIDIA private buffers,
textures and framebufferOnly drawables could land in system RAM. They
now take the first allowed DEVICE_LOCAL type and fall back to the old
choice; shared and managed resources are unchanged.
The drawable's exported image is a dedicated Vulkan allocation, but the
OpenGL import never set GL_DEDICATED_MEMORY_OBJECT_EXT, which
EXT_external_objects requires. Mesa ignores it; it is the suspected
cause of the black screen on NVIDIA in issue #3. The import's GL errors
were never checked (reportGLErrors is compiled out), so a failure was
silent.
/tmp/metal-device.log now lists the selected device's memory heaps and
types, the memory type chosen per resource kind (with the old choice and
changed=yes/no), and the result of the first drawable and semaphore
imports into OpenGL (later ones only on failure).
Practice match on the RX 6600: all choices changed=no, import
dedicated=yes with no GL errors, semaphore ok, match=yes. Not run on
NVIDIA.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A leftover LLVM_DIR can point at a removed LLVM whose llvm-config exists
but whose library is gone, which made configure fail on LLVM 23 hosts.
Try the tools-dir llvm-config, then the one on PATH, and accept only one
that matches the header major and reports a shared library.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
On a hybrid laptop (issue #3) Indium took whichever Vulkan device the
loader listed first, usually the integrated GPU, and still created a
VkDevice on every other supported GPU, waking a discrete GPU it never
used. Drawables reach the presenting OpenGL context as opaque FDs, which
only work on one physical device, and nothing checked that.
Indium now appends the device list, the selected device and the reason
to guest /tmp/metal-device.log, and creates a VkDevice for the selected
device only (/tmp/metal-all-devices restores the old behaviour).
/tmp/metal-gpu or METAL_INDIUM_GPU selects a device by index or name
for diagnosis. QuartzCore logs the presenting GL renderer and compares
its device UUID with the Vulkan device's (match=yes / MISMATCH); it
queries Vulkan itself, so it needs no new libindium export.
On the RX 6600 desktop the game selected RADV, created 1 VkDevice of 2
supported (lavapipe no longer gets one) and logged match=yes in a match.
Running on NVIDIA through prime-run is documented but not validated.
Co-Authored-By: Claude Opus 5.5 <[email protected]>