Skip to content

fix(app): fix session file loading, shader linking, and menu flashing (#39) - #42

Merged
mcoliver merged 11 commits into
mainfrom
fix/issue-39-session-load-and-menus
Sep 24, 2026
Merged

mcoliver merged 11 commits into
mainfrom
fix/issue-39-session-load-and-menus

Conversation

@mcoliver

Copy link
Copy Markdown
Collaborator

Fixes #39

Summary of Changes

  1. OpenGL Resource Sharing Across Contexts ():

    • Enabled Qt::AA_ShareOpenGLContexts before creating QApplication in src/bin/nsapps/UTV/main.cpp. On macOS, QTMetalVideoDevice creates an offscreen QOpenGLContext for rendering; without process-wide context sharing, static functions in IPCore (such as SourceRGBA) compiled in one context were invalid in another context, producing OpenGL linking errors:
      ERROR: compiling program:
      ERROR: with functions: SourceRGBA
      ERROR: No definition of SourceRGBA86f32ffb in fragment shader
      
    • Added a defensive check !glIsShader(F->state()->shader) in ShaderProgram.cpp to automatically release and recompile static shader functions if their handle is invalid in the current OpenGL context.
  2. Prevent Session Files from Being Dispatched to Media Preloader:

    • In RvSession::LoadState, verified that file extensions are not .rv, .rvedl, or .edl before invoking m_session->startPreloadingMedia(filename).
    • Session files are GTO/EDL files loaded via session readers; passing them to the movie/image preloader caused brute-force reader probes.
  3. Prevent NanoSVG False Positive Matching:

    • Removed BruteForceIO capability from IOsvg (cap = ImageRead) and added validation for g && g->shapes in IOsvg::getImageInfo. NanoSVG parses any text file as an empty SVG; without magic-byte verification, it was falsely claiming .rv files were SVG images and movie sequences.
  4. Debounce Menu Rebuilding on Startup:

    • In RvDocument::notification, switched menuChangedMessage handling to call setBuildMenu() rather than immediately executing mergeMenu() synchronously.
    • Configured m_menuTimer as a single-shot timer. During startup, dozens of modes activate and fire invalidateMenu(); debouncing coalesces these into a single menu build and completely eliminates the rapid menu bar flashing.
  5. Fix Console Log Mangling of <...>:

    • In RvConsoleWindow.cpp, escaped raw log text with toHtmlEscaped() when appending to HTML. Unescaped strings containing comparison operators (< and > in GLSL code or C++ templates) were previously stripped by Qt's rich text parser as unknown HTML tags.
  6. Reuse Initial Empty Document on macOS File Open:

    • In RvApplication::newSessionFromFiles, checked if an existing document is currently open with no sources loaded. If so, incoming files from a macOS QFileOpenEvent are loaded directly into that session rather than creating an extra redundant window.
  7. Apple Flex 2.6+ 64-bit Compatibility:

    • Updated cmake/macros/rv_lex.cmake to properly detect Apple flex on macOS.
    • Updated FlexLexer.h in both Gto and MuLang to use size_t for buffer sizes and ssize_t for LexerInput return types.

…#39)

- Enable Qt::AA_ShareOpenGLContexts in UTV macOS main.cpp to share GL
  resources across all QOpenGLContext instances, resolving shader link
  errors ('No definition of SourceRGBA... in fragment shader')
- Defensively verify glIsShader() before attaching compiled functions
  in ShaderProgram.cpp and recompile if invalidated in current context
- Skip preloading for .rv and EDL session files in RvSession LoadState
  to prevent session files from being dispatched to image/movie readers
- Remove BruteForceIO from IOsvg and validate parsed shapes to prevent
  arbitrary non-SVG text files from being misidentified as SVG images
- Debounce menuChangedMessage notifications via setBuildMenu() in
  RvDocument to eliminate rapid repeated menu bar flashing on startup
- Escape raw console output in RvConsoleWindow using toHtmlEscaped() so
  GLSL and template comparisons with '<' and '>' are not swallowed as HTML
- Reuse initial empty session in newSessionFromFiles when receiving
  macOS QFileOpenEvent rather than opening a redundant secondary window
- Update FlexLexer.h in Gto and MuLang for 64-bit size_t and ssize_t
  parameter types with Apple Flex 2.6+

Signed-off-by: Michael Oliver <mcoliver@gmail.com>
…dows versioning

Normalize modern Apple flex signatures via sed filters without altering standard FlexLexer headers, sanitize Windows version input to avoid invalid non-numeric CMake versions, and document multi-OS development rules in AGENTS.md.

Signed-off-by: Michael Oliver <mcoliver@gmail.com>
Leverage Homebrew pre-installed on GitHub Actions Ubuntu runners to download pre-compiled binary bottles for Qt6, FFmpeg, OpenEXR, OpenColorIO, OpenImageIO, Boost, spdlog, and OpenJPH, mirroring the macOS workflow. Update build.sh to auto-discover Linux Homebrew prefixes, and add Homebrew/CCache caching to Linux build jobs.

Signed-off-by: Michael Oliver <mcoliver@gmail.com>
- Install libosmesa6-dev in Ubuntu workflow and build.sh
- Expand search paths in FindOSMesa.cmake for Linux multiarch
- Update Chocolatey metadata: add iconUrl, packageSourceUrl, and releaseNotes
- Add committed chocolatey recipe files for openutv and openutv-dependencies
- Fix macOS artifact packaging path in branch-build.yml

Signed-off-by: Michael Oliver <mcoliver@gmail.com>
…ng, and sanitize artifact names

Signed-off-by: Michael Oliver <mcoliver@gmail.com>
Signed-off-by: Michael Oliver <mcoliver@gmail.com>
Signed-off-by: Michael Oliver <mcoliver@gmail.com>
Signed-off-by: Michael Oliver <mcoliver@gmail.com>
…erflow warnings

Signed-off-by: Michael Oliver <mcoliver@gmail.com>
- Configure GCC defaults with -march=x86-64-v3 for AVX2/FMA/BMI2 SIMD vectorization
- Auto-detect and link with Mold (or LLD) for fast zero-overhead linking
- Enable Link-Time Optimization (-flto=auto) in Release builds
- Add mold to apt package installations across build.sh and CI workflows

Signed-off-by: Michael Oliver <mcoliver@gmail.com>
…zations

Reverts Linux Homebrew CI changes, compiler flags, and build.sh modifications from this branch so PR #42 focuses strictly on Issue #39 (session loading, shader linking, and menu flashing). All Linux build optimizations are preserved on branch feat/linux-build-optimizations.

Signed-off-by: Michael Oliver <mcoliver@gmail.com>
@mcoliver
mcoliver merged commit 53aebbe into main Sep 24, 2026
7 of 9 checks passed
@mcoliver
mcoliver deleted the fix/issue-39-session-load-and-menus branch September 24, 2026 13:53
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.

fix: on MacOS, 'Open with UTV' crashes UTV

1 participant