Skip to content

Introduce Single Instance per File Mechanism - #44

Merged
shun-iwasawa merged 1 commit into
opentoonz:mainfrom
shun-iwasawa:single_instance_per_file
Jul 15, 2026
Merged

shun-iwasawa merged 1 commit into
opentoonz:mainfrom
shun-iwasawa:single_instance_per_file

Conversation

@shun-iwasawa

Copy link
Copy Markdown
Member

This PR ensures that only one window is opened per XDTS file, even if XDTS Viewer is launched multiple times for the same file.
This prevents conflicting edits from multiple windows on the same file.
Additionally, if an XDTS file is modified externally and XDTS Viewer is relaunched with that file's path, the existing window's timing data is reloaded and refreshed, while any unsaved hand-drawn (scribble) edits are preserved.

On first launch, an invisible "mothership" process starts (detected via a QSharedMemory lock) and coordinates per-file "worker" windows, each running as its own child process, over IPC (QLocalServer/QLocalSocket). This coordination is implemented in the newly added InstanceManager class.
When XDTS Viewer is launched with a path that's already open in an existing window — including either file of a paired genga/douga sheet — the mothership asks that window to reload its data and brings it to the foreground instead of opening a new one.
The mothership process exits automatically once all windows have been closed.

@shun-iwasawa
shun-iwasawa merged commit d3393bf into opentoonz:main Jul 15, 2026
2 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.

1 participant