Commit Graph
42 Commits
Author SHA1 Message Date
lucannez64 2aac45d68d Keep Metal presentation active in mixed IOSurface layer trees 2026-10-17 01:06:50 +02:00
lucannez64 e9753b3623 Merge PR #18 visible-cursor tracking with serial-aware mouse warps 2026-10-17 00:26:47 +02:00
lucannez64 ce85298c0e Merge PR #15 fullscreen transitions with runtime review fixes 2026-10-17 00:26:09 +02:00
lucannez64 3db7115c93 Fix runtime safety, Xorg mouse synchronization and fullscreen startup 2026-10-17 00:25:34 +02:00
DevWebeloperandClaude Opus 5.5 adf74bf726 Keep the relative-mode cursor on the visible pointer when warps are not honoured
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]>
2026-10-17 00:49:53 +03:00
Andras Laszlo 204dd6c5ad fix(input): eliminate motion warp feedback loop, fix fullscreen promotion, and restore camera edge panning 2026-10-16 20:58:43 +02:00
Andras Laszlo e9e9da1187 fix(input,video): restore click accuracy, prevent Alt-Tab focus steal, and eliminate 144Hz display link stutter 2026-10-16 20:38:32 +02:00
Andras Laszlo 5f494fd450 fix(launcher,display): fix desktop launcher icon, Alt-Tab grab, and 144Hz camera panning 2026-10-16 20:21:58 +02:00
Andras Laszlo aca9b1561a cocotron: avoid dropping relative motion events and warp echoes during coalescing 2026-10-16 19:47:12 +02:00
Andras Laszlo a73086de74 Address code review feedback on input handling, pacing, and runtime cleanup 2026-10-16 17:50:22 +02:00
Andras Laszlo 2759adbdd9 Fix in-game keyboard input, initial fullscreen black screen, and desktop launcher icon 2026-10-16 17:40:51 +02:00
Andras Laszlo c90c603f4a Sync patches/cocotron.patch with submodule mywork 2026-10-16 17:17:31 +02:00
Andras Laszlo 44fc9d6111 Merge upstream/main into main 2026-10-16 17:16:20 +02:00
Andras Laszlo 1f2a467855 cocotron: Fix initial fullscreen black screen and camera panning stutter on Wayland 2026-10-16 17:15:43 +02:00
lucannez64 3778d518b7 Restore X11 fullscreen requests for monitor-sized borderless windows
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.
2026-10-16 17:13:11 +02:00
lucannez64 3255fb064e Handle EDID DTV aspect ratios in physical display size 2026-10-16 16:57:55 +02:00
Andras Laszlo 30383d6462 AppKit/X11: Robust multi-monitor mouse boundary confinement and clean stale Darling/Riot state 2026-10-16 16:55:22 +02:00
ztancrellandClaude Opus 5.5 7af99c85db Return a real physical size from CGDisplayScreenSize; never return NULL display modes
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]>
2026-10-16 10:44:04 -04:00
Andras Laszlo 6084371a67 QuartzCore/CAMetalLayer: Fix nextDrawable deadlock preventing Metal in-game rendering 2026-10-16 16:29:48 +02:00
Andras Laszlo 6e6b0d826a Merge upstream 7f0e57f: primary monitor geometry coordinates with Wayland fullscreen and mouse confinement fixes 2026-10-16 16:16:02 +02:00
Andras Laszlo 5c10b470c1 Fix black screen in Riot Client launcher and strictly confine mouse only for League in-game 2026-10-16 16:01:25 +02:00
lucannez64andMaka 7f0e57fb5e Fix X11 primary-monitor coordinates without changing fullscreen policy
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]>
2026-10-16 15:52:42 +02:00
Andras Laszlo 447324f232 Merge upstream changes: relative mouse mode emulation and skip redundant cursor updates 2026-10-16 15:48:29 +02:00
Andras Laszlo 6718077217 Fix GNOME 51 Wayland fullscreen, mouse confinement and top bar / dock popup 2026-10-16 15:18:04 +02:00
lucannez64andClaude Opus 5.5 426fb75ec8 Emulate macOS relative mouse mode in the X11 backend and skip redundant cursor updates
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]>
2026-10-16 15:14:06 +02:00
Andras Laszlo 92d724f736 Fix GNOME Wayland fullscreen top bar and mouse confinement in cocotron 2026-10-16 14:34:09 +02:00
Andras Laszlo f0f449c3c2 Merge upstream changes: nested Metal layers and X11 cursor XFlush 2026-10-16 14:07:29 +02:00
Andras Laszlo e4f8c67151 WIP: Low-latency performance and input latency optimizations 2026-10-16 14:05:54 +02:00
lucannez64 47e91fb7be Prepare nested Metal layers before compositing
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.
2026-10-16 13:55:09 +02:00
lucannez64 8092e3109b Avoid blocking X11 cursor updates on a server round trip 2026-10-16 13:44:11 +02:00
lucannez64andClaude Sonnet 5.5 68f816deaf Use optimal tiling for the drawable GL import on NVIDIA
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]>
2026-10-16 11:16:53 +02:00
lucannez64andClaude Sonnet 5.5 ac6e81aa4a Implement flashWindow in the X11 backend so attention requests don't abort the UX
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]>
2026-10-16 10:17:29 +02:00
lucannez64andClaude Opus 5.5 197b794111 Allocate League's Metal drawables in VRAM
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]>
2026-10-16 02:17:51 +02:00
lucannez64andClaude Opus 5.5 1c30c99e51 Prefer VRAM for GPU-only Metal memory and mark the GL import dedicated
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]>
2026-10-16 02:04:43 +02:00
lucannez64andClaude Opus 5.5 5a5a8c4022 Log the Metal GPU and create a Vulkan device only for it
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]>
2026-10-16 00:24:58 +02:00
lucannez64 7d3905f373 Fix League client resizing and runtime compatibility
Fix X11 presentation handoff after resizing, preserve NSView size callbacks, and correct content and backing-layer geometry. Add CoreText font enumeration for the language dropdown and rebuild/install the matching runtime overlays.

