Skip to content
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

Fix Gaphor Launching Fails in macOS #394

Merged
merged 6 commits into from Aug 12, 2020
Merged

Fix Gaphor Launching Fails in macOS #394

merged 6 commits into from Aug 12, 2020

Conversation

amolenaar
Copy link
Member

@amolenaar amolenaar commented Aug 11, 2020

What is the current behavior?

What I try to solve is why Gaphor will not open a model via finder (e.g. double-click on the desktop).

What is the new behavior?

Gaphor is started via a binary, instead of a shell script. This ought to fix the loading issue, but there's more going on.

As a plus I get logging in the Console.app at least. That alone makes the change worth it.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

I took some stuff from py2app. We may want to start using that as our starting point for packaging on macOS at some point.

When I click on a model, I get the following dialog (served from Gaphor by looking at the menu bar):

image

Edit: Solved! The file-open events from macOS do not reach the application. I had to add gtk-mac-integration to handle the file-open event, as well as the quit event from the dock icon.

@amolenaar amolenaar added the chore Maintenance related PR label Aug 11, 2020
@amolenaar amolenaar self-assigned this Aug 11, 2020
@amolenaar amolenaar changed the title WIP: Mac startup binary Mac startup binary Aug 12, 2020
@amolenaar amolenaar requested a review from danyeaw August 12, 2020 06:02
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Aug 12, 2020

Sourcery Code Quality Report (beta)

❌  Merging this PR will decrease code quality in the affected files by 0.02 out of 10.

Quality metrics Before After Change
Complexity 1.41 1.52 0.11 🔴
Method Length 36.68 37.38 0.70 🔴
Quality 8.98 8.96 -0.02 🔴
Other metrics Before After Change
Lines 322 329 7
Changed files Quality Before Quality After Quality Change
gaphor/application.py 9.22 9.21 -0.01 🔴
gaphor/ui/init.py 8.68 8.63 -0.05 🔴

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Overall Recommendation
gaphor/ui/init.py run 12 154.91 5.57 Split out functionality

Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

@amolenaar amolenaar merged commit fde76a5 into master Aug 12, 2020
@amolenaar amolenaar deleted the mac-startup-binary branch August 12, 2020 18:07
@amolenaar amolenaar added this to the 2.0.1 milestone Aug 13, 2020
@danyeaw danyeaw added bug An issue in the application and removed chore Maintenance related PR labels Aug 28, 2020
@danyeaw danyeaw changed the title Mac startup binary Fix Gaphor Launching Fails in macOS Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue in the application
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants