Skip to content

Peek2 refactor#1

Open
realcarbonneau wants to merge 4 commits intomainfrom
peek2-refactor
Open

Peek2 refactor#1
realcarbonneau wants to merge 4 commits intomainfrom
peek2-refactor

Conversation

@realcarbonneau
Copy link
Owner

Peek2 refactor

realcarbonneau and others added 4 commits December 30, 2025 14:23
- Add GitHub Actions workflow with build jobs for:
  - Native Vala/Meson build and tests
  - GNOME Flatpak (GTK4, GNOME Platform 46)
  - KDE Flatpak (GTK4 on KDE Platform 6.7)
  - Legacy Flatpak (GTK3, for X11 compatibility)

- Add GTK4/Wayland Flatpak manifest (flatpak-gtk4.yml):
  - Uses xdg-desktop-portal for screen capture
  - Works on both GNOME and KDE Wayland
  - Updated ffmpeg 6.1, gifski 1.14.4

- Add KDE-specific Flatpak manifest (flatpak-kde.yml):
  - Builds GTK4 + libadwaita on KDE runtime
  - Native KDE Wayland support via portal

- Add architecture document (docs/PEEK2_ARCHITECTURE.md):
  - Preview-based UI design (replaces transparent overlay)
  - Portal + PipeWire + GStreamer pipeline design
  - Module structure and migration plan
  - Platform support matrix
New capture module (src/capture/):
- portal-session.vala: xdg-desktop-portal ScreenCast integration
  - Works on GNOME Wayland, KDE Wayland, and X11 via portal abstraction
  - Handles session lifecycle, source selection, PipeWire stream setup
- region.vala: Crop region struct with scaling/clamping utilities

New UI module (src/ui/):
- preview-window.vala: Main GTK4/libadwaita window with live preview
  - Displays PipeWire stream in GtkPicture
  - Source selection, record/stop controls, format dropdown
- crop-overlay.vala: Interactive crop selection widget
  - Draw-to-select with drag handles for resize
  - Semi-transparent overlay outside selection
  - Cursor changes for different drag modes

New encoding module (src/encoding/):
- pipeline.vala: GStreamer pipeline for recording
  - pipewiresrc → videocrop → encoder → filesink
  - WebM (vp9enc), MP4 (x264enc), GIF (frame extraction)
  - gifski integration for high-quality GIF output

Build configuration:
- meson-gtk4.build: New build file for GTK4 dependencies
  - gtk4, libadwaita-1, libportal-gtk4
  - gstreamer-1.0, gstreamer-plugins-base-1.0
- Lower GTK4 requirement to 4.6 (Debian bookworm has 4.8)
- Lower libadwaita requirement to 1.2
- Replace unavailable APIs (FileDialog, AlertDialog, content_fit)
- Fix GVariant building for portal D-Bus calls
- Fix Gdk.RGBA initialization (float vs double)
- Document capture backends: x11grab for X11, portal for Wayland
- Document per-platform prerequisites (minimal for X11, full stack for Wayland)
- Restrict portal to monitor capture only (window capture misses popups)
…ements

- Add CaptureBackend interface with X11GrabBackend and PortalBackend implementations
- X11: FFmpeg x11grab with full desktop or single monitor selection
- Wayland: Portal + PipeWire capture (monitor only, window capture disabled)
- Add monitor dropdown for X11 ("Full Desktop" + individual monitors)
- Improve crop overlay with visible frame (green/cyan with dark outline)
- Add 4px margin to default selection so frame is always visible
- Reduce preview framerate to 2fps to minimize CPU from recursive capture
- Add environment diagnostics logging (GTK version, session type)
- Document refactor progress in docs/REFACTOR_PROGRESS.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant