Commit Graph
69 Commits
Author SHA1 Message Date
nbandKalah 0a9a75e820 fix(appkit): add NSSavePanel tag-name compatibility (#112)
Co-authored-by: Kalah <[email protected]>
2026-10-20 12:24:10 +02:00
lucannez64 791d4ad74e Keep the merged X11 patch in canonical diff format 2026-10-19 13:00:24 +02:00
lucannez64 ff8a985057 Merge current main into the tested VSync and VRR fixes 2026-10-19 12:59:58 +02:00
lucannez64 6bfdfbcac7 Merge VSync and VRR fixes for combined testing 2026-10-19 12:15:09 +02:00
lucannez64andClaude Sonnet 5.5 ee322b43e1 Make NSOpenPanel Open/Cancel always end the modal session
Open with no row selected passed nil to -_setFilename:, and NSOpenPanel boxed it in an
array literal, so the action threw before the modal session was stopped and the panel
stayed up. Both buttons now go through one helper that stops the session only when
this panel is the modal window and always orders the panel out; Open accepts the
selection (filtered by canChooseFiles/canChooseDirectories and multiple-selection),
or the shown directory for directory choosers. Escape cancels.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-19 08:49:04 +02:00
lucannez64andClaude Sonnet 5.5 84e39e3b48 Keep hidden X11 windows unmapped
Restack and makeKey no longer map a window AppKit considers hidden, and
setIsVisible: NO always unmaps, so the client's splash stays hidden.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-19 08:00:41 +02:00
Kalah 8fc7d4dff3 Merge branch 'main' into fix/cocoa-window-decorations 2026-10-19 07:40:37 +02:00
lucannez64 041591352e Present full-window Metal layers on the managed X11 surface for VRR 2026-10-19 07:35:16 +02:00
ekisu 8f97990d03 Implement Cocoa local event monitors for native client dragging 2026-10-19 01:15:03 -03:00
ekisu 41da6d9e0a Fix X11 decorations for client-drawn Cocoa windows
Synchronize Motif decoration hints on style and titlebar-property changes, including native-window recreation and restoring ordinary WM decorations. Add a ten-case standalone Cocoa/X11 regression probe and document validation on KWin/Xwayland.
2026-10-18 21:06:22 -03:00
lucannez64 27553d8874 Fix Metal VSync propagation to window swap intervals 2026-10-19 01:10:03 +02:00
lucannez64andClaude Opus 5.5 662b3d414f X11: take modifier masks from the server's modifier map
Right Alt (keycode 108) was hard-coded as Mod5/AltGr. On layouts where it
is Mod1, the swallowed-release reconcile accepted Mod1 as held but rebuilt
the state with Mod5, so the guest could see Option and Function together.
Read the per-key masks from XGetModifierMapping (refreshed on
MappingNotify) and use them everywhere; the old table is the fallback for
unmapped keys. The probe now checks Right Alt against whichever mask the
backend reports.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 23:13:07 +02:00
lucannez64andClaude Opus 5.5 97c0e596bc X11: release modifiers whose release the compositor swallowed
GNOME's overview delivers the Super press to the game window, eats the
release and hands the keyboard back without a FocusOut. The backend kept
Command held, so every later key and click reached the game as a Command
shortcut until a real focus change reconciled it (issue #74).

Each key, button, motion and crossing event carries the server's modifier
state; release any modifier key we track as down whose modifier is missing
from it. Synthetic events from other clients are ignored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 23:03:23 +02:00
Kalah 4ff2f11c26 Merge branch 'main' into fix/x11-transparent-windows 2026-10-18 20:56:29 +02:00
Polar 34525593da X11: alpha visual for transparent windows, float translucent splashes
Riot's splash screens draw on a black rectangle: LeagueClient's is a
borderless NSWindow with setOpaque:NO and a pattern-image background, the
Riot Client's an Electron BrowserWindow with transparent: true. X11Window
created every window with a 24-bit visual and -setOpaque: only stored the
flag, so there was no alpha channel.

A non-opaque window whose background can show through (alpha below 1, or a
pattern image) now gets the 32-bit ARGB visual. League's game window is
non-opaque on an opaque background and stays on the opaque visual, which
X11IsLeagueGameWindow also enforces. The X window exists before apps set
opacity and background, so the choice is checked again when the first
subwindow is created (layer subwindows inherit the visual) and before the
first map, and the window recreated while unmapped if it changed. Its
background is transparent instead of None, so no black frame shows before
the first draw. Its surface comes from an alpha EGL config for that visual
(CGLGetWindowWithAlpha) and its compositing context from the surface's
config (CGLCreateContextForWindow): NVIDIA refuses the default config on a
32-bit window, and no driver makes a context from it current on the alpha
surface. Without an alpha config the window falls back to the opaque
visual.

A translucent window above the normal level (Electron's alwaysOnTop
splash) is typed _NET_WM_WINDOW_TYPE_SPLASH with _NET_WM_STATE_ABOVE before
it is mapped: window managers float it and draw no frame around it.
Electron's level never arrived, though: CGWindowLevelForKey returned the
normal level for every key, and the SDK turns NSFloatingWindowLevel into a
call to it. It now returns the levels macOS does; Cocotron only stores
levels, so nothing else changes.
2026-10-18 17:49:10 +00:00
Polar 10bf217915 AppKit: retain the drag destination and its window during a local drag
The drag loop runs run loop sources and main queue blocks between moves,
and Chromium can tear down a web view or close a window there. Hold both
until the drag ends, after -draggedImage:endedAt:operation:.
2026-10-18 16:08:26 +00:00
Polar d77fd9bffa AppKit: run drags in-process when the backend has no drag manager
The X11 backend has no NSDraggingManager, so -[NSWindow dragImage:...]
returned at once without calling -draggedImage:endedAt:operation:.
Chromium waits for that callback before the page takes mouse input again,
so any HTML5 drag in a CEF/Electron window (the League client's emote
wheel) left the page ignoring the mouse.

NSWindow now runs the drag itself between the app's own windows, with the
drag image under the pointer, and always ends it with the callback.
X11Pasteboard sends the optional -pasteboardChangedOwner: only to owners
that implement it (Chromium's drag source doesn't; the second drag
crashed). NSView's default -prepareForDragOperation: returns YES, as
AppKit does for destinations that don't implement it.
2026-10-18 14:54:46 +00:00
lucannez64 b18726cfe3 Merge remote-tracking branch 'origin/main' into fix/pr54-update 2026-10-18 14:02:24 +02:00
lucannez64andPirrandi dceee00d10 fix(nvidia): retain readback, resize and bounded completion fixes
Rebuild the remaining NVIDIA changes on current main, preserving the merged visual, draw-buffer, descriptor ownership and mixed Metal-tree fixes. Scope native-thread forwarding to resize notifications and make completion polling per device, bounded and part of the caller timeout budget.

Co-authored-by: Pirrandi <[email protected]>
2026-10-18 13:59:49 +02:00
Hamza JermouniandClaude Opus 5.5 b08acd17a4 Implement CTFontCopyLocalizedName with the canonical name
The stub returned nil and left the language output untouched. Chromium
pre-fills that output with a sentinel and reads it whenever it is
non-NULL, so the League client UI read garbage. Return CTFontCopyName
and always write NULL to the language output. The CoreText font-list
check now covers both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 12:28:12 +02:00
lucannez64 2b0e18010b Test merge #37 2026-10-17 20:36:55 +02:00
lucannez64 9c112e44d0 Test merge #32 2026-10-17 20:36:54 +02:00
lucannez64andClaude Opus 5.5 03d88631df Merge PR #22 NVIDIA black screen fix onto #20 compositor changes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 20:28:58 +02:00
ztancrellandClaude Opus 5.5 e4fd017e1f Return a valid NSScroller preferredScrollerStyle
The unimplemented method returned whatever was left in a register.
Chromium forwards the style to its renderer, which rejected the
out-of-range value (VALIDATION_ERROR_DESERIALIZATION_FAILED) and left
the Riot Client window black. Report NSScrollerStyleLegacy, as macOS
does without a trackpad.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 08:20:34 -04:00
ztancrellandClaude Opus 5.5 4b5144a31d Fix Riot Client crashes on sign-in buttons and file dialogs
The Riot Client (Electron) aborted with unrecognized selectors in
Cocotron's AppKit:

- -[NSOpenPanel setShowsTagField:]: Electron sets it on every file
  dialog. Add the missing NSSavePanel setters it uses (showsTagField,
  nameFieldLabel, extensionHidden, canSelectHiddenExtension) as no-ops,
  and implement beginWithCompletionHandler: and
  beginSheetModalForWindow:completionHandler: by running the panel
  modally and calling the handler (the old stub never called it).
- -[MacWorkspace openURLs:withAppBundleIdentifier:options:
  additionalEventParamDescriptor:launchIdentifiers:]: used by
  shell.openExternal for the third-party sign-in buttons. Open each URL
  through openURL: (LaunchServices).

Fixes #28

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 07:59:09 -04:00
Polar e581a8196b Point the layer compositor's GL context at the window's back buffer
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.
2026-10-17 00:14:31 +00:00
Polar 8af92993be Create X11 windows with an EGL-compatible visual (NVIDIA black screen)
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.
2026-10-17 00:14:31 +00:00
lucannez64 fc57385c68 Keep Metal presentation active in mixed IOSurface layer trees 2026-10-17 01:06:50 +02:00
lucannez64 698d295b6d Merge PR #18 visible-cursor tracking with serial-aware mouse warps 2026-10-17 00:26:47 +02:00
lucannez64 44faf79bd8 Merge PR #15 fullscreen transitions with runtime review fixes 2026-10-17 00:26:09 +02:00
lucannez64 6c742155e9 Fix runtime safety, Xorg mouse synchronization and fullscreen startup 2026-10-17 00:25:34 +02:00
DevWebeloperandClaude Opus 5.5 8c01fe1547 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 603b310b6f 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 bd111a5ddc 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 9d2c23b737 fix(launcher,display): fix desktop launcher icon, Alt-Tab grab, and 144Hz camera panning 2026-10-16 20:21:58 +02:00
Andras Laszlo 4055f314e9 cocotron: avoid dropping relative motion events and warp echoes during coalescing 2026-10-16 19:47:12 +02:00
Andras Laszlo 0e2a2dde61 Address code review feedback on input handling, pacing, and runtime cleanup 2026-10-16 17:50:22 +02:00
Andras Laszlo d981cbe8c3 Fix in-game keyboard input, initial fullscreen black screen, and desktop launcher icon 2026-10-16 17:40:51 +02:00
Andras Laszlo 4699618e9f Sync patches/cocotron.patch with submodule mywork 2026-10-16 17:17:31 +02:00
Andras Laszlo d8b1eaf23c Merge upstream/main into main 2026-10-16 17:16:20 +02:00
Andras Laszlo 49919d03c9 cocotron: Fix initial fullscreen black screen and camera panning stutter on Wayland 2026-10-16 17:15:43 +02:00
lucannez64 ed9cc8310a 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 b1b97e4d1d Handle EDID DTV aspect ratios in physical display size 2026-10-16 16:57:55 +02:00
Andras Laszlo 7815feb542 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 4f7916370a 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 10a864d5cb QuartzCore/CAMetalLayer: Fix nextDrawable deadlock preventing Metal in-game rendering 2026-10-16 16:29:48 +02:00
Andras Laszlo 5e5636de22 Merge upstream d89a303: primary monitor geometry coordinates with Wayland fullscreen and mouse confinement fixes 2026-10-16 16:16:02 +02:00
Andras Laszlo 015aa5c6fb 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 d89a303ebe 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 a9b68485e7 Merge upstream changes: relative mouse mode emulation and skip redundant cursor updates 2026-10-16 15:48:29 +02:00