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

add hackish macOS detection for home folder, resources and cache #207

Merged
merged 2 commits into from
Aug 25, 2023

Conversation

TheMorc
Copy link
Contributor

@TheMorc TheMorc commented Aug 23, 2023

this should work just fine with #205 and it was originally intended for an Abaddon.app (use as an example). I just still haven't found a proper way how to make the .app itself properly and also to relink libs to Contents/Frameworks instead of using them from the system brew folders.

feel free to correct my changes, feel free to help me do it properly 🙃

EDIT: it seems like that packaging it into .app fixed notifications!!!!!!!
image
image
image

EDIT 2: seems like that it also enables proper crash logs, it shows all threads and stacktraces too, that's also cool

src/platform.cpp Outdated Show resolved Hide resolved
src/platform.cpp Outdated Show resolved Hide resolved
src/platform.cpp Outdated Show resolved Hide resolved
src/platform.cpp Outdated Show resolved Hide resolved
src/platform.cpp Outdated Show resolved Hide resolved
src/platform.cpp Outdated Show resolved Hide resolved
}

char home_path[PATH_MAX];
snprintf(home_path, sizeof(home_path), "%s/%s", homefolder_path, "/abaddon.ini");
Copy link
Member

Choose a reason for hiding this comment

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

probably not but i wonder if the double slash this makes can cause issues anywhere? can also use Glib::build_filename for joining paths with the benefit of returning a std::string, but not a big deal

Copy link
Contributor Author

Choose a reason for hiding this comment

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

everything seems to be fine currently

src/platform.cpp Outdated Show resolved Hide resolved
@ouwou
Copy link
Member

ouwou commented Aug 24, 2023

out of curiosity what kind of path does this end up using for resources? im guessing inside the .app folder. also does it still work if the executable isnt packaged at all/if CFBundleGetMainBundle or CFBundleCopyResourcesDirectoryURL return null?

@TheMorc
Copy link
Contributor Author

TheMorc commented Aug 24, 2023

with the pr being as is it gets css and res from cwd and ini with the state from Application Support when you run the executable as is

when running the .app it gets css and res from the .app/Contents/Resources as it should

@TheMorc
Copy link
Contributor Author

TheMorc commented Aug 24, 2023

as for the abaddon.app, I noticed that voice calling didn't work anymore.
I tried codesigning it but no luck, at last I tried adding

<key>NSMicrophoneUsageDescription</key>
<string>Need microphone access for voice calling</string>

into the Info.plist and that's fixed now too. Apparently no codesigning is needed thankfully

seems like we learn something new every day lol

@ouwou ouwou merged commit 2378c78 into uowuo:master Aug 25, 2023
9 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