feat(overlay): add position customization for overlay placement

- Introduce PositionX and PositionY fields in OverlaySettings to allow manual positioning of the overlay.
- Update validation to ensure PositionX and PositionY are not less than -1.
- Modify diskConfig to include new position fields for JSON serialization.
- Implement functionality to save overlay position during drag events in the GUI.
- Enhance overlay placement logic to respect user-defined positions while ensuring proper display behavior.
This commit is contained in:
2026-07-17 19:55:00 +03:00
parent 41867429a5
commit 5b4a0d0785
6 changed files with 313 additions and 70 deletions
+11 -6
View File
@@ -15,13 +15,18 @@ cd -- "$repo_root"
# Avoid host/container DMABUF incompatibilities on mismatched GPU stacks. An
# explicit GTK renderer choice still takes precedence.
export GSK_RENDERER="${GSK_RENDERER:-cairo}"
# gtk4-layer-shell must load before libwayland-client or its Wayland shim is
# skipped and the overlay sits as an unpositioned normal window.
layer_shell_lib="$(pkg-config --variable=libdir gtk4-layer-shell-0)/libgtk4-layer-shell.so.0"
if [[ -f "$layer_shell_lib" ]]; then
export LD_PRELOAD="${layer_shell_lib}${LD_PRELOAD:+:$LD_PRELOAD}"
fi
# gtk4-layer-shell must precede libwayland-client in the link line. Do NOT
# LD_PRELOAD it here: the shim breaks the main GtkApplication window on
# Wayland when forced onto the whole process.
export CGO_LDFLAGS="-Wl,--no-as-needed -lgtk4-layer-shell ${CGO_LDFLAGS:-}"
desktop_bin=build/captioneer-desktop
if [[ -x "$desktop_bin" ]]; then
printf "captioneer: launching %s\\n" "$desktop_bin" >&2
exec "./$desktop_bin" "$@"
fi
printf "captioneer: no build/captioneer-desktop yet; compiling with go run (first launch is slow)\\n" >&2
exec go run -tags gtk ./src/cmd/captioneer-desktop "$@"'
exec distrobox enter --no-workdir --name "$container_name" -- \