Skip to content

Show main window first when loading model from command line #3396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 24, 2024

Conversation

amolenaar
Copy link
Member

@amolenaar amolenaar commented Jul 19, 2024

PR Type

What kind of change does this PR introduce?

  • Bug fix
  • Feature
  • Chore (refactoring, formatting, local variables, other cleanup)
  • Documentation content changes

What is the current behavior?

When a large model is loaded (e.g. models/UML.gaphor), it looks like nothing happens for a while.

Issue Number: fixes #3392

What is the new behavior?

Postpone model loading until the main window is present. This has the additional advantage that dialogs are always placed over a window (no more warnings).

Add an "interactive" option to the session, indicating
it's run from a GtkApplication context.
With this info, we can schedule a model load call in the background.
Models will be loaded from an idle function anyway.
@amolenaar amolenaar requested a review from danyeaw July 19, 2024 20:18
@github-actions github-actions bot added the python Pull requests that update Python code label Jul 19, 2024
Copy link
Member

@danyeaw danyeaw left a comment

Choose a reason for hiding this comment

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

These changes look good, but the main branch with the UML model opens the main window instantaneously on my computer - so its a bit hard for me to tell how big the impact is with this change.

@tompkins-ct are you able to test if this fixes your issue with the really large model?

@danyeaw danyeaw added fix A fix for a bug and removed python Pull requests that update Python code labels Jul 22, 2024
@amolenaar
Copy link
Member Author

Does that also happen if you open the UML model directly from the command line?

@danyeaw
Copy link
Member

danyeaw commented Jul 24, 2024

Hi @amolenaar, ahh, ya it does significantly improve launching Gaphor with a model from the command line.

@danyeaw danyeaw changed the title Show main window before model is loaded Show main window first when loading model from command line Jul 24, 2024
@danyeaw danyeaw merged commit c3f6e99 into main Jul 24, 2024
18 checks passed
@danyeaw danyeaw deleted the progress-on-startup branch July 24, 2024 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A fix for a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gaphor auto loads the previous (large) model during startup, leading to tempory indication that it may have crashed.
2 participants