Skip to content

Commit

Permalink
macOS code cleanup
Browse files Browse the repository at this point in the history
The symbol `GTK_TYPE_OSX_APPLICATION` was removed from the package
`gtk-mac-integration` in 2012 so it should be safe to clean up.
  • Loading branch information
zisoft authored and TurboGit committed Aug 9, 2024
1 parent e84f968 commit f6028c7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
21 changes: 0 additions & 21 deletions src/gui/gtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -904,13 +904,8 @@ static void _quit_callback(dt_action_t *action)
}

#ifdef MAC_INTEGRATION
#ifdef GTK_TYPE_OSX_APPLICATION
static gboolean _osx_quit_callback(GtkOSXApplication *OSXapp,
gpointer user_data)
#else
static gboolean _osx_quit_callback(GtkosxApplication *OSXapp,
gpointer user_data)
#endif
{
GList *windows, *window;
windows = gtk_window_list_toplevels();
Expand All @@ -923,15 +918,9 @@ static gboolean _osx_quit_callback(GtkosxApplication *OSXapp,
return TRUE;
}

#ifdef GTK_TYPE_OSX_APPLICATION
static gboolean _osx_openfile_callback(GtkOSXApplication *OSXapp,
gchar *path,
gpointer user_data)
#else
static gboolean _osx_openfile_callback(GtkosxApplication *OSXapp,
gchar *path,
gpointer user_data)
#endif
{
// when multiple files are dropped on the app icon this callback
// gets called for each file individually so we don't request to
Expand Down Expand Up @@ -1190,11 +1179,6 @@ int dt_gui_gtk_init(dt_gui_gtk_t *gui)
g_snprintf(gui->gtkrc, sizeof(gui->gtkrc), "darktable");

#ifdef MAC_INTEGRATION
#ifdef GTK_TYPE_OSX_APPLICATION
GtkOSXApplication *OSXApp = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL);
gtk_osxapplication_set_menu_bar(
OSXApp, GTK_MENU_SHELL(gtk_menu_bar_new())); // needed for default entries to show up
#else
GtkosxApplication *OSXApp = g_object_new(GTKOSX_TYPE_APPLICATION, NULL);

// View menu
Expand Down Expand Up @@ -1263,7 +1247,6 @@ int dt_gui_gtk_init(dt_gui_gtk_t *gui)

gtkosx_application_set_help_menu(OSXApp, GTK_MENU_ITEM(help_root_menu));

#endif
g_signal_connect(G_OBJECT(OSXApp), "NSApplicationBlockTermination",
G_CALLBACK(_osx_quit_callback), NULL);
g_signal_connect(G_OBJECT(OSXApp), "NSApplicationOpenFile",
Expand Down Expand Up @@ -1500,12 +1483,8 @@ void dt_gui_gtk_run(dt_gui_gtk_t *gui)
dt_view_manager_configure(darktable.view_manager,
allocation.width - 2 * tb, allocation.height - 2 * tb);
#ifdef MAC_INTEGRATION
#ifdef GTK_TYPE_OSX_APPLICATION
gtk_osxapplication_ready(g_object_new(GTK_TYPE_OSX_APPLICATION, NULL));
#else
gtkosx_application_ready(g_object_new(GTKOSX_TYPE_APPLICATION, NULL));
#endif
#endif
#ifdef GDK_WINDOWING_QUARTZ
dt_osx_focus_window();
#endif
Expand Down
6 changes: 0 additions & 6 deletions src/osx/osx.mm
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,9 @@ gboolean dt_osx_file_trash(const char *filename, GError **error)
#ifdef MAC_INTEGRATION
gchar *bundle_id;

#ifdef GTK_TYPE_OSX_APPLICATION
bundle_id = quartz_application_get_bundle_id();
if(bundle_id)
result = quartz_application_get_resource_path();
#else
bundle_id = gtkosx_application_get_bundle_id();
if(bundle_id)
result = gtkosx_application_get_resource_path();
#endif
g_free(bundle_id);

#endif
Expand Down

0 comments on commit f6028c7

Please sign in to comment.