Repository navigation
Linux: drag and drop, pinch, IME placement and clauses, slash key, sharp cursors and the channel icon - #435
Merged
Merged
Conversation
…pped SLURL teleports SDL_EVENT_DROP_TEXT was thrown away, so dragging a SLURL or a URL onto the viewer did nothing on Linux and macOS. Its lines are now gathered and, on DROP_COMPLETE, sent through handleDragNDrop as DNDT_DEFAULT with the same start, drop and stop steps as files, which is how Win32 hands over CF_TEXT: a spatial SLURL teleports and a URL dropped on a face becomes its media. File drops are unchanged. There is still no live tracking. SDL reports where a drag is (DROP_POSITION), but every backend reads what it carries only at the drop, and the viewer's hover feedback depends on what is carried, so DROP_POSITION is left alone with a note saying why. A browser's link drag still delivers nothing on Linux: SDL 3.4.18's Wayland and X11 backends take its text/uri-list and discard every entry that is not a local file. Dragged text works there, and links work on macOS. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018TgkpVXucG17x8kCrsXMjy
SDL 3.4 reports a touchpad pinch (Wayland's pointer gestures, XInput 2.4's, Cocoa's magnify) as SDL_EVENT_PINCH_*, and nothing handled them, so pinching did nothing. A Windows precision touchpad delivers a pinch as Control+wheel. The pinch now reaches the viewer the same way: wheel clicks at the cursor with Control held for the call, a click for every quarter octave of spread, which is the camera orbit's own step, with the fractions gathered so a slow pinch still makes its clicks. Spreading the fingers is a wheel rolled away, zooming in. SDL documents the scale as the change since the last update, and Cocoa sends that, but its Wayland and X11 backends pass on the scale since the gesture began, as their protocols carry it, so on those the ratio to the last update is taken. As on Windows, in the default third-person view Control+wheel raises or lowers the camera rather than zooming it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018TgkpVXucG17x8kCrsXMjy
…ry other text view On SDL the text input area reached the IME only from LLLineEditor's and LLTextBase's draws, through setLanguageTextInput. ALTextView only allowed language input, so in Script Studio and the other ALTextView editors the candidate window opened wherever the last line editor had left the area, or at the window's origin. A bare caret also always took the 500x16 fallback, since every preeditor gives it bounds with no width. The backend now asks the owning preeditor where its caret and preedit are (placeLanguageTextInputArea, also the updateLanguageTextInputArea override) when a widget takes language input, after every composition update, as Win32 does after WM_IME_COMPOSITION, and from setLanguageTextInput. Bounds of no width are taken. ALTextView reports its caret from its draw, as the text fields do, while it holds language input and the caret is in sight. Its preedit bounds now lie on the caret's row when a composition wraps, rather than on its first row. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018TgkpVXucG17x8kCrsXMjy
…n on SDL The SDL backend handed every composition to the preeditor as one plain segment and read event.edit.start as the caret alone, so the clause a Japanese or Chinese input method was converting looked like the rest of the preedit. SDL marks that clause with start and length, in characters, from the highlight ibus, fcitx, XIM, text-input-v3 and Cocoa report. The composition is now split into what comes before the clause, the clause marked standout, and what comes after, as the Win32 backend does with its target clause; the editors draw a standout segment with the thicker underline. The caret goes to the clause's start, where the candidate window belongs, or to the IME's caret when there is no clause. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018TgkpVXucG17x8kCrsXMjy
…e keypad's is Divide LLKeyboardSDL translated SDLK_SLASH to KEY_DIVIDE, the keypad's code, so the main-row slash fired the start_gesture binding DIVIDE has in key_bindings.xml: a / pressed in world, or with anything but a text field focused, opened the chat bar with a slash, which on Windows only the keypad's does. LL mapped VK_OEM_2 to '/' there for EXT-3650, and SDL now does the same; the keypad's slash stays KEY_DIVIDE and keeps start_gesture. The inverse map gives SDLK_KP_DIVIDE for KEY_DIVIDE and SDLK_SLASH for '/', and mapSDLtoWin already sent the two keys to plugins as VK_OEM_2 and VK_DIVIDE. alKeyAsBound still reads KEY_DIVIDE as '/', so Script Studio keymaps hear the keypad's slash and keep bindings saved as it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018TgkpVXucG17x8kCrsXMjy
…from Alt-Tab on SDL The SDL backend forgot its preeditor whenever the window lost focus, on the belief that the focus manager clears keyboard focus then. It does not: setAppHasFocus leaves the field focused, and no editor allows language input again when the window returns, so every TEXT_EDITING was dropped and an input method composed blind, its text arriving only on commit, until the field was focused anew. The preeditor is kept now, as on Win32, and only a composition in flight is reset: SDL stops text input with the focus, and what the IME does with it after never reaches the window, so it would have stayed in the text. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018TgkpVXucG17x8kCrsXMjy
res-sdl/ held sixteen BMP cursors nothing reads: arrow, circleandline, cross, hand, ibeam, llarrow, llarrowdrag, the five size* cursors, toolpickobject, toolpickobject2, wait and working. The SDL window takes the arrow, hand, I-beam, crosshair, resize, wait and working cursors from the system theme, and LLWindowSDL::initCursors names none of the others, yet the Linux tree shipped them all. They are removed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018TgkpVXucG17x8kCrsXMjy
The tool cursors were 32x32 BMPs keyed on (200,200,200). The anti-aliased ones (sit, buy, open) had edge pixels blended against that grey, which the key missed, so they wore a dark stair-stepped halo; and one 32-pixel image was all there was, so a Wayland compositor at 200% scaled it up blurred, and an X11 HiDPI desktop showed it half the size of the theme's cursors. Each cursor is now an RGBA PNG in res-sdl/, loaded with SDL_LoadPNG. Most come from the Windows .cur, which is the same art as the BMP, pixel for pixel, or for sit, buy and open the same art with its real alpha. toolplay takes the .cur's boxed play button, as pause and media-open have, over the BMP's older dithered triangle; toolpickobject3 keeps the BMP's own drawing, which is black and white only. The hot-spots are the ones the BMPs were loaded with. Under Wayland each cursor carries 2x and 3x nearest-neighbour copies as alternate images, which SDL picks among by the window's scale; under X11, where SDL sends only the surface itself, the surface is scaled to XCURSOR_SIZE over 24, or failing that to the display's content scale. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018TgkpVXucG17x8kCrsXMjy
The window icon was res-sdl/ll_icon.BMP, the channel's 256 BMP with an opaque magenta (#FF00F6) border meant to be keyed out, which nothing did, so X11 title bars and taskbars and KDE's Wayland showed the icon in a magenta frame. The window now takes the hicolor PNGs the tree installs for its desktop entry, share/icons/hicolor/<size>/apps/<app ID>.png, found from the read-only data dir and the app ID SDL was given: the 256 as the icon, as before, and the 512 as its 2x. SDL sends X11 only the icon itself and Wayland only alternates at whole multiples of it, so the smaller sizes are not loaded. A tree without them keeps the desktop's default icon. macOS still leaves the window icon alone, since SDL would set the Dock's over the bundle's. Nothing reads ll_icon.BMP any more, in res-sdl/ or, on Windows, in res/, whose resource script embeds only ll_icon.ico, so neither is copied from the branding package, and the Linux tree installs only the cursor PNGs from res-sdl/, leaving out a copy an older configure left there. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018TgkpVXucG17x8kCrsXMjy
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes for the input items left from the Linux port audit: drag and drop, touchpad pinch, the IME, the slash key, cursors and the window icon. Nine commits, one change each.
Drag and drop, and pinch
DNDT_DEFAULT, as Win32'sCF_TEXTdoes. A dropped SLURL teleports, and a URL dropped on a face you can modify becomes its media. File drops are unchanged.DNDA_TRACK. SDL reads what a drag carries only at the drop, on every backend, and the viewer's hover feedback depends on that payload. TheDROP_POSITIONcase says so.IME and keyboard
ALTextView.updateLanguageTextInputArea().allowLanguageTextInput(true), after everyTEXT_EDITING, and fromALTextView::draw, asLLTextBaseandLLLineEditoralready do.start/lengthare honoured as characters, and the caret goes to the clause./is'/'on Linux and macOS, asVK_OEM_2is on Windows. Only the keypad's isKEY_DIVIDE, which keeps thestart_gesturebinding.Cursors and icon
.curfiles and are pixel-identical to the old BMPs. Sit, buy and open lose their grey halos.<tree>/share/icons, in place ofll_icon.BMPand its magenta frame. macOS is untouched, since thereSDL_SetWindowIconwould replace the Dock icon.Related Issues
Issue Link: none. These are the input items from the review of the Linux port's integration and desktop support.
Checklist
Additional Notes
Behaviour changes to weigh
/no longer opens the chat bar with "/" in-world, matching Windows. The keypad/still does. A default/binding would change Windows too, so none was added.CameraOffsetRearView) rather than zooming, because that is what Ctrl+wheel does there. This matches a Windows precision touchpad..curand TIFF. The old BMP was a different, older drawing.Needs an SDL patch (vcpkg registry): a link dragged from a browser still drops nothing on Linux.
text/uri-list, and drop every entry that isn'tfile://, with no fallback toDROP_TEXT. Dragged plain text, such as a selected SLURL, works.SDL_waylandevents.c,data_device_handle_enter/handle_drop, and inSDL_x11events.c,SelectionNotify. Send a non-file URI asSDL_SendDropTextrather than skipping it, and don't let a text MIME type override the uri-list on enter.Tested on Fedora 44, GCC, Release, GNOME Wayland and XWayland:
-Werror..tar.xzextracted and started through itsalchemywrapper._NET_WM_ICONandWM_CLASSorg.alchemyviewer.viewer.test.Not tested:
🤖 Generated with Claude Code
https://claude.ai/code/session_018TgkpVXucG17x8kCrsXMjy