Skip to content

fix: YouTube media load segfaults on macOS/Linux (#548)#549

Merged
FelipeDefensor merged 2 commits into
TimeLineAnnotator:devfrom
FelipeDefensor:fix/548-youtube-media-segfault
Jun 23, 2026
Merged

fix: YouTube media load segfaults on macOS/Linux (#548)#549
FelipeDefensor merged 2 commits into
TimeLineAnnotator:devfrom
FelipeDefensor:fix/548-youtube-media-segfault

Conversation

@FelipeDefensor

Copy link
Copy Markdown
Collaborator

Summary

Loading a YouTube video (File ▸ Load media ▸ YouTube) deterministically segfaults on macOS/Linux. Reproduced from source — not a build/packaging issue.

Closes #548.

Root cause

The file-drop event filter (FileDropEventFilter) was installed on the whole QApplication. A Python app-global event filter forces PySide to wrap every QObject that receives a filtered event into a Python object. QtWebEngine renders via internal QtQuick objects; the hover events those generate after a media load get routed through the global filter, and wrapping them crashes in getWrapperForQObject.

Native backtrace (from the macOS crash report):

PySide::getWrapperForQObject                                  ← crash
QObjectWrapper::eventFilter
QCoreApplicationPrivate::sendThroughApplicationEventFilters   ← app-wide filter
...
QtQuick QQuickDeliveryAgentPrivate::sendHoverEvent           ← WebEngine's QML scene

The crash is in shiboken marshalling, before the Python eventFilter body runs — so it can't be guarded in Python.

Fix

  • Install the drop filter on the main window instead of the QApplication. WebEngine windows are separate top-levels, so their QtQuick objects never traverse the filter.
  • TimelineUIsView is a QGraphicsView, which accepts drops by default and was swallowing drag events over the timeline area. Set setAcceptDrops(False) so Qt's findDnDTarget routes those drops up to the main window where the filter lives.

Net: drops still work everywhere in the main window; the crash is gone.

Verification

  • Crash: headless repro driving APP_MEDIA_LOAD with a YouTube URL — before: 3/3 SIGSEGV (exit 139); after: 5/5 clean.
  • Timeline drops: replicated Qt's findDnDTarget from the timeline viewport → resolves to TiliaMainWindow (drop-accepting ancestor).
  • Tests: 481 passed, 2 xfailed, 2 xpassed (qtui + all timeline UI).

🤖 Generated with Claude Code

…tator#548)

The file-drop QObject event filter was installed on the whole
QApplication. A Python app-global event filter forces PySide to wrap
every QObject that receives a filtered event into a Python object;
QtWebEngine renders via internal QtQuick objects, and wrapping those
during the hover events that follow a media load crashed inside
getWrapperForQObject, raising SIGSEGV.

Scope the filter to the main window. To keep file drops working over
the timeline area, disable drops on TimelineUIsView (a QGraphicsView,
which accepts drops by default and was swallowing the events) so Qt
routes them up to the main window where the filter lives.
@FelipeDefensor FelipeDefensor requested a review from azfoo June 18, 2026 07:37
…arametrization

The tlui fixture declared its own params= but was only ever used via indirect=['tlui'].
On Python 3.10/macOS, pytest raises a collection error when a fixture with params=
is also used as an indirect parameter. Since all direct users in subpackages define
a local tlui override, the conftest fixture params were unused and safe to drop.
@FelipeDefensor FelipeDefensor merged commit d49878a into TimeLineAnnotator:dev Jun 23, 2026
7 of 11 checks passed
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.

2 participants