Correct CarbonCore Gestalt version queries and roll back proc_listpids for Vanguard testing. Document that VAN -101 can still recur. Include accumulated CoreAudio stream and AudioUnit corrections.

Add standalone font, version, resize and publisher-handoff regressions. Record manual confirmation of the language dropdown and window resizing; all 29 pinned patches and the source/script audit validate.
2026-10-15 18:44:43 +02:00
lucannez64 63b7d2a139 Implement hidden-until-mouse-moves in the display backend
setHiddenUntilMouseMoves: only hid or showed the cursor, so the flag set
by setHiddenUntilMouseMoves:YES was never cleared when the user moved the
pointer. Track and clear it in NSDisplay instead of NSCursor: add
setCursorHiddenUntilMouseMoves: and pointerMoved to the display, let the
X11 backend report genuine motion (after its synthetic warp filter), and
have NSCursor forward to the display. The idempotency guard keeps the
hide/show state balanced and preserves an explicit [NSCursor hide].
2026-10-15 13:42:27 +02:00
lucannez64 9e8165e056 Fix client window visibility in Darling AppKit, not by patching Electron
Electron 22.3.27's NativeWindowMac::IsVisible() compares the window's
occlusion state for exact equality with NSWindowOcclusionStateVisible:

    bool occluded = [window occlusionState] == NSWindowOcclusionStateVisible;

Apple's contract is a bitmask: an on-screen window's state *includes* that bit
(tested with &). The exact == test is inverted, so an Apple-correct value made
every ordered-in window look occluded and the client's visible/not-minimized
checks failed. The previous workaround byte-patched Riot's shipped Electron
Framework to flip that comparison.

Fix it in Darling's AppKit instead: -[NSWindow occlusionState] now also reports
the reserved 1 << 2 bit for an on-screen window. &-based readers (Electron's own
windowDidChangeOcclusionState:, Chromium) still see NSWindowOcclusionStateVisible
set, while the exact == test is false, so unpatched Electron resolves
IsVisible() correctly. No Riot binary is modified.

Delete tools/patch-riot-electron-visibility.py and its call in
install-riot-gpu-runtime.sh; sync README and docs/STATUS, which already
described the binary patch as excluded.
2026-10-15 12:46:48 +02:00
lucannez64andClaude Opus 5.5 8f62017627 Open web and mail links on the Linux desktop from LaunchServices
LaunchServices now hands http, https and mailto URLs to the host desktop
itself instead of NSWorkspace writing them to a spool that nothing in
the normal workflow drains. It loads the host libsystemd through the ELF
loader and calls xdg-desktop-portal OpenURI on the session bus, falling
back to xdg-open in a transient systemd user unit, so the browser starts
outside Darling's namespaces. LSGetApplicationForURL reports the host
opener for these schemes because Electron checks for a handler before
opening a link. NSWorkspace goes through LSOpenCFURLRef.

Tested with a host-side D-Bus regression (79 checks) and in a fresh
guest prefix through open(1) and NSWorkspace, both reaching the portal
with the exact URL.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 09:58:59 +02:00
lucannez64andClaude Opus 5.5 4027cb9aa7 Make the Indium hand-off changes opt-in and record the Hyprland findings
Two matches with the Indium hand-off round (narrow present wait, deferred
blits, worker-side command-buffer lease, skipping CPU Vulkan devices) ran
slower than before, with more main-thread futex waiting. Each change is now
behind a guest flag file and off by default, so the default libindium matches
the round-3 build (vertex-descriptor dirty masks, cheaper resource setters).

The wait counters stay opt-in, write a "waits enabled" line when they are on
and keep their state per image. The docs explain that flag files created from
the host while Darling runs may stay invisible through the overlay mount.

Also adds a passive cursor watcher. The stuck in-game cursor is Hyprland's
direct scanout, not Darling. The first match with direct scanout off averaged
135 FPS. STATUS, TROUBLESHOOTING and README are updated with the new matches.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 00:29:19 +02:00
lucannez64 5609d96f16 Fix Darling runtime performance and new-PC compatibility
Preserve floating-point arguments in GL resolvers, retain presentation across differently sized windows, export AppKit click and URL fixes, and guard nullable LaunchServices errors. Include compiler/build and installer corrections for the new PC.

Reuse server receive buffers with descriptor-safe exception cleanup and avoid disabled debug-string allocation. Translate Darwin free/reuse memory hints, add atomic server/library installers with separate user-owned memory backups, and preserve active processes until a manual namespace restart.

Remove automatic inspectors, client helpers and forced unlimited UI frames from normal launches. Retain historical hooks with offline mocks and document their exclusion, unresolved installer handoff, activation requirements and unmeasured FPS/RAM benefits.

Validation: all 29 pinned patches apply; all 461 exported source files match; host receive and memory checks, launcher and JavaScript mocks, syntax and documentation-link checks pass. No live client/game was controlled or restarted.
2026-10-13 15:09:23 +02:00
lucannez64 a96cdc62b1 Publish portable Darling runtime patch snapshot and testing tools 2026-10-12 20:15:55 +02:00