- char *ptr1, *ptr2;
- uint32_t size = sizeof(path); /* need extra space to copy icon path */
- if (_NSGetExecutablePath(path, &size) == 0) {
- ptr1 = strcasestr(path,"MacOS/subsurface");
- ptr2 = strcasestr(path,"Contents");
- if (ptr1 && ptr2) {
- /* we are running as installed app from a bundle */
- if (ptr1 - path < size - strlen(REL_ICON_PATH)) {
- strcpy(ptr1,REL_ICON_PATH);
- return path;
- }
- }
- }
- return "packaging/macosx/Subsurface.icns";
+
+ snprintf(path, 1024, "%s/%s", quartz_application_get_resource_path(), ICON_NAME);
+
+ return path;