Skip to content

Bug fixes from a downstream fork: want these as PRs? #1090

Description

@criccomini

I've been building a macOS app on floem and have been carrying fixes on the perch branch of my fork (https://github.com/criccomini/floem/tree/perch). Each fix is one commit on top of main, and the commit messages explain the bug and the fix in detail. Most come with a headless test.

Two are already open as PRs (#1087, #1088). I'm happy to open PRs for the rest, one per fix or grouped however you'd like. If you don't want some of these upstream, tell me and I'll leave them off.

Crashes

Event dispatch

  • criccomini/floem@7e55da9: Hover events arrive in reverse order, Enter before Leave, because flush_pending_events routes newest first. A view that stays under the pointer can also get Enter then Leave and end up with is_hovered false. Hover now has its own queue, routed in order. A view in both the old and new hover path gets neither event. This restores the behavior from before Box tree event #1033.
  • criccomini/floem@8a763ea: FocusGained arrives before FocusLost. Moving focus from one text box to another leaves IME off in the box that now has focus.
  • criccomini/floem@aad05d3: A drop target that hangs outside its parent gets DragTargetLeave followed by DragTargetEnter when the pointer crosses the parent's edge, even though the pointer never left the target.
  • criccomini/floem@cf49243 + criccomini/floem@5cbdfc9 (test): handle_pointer_state_updates declares its own START_TIME static, so presses and releases are timed on different clocks. That breaks the 100ms cross-view click check.
  • criccomini/floem@13a21f4: On macOS, Control+click is reported as a left click. Every native app treats it as a secondary click.

Editor / text input

  • criccomini/floem@ae9a97c: A double click selects only up to where you clicked, because the pointer move macOS sends before the release drags the selection end back. A drag after a double or triple click now extends by word or by line.
  • criccomini/floem@8a1d5ab: Alt+arrow moves the cursor by a word but also runs the default focus navigation, so focus jumps to a neighboring button.
  • criccomini/floem@203af49: The editor's ensure_visible closure tracks the style signal, so any restyle (hover, resize, theme) scrolls the caret back into view.
  • criccomini/floem@d89ff99: The editor uses is_primary_pointer() to detect a left click. That checks the pointer device, not the button, so a right press collapses the selection and leaves the editor in drag mode after a context menu closes.

Layout

vger renderer

  • criccomini/floem@b36f64a: vger has a single scissor, and clear_clip removes all clipping. After the first clipped child, the rest of a scroll's content paints outside the viewport. Clips now go on a stack, as in the tiny-skia and skia renderers.
  • criccomini/floem@376ba68: Glyphs are rasterized at the fractional position of whichever draw asks first, with y inverted and negative fractions mishandled. Letters in one word end up at two heights. The baseline is now rounded and each quarter-pixel bin is rasterized the same way every time.
  • criccomini/floem@8526b9e: The glyph cache is keyed on the blob id only, so faces in one .ttc, and a variable font at different weights, share glyphs.
  • criccomini/floem@8346821: swash works out the outline's winding across all contours at once, so faux bold thins glyphs whose first contour is small (SF Mono's i, about 90 other glyphs in SF Mono, some in SF Pro and Fira Sans). This commit does the embolden itself, with FreeType's per-contour winding.

Other

  • criccomini/floem@70364c5: ShowBarsWhenIdle = false hides the scrollbars permanently. It now shows them while scrolling or hovering and fades them out afterward, as the docs describe.
  • criccomini/floem@3c23067 (feature): Sets the opsz variation axis to the font size, like CSS font-optical-sizing: auto. Without it, SF Pro renders its display cut at 12–16px.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions