# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1669169832 0 # Node ID 9daee9d58956f8b3e253023a4fed4ea697d578e3 # Parent b5cd3242b5e7f7c13c31dcd6b34edf8f795da9ac GTK2/3/4: Handle deprecations in GLIB 2.74 and GTK 4.8. diff -r b5cd3242b5e7 -r 9daee9d58956 gtk/dw.c --- a/gtk/dw.c Tue Nov 15 21:41:01 2022 +0000 +++ b/gtk/dw.c Wed Nov 23 02:17:12 2022 +0000 @@ -2247,7 +2247,11 @@ * we generate an application ID based on the binary name or PID * instead of passing NULL to enable full application support. */ +#if GLIB_CHECK_VERSION(2,74,0) + _DWApp = g_application_new(_dw_app_id, G_APPLICATION_DEFAULT_FLAGS); +#else _DWApp = g_application_new(_dw_app_id, G_APPLICATION_FLAGS_NONE); +#endif if(g_application_register(_DWApp, NULL, NULL)) { #if GLIB_CHECK_VERSION(2,40,0) diff -r b5cd3242b5e7 -r 9daee9d58956 gtk3/dw.c --- a/gtk3/dw.c Tue Nov 15 21:41:01 2022 +0000 +++ b/gtk3/dw.c Wed Nov 23 02:17:12 2022 +0000 @@ -2139,7 +2139,11 @@ * we generate an application ID based on the binary name or PID * instead of passing NULL to enable full application support. */ +#if GLIB_CHECK_VERSION(2,74,0) + _DWApp = g_application_new(_dw_app_id, G_APPLICATION_DEFAULT_FLAGS); +#else _DWApp = g_application_new(_dw_app_id, G_APPLICATION_FLAGS_NONE); +#endif if(_DWApp && g_application_register(_DWApp, NULL, NULL)) { #if GLIB_CHECK_VERSION(2,40,0) diff -r b5cd3242b5e7 -r 9daee9d58956 gtk4/dw.c --- a/gtk4/dw.c Tue Nov 15 21:41:01 2022 +0000 +++ b/gtk4/dw.c Wed Nov 23 02:17:12 2022 +0000 @@ -1599,7 +1599,11 @@ * we generate an application ID based on the binary name or PID * instead of passing NULL to enable full application support. */ +#if GLIB_CHECK_VERSION(2,74,0) + _DWApp = g_application_new(_dw_app_id, G_APPLICATION_DEFAULT_FLAGS); +#else _DWApp = g_application_new(_dw_app_id, G_APPLICATION_FLAGS_NONE); +#endif if(_DWApp && g_application_register(_DWApp, NULL, NULL)) { /* Creat our notification handler for any notifications */ @@ -2779,7 +2783,11 @@ { GtkWidget *tmp = gtk_picture_new(); gtk_picture_set_can_shrink(GTK_PICTURE(tmp), TRUE); +#if GTK_CHECK_VERSION(4,8,0) + gtk_picture_set_content_fit(GTK_PICTURE(tmp), GTK_CONTENT_FIT_CONTAIN); +#else gtk_picture_set_keep_aspect_ratio(GTK_PICTURE(tmp), TRUE); +#endif gtk_widget_set_halign(GTK_WIDGET(tmp), GTK_ALIGN_CENTER); gtk_widget_set_valign(GTK_WIDGET(tmp), GTK_ALIGN_CENTER); gtk_widget_show(tmp);