From e566477c350a80f9666b93ab0d991ad14f06df91 Mon Sep 17 00:00:00 2001 From: diviocity Date: Sat, 31 Oct 2026 22:25:35 +0100 Subject: [PATCH] fix findings: frame leak, option replies, hit-tests Seek-preview frames - Each run writes its frames to /vendetta-thumbs-, one file per capture. The frame a capture replaces is deleted, and so is the frame on show when the file changes or closes, or the preview is turned off. Exit removes the directory. Option writes - The Set option dialog, presets and unset use async writes. Their SET_PROPERTY_REPLY is matched in option_written, so a rejection is still reported, and the dialog stays open on one. - Start-up writes stay synchronous. - Reply ids are reserved and documented in player.v. MPRIS SetPosition moves from 71 to 74 and playlist-shuffle from 84 to 85. Loadfile appends count up from loadfile_base. Hit-tests and wheel - main_area is the rect the player lays out in. The seek-preview hit test and the popup clamp use it. - over_panel covers the side panels and the statistics popup. The wheel tests it at the tracked pointer, since on_wheel passes scroll deltas and the old checks never fired. pointer_over_video uses it for the right-click hit test. Over the queue or the statistics popup, the wheel no longer changes volume. Other - Remove the dead pl_ playlist branch - save_settings skips the write when the text is unchanged. Drop the clone in emit_properties_changed and the _ = value in the Shuffle branch - The macOS comment in draw.v matches sokol's Windows default, and the font README points at ui2's README for font overrides. - host_chrome's run command is corrected. embed_host and host_proto exit with a message when assets/video/test.mp4 is missing. --- assets/fonts/README.md | 6 +-- examples/embed_host/README.md | 3 ++ examples/embed_host/main.v | 7 +++ examples/host_chrome/README.md | 6 ++- examples/host_chrome/main.v | 5 +- examples/host_proto/main.v | 7 +++ libvendetta/draw.v | 5 +- libvendetta/mpv/mpv.v | 7 +++ src/main.v | 7 ++- src/media.v | 44 ++++++++++++++---- src/mpris_d_mpris.v | 27 ++++++----- src/mpris_glue_d_mpris.v | 4 +- src/player.v | 84 +++++++++++++++++----------------- src/presets.v | 25 +++++----- src/settings.v | 77 +++++++++++++++++++++++++++---- src/view.v | 53 +++++++++++++++++---- 16 files changed, 258 insertions(+), 109 deletions(-) diff --git a/assets/fonts/README.md b/assets/fonts/README.md index 897c13c..7147633 100644 --- a/assets/fonts/README.md +++ b/assets/fonts/README.md @@ -11,9 +11,9 @@ and Noto Emoji 3.002 from [google/fonts](https://github.com/google/fonts/tree/main/ofl/notoemoji). The custom renderer draws with these files unless the application overrides them -(see "Fonts and text sizes" in the top-level README), so a `gg` window looks the -same on Linux, the BSDs, Android, and macOS or Windows built with -`-d ui2_custom_rendering`. +(see "Fonts and text sizes" in the ui2 README, which ships with the ui2 module), +so a `gg` window looks the same on Linux, the BSDs, Android, and macOS or Windows +built with `-d ui2_custom_rendering`. `RobotoMono-Regular.ttf` has to keep that name and stay in this directory: gg finds its mono face by rewriting `-Regular` to `Mono-Regular` in the path it was diff --git a/examples/embed_host/README.md b/examples/embed_host/README.md index 6d945bb..0271e7c 100644 --- a/examples/embed_host/README.md +++ b/examples/embed_host/README.md @@ -4,6 +4,9 @@ The minimal embed: one window, the widget, and the forwarding the widget needs. Every control — the hover control box, the seek bar, volume — is the widget's own; this file adds no chrome of its own. +The repository does not ship a clip: put any video at `assets/video/test.mp4` +first. Without one the example exits with a message. + cd ~/Projects/vendetta v run examples/embed_host/main.v diff --git a/examples/embed_host/main.v b/examples/embed_host/main.v index 808837b..5447f96 100644 --- a/examples/embed_host/main.v +++ b/examples/embed_host/main.v @@ -1,10 +1,17 @@ import libvendetta +import os import ui2 // A browser-style