Skip to content

Buffers selected event types delivered before the app installs its owns consumers#155

Open
embarc-gabriel wants to merge 1 commit into
musescore:mainfrom
embarc-gabriel:implement-early-event-buffer-for-gui-app
Open

Buffers selected event types delivered before the app installs its owns consumers#155
embarc-gabriel wants to merge 1 commit into
musescore:mainfrom
embarc-gabriel:implement-early-event-buffer-for-gui-app

Conversation

@embarc-gabriel

Copy link
Copy Markdown
Contributor

On macOS the launch url starts the app and a QFileOpenEvent arrives during an early startup before the app install an event filter to handle this events.
This change buffers selected event types to be retrieved later.

Resolves: audacity/audacity#10966

  • I signed the CLA as username:
  • The title of the PR describes the problem it addresses.
  • Each commit's message describes its purpose and effects, and references the issue it resolves. If changes are extensive, there is a sequence of easily reviewable commits.
  • The code in the PR follows the coding rules.
  • I understand all aspects of the code I'm contributing and I'm able to explain it if requested.
  • The code compiles and runs on my machine, preferably after each commit individually. I have manually tested and verified that my changes fulfil their intended purpose.
  • No prior attempts to resolve this problem exist, or if they do, I listed them in my PR description and described how I avoided repeating past mistakes.
  • There are no unnecessary changes.
  • I created a unit test or vtest to verify the changes I made (if applicable).

Build configuration

audacity: audacity/audacity/master
audacity platforms: linux_x64
musescore: musescore/MuseScore/main
musescore platforms: linux_x64

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@embarc-gabriel, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 25 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a78d9e0b-424b-48c6-b492-ac7b3ebed423

📥 Commits

Reviewing files that changed from the base of the PR and between aadbd1f and 80a96fa.

📒 Files selected for processing (6)
  • framework/global/iapplication.h
  • framework/ui/CMakeLists.txt
  • framework/ui/internal/earlyeventsbuffer.cpp
  • framework/ui/internal/earlyeventsbuffer.h
  • framework/ui/internal/guiapplication.cpp
  • framework/ui/internal/guiapplication.h
📝 Walkthrough

Walkthrough

Adds a Qt-only IApplication::takeEarlyEvents interface. Introduces EarlyEventsBuffer to clone and suppress selected early Qt events, then return them by event type. Updates GuiApplication to configure the buffered event types, install the event filter during construction, retrieve buffered events, and remove the filter afterward. Adds the new implementation files to the UI build target.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the core change: buffering early application events before consumers are installed.
Description check ✅ Passed The description includes the issue link, summary, checklist, and build config, and is mostly complete.
Linked Issues check ✅ Passed The changes buffer early QFileOpenEvent handling as required by issue #10966 so the event can be processed after startup.
Out of Scope Changes check ✅ Passed The added interface and UI buffer code are directly related to preserving early events and show no unrelated scope creep.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@framework/ui/internal/earlyeventsbuffer.cpp`:
- Around line 52-60: Update EarlyEventsBuffer::eventFilter to store the result
of event->clone() and verify it is non-null before adding it to m_events; only
return true when a valid clone was buffered, and otherwise fall through to
QObject::eventFilter(watched, event).

In `@framework/ui/internal/guiapplication.cpp`:
- Around line 54-63: Update GuiApplication::takeEarlyEvents so consuming one
event type does not unconditionally remove m_earlyEventsBuffer from qApp while
other configured early event types may still need buffering; retain the event
filter until all expected types have been explicitly requested, then remove it.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c10ebfe3-c911-44ba-abbd-1d2e67c3133d

📥 Commits

Reviewing files that changed from the base of the PR and between 3d76cda and aadbd1f.

📒 Files selected for processing (6)
  • framework/global/iapplication.h
  • framework/ui/CMakeLists.txt
  • framework/ui/internal/earlyeventsbuffer.cpp
  • framework/ui/internal/earlyeventsbuffer.h
  • framework/ui/internal/guiapplication.cpp
  • framework/ui/internal/guiapplication.h

Comment thread framework/ui/internal/earlyeventsbuffer.cpp
Comment thread framework/ui/internal/guiapplication.cpp
@embarc-gabriel
embarc-gabriel force-pushed the implement-early-event-buffer-for-gui-app branch from aadbd1f to 80a96fa Compare July 16, 2026 12:02
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.

Opening an audio.com project via "open in Audacity" launches Audacity but doesn't sync the project if Audacity is initially closed (MacOS)

1 participant