From ee9be210eb2586cb98942a8b9b3a2188d779eab6 Mon Sep 17 00:00:00 2001 From: Jehan Date: Thu, 2 Nov 2023 20:24:31 +0100 Subject: [PATCH] libgimpwidgets: get rid of build warning. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes this warning (as appeared with commit ad8b47bff7): [1/235] Compiling C object libgimpwidgets/libgimpwidgets-3.0.so.0.9900.17.p/gimpdialog.c.o ../../../../../../../dev/src/gimp/libgimpwidgets/gimpdialog.c:774:1: warning: ‘gimp_dialog_set_title_bar_theme’ defined but not used [-Wunused-function] 774 | gimp_dialog_set_title_bar_theme (GtkWidget *dialog) We could either put the whole `gimp_dialog_set_title_bar_theme()` declaration, definition and usage into #ifdef, or only the implementation (making the function a no-op on non-Windows platforms). I chose the former. There was some discussion that maybe some implementation may happen later for other platforms, but until then, no need to call it needlessly (even more as we don't know when any theoretical other implementation would happen). --- libgimpwidgets/gimpdialog.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libgimpwidgets/gimpdialog.c b/libgimpwidgets/gimpdialog.c index 3f2d8eb290..bd19b3b5a9 100644 --- a/libgimpwidgets/gimpdialog.c +++ b/libgimpwidgets/gimpdialog.c @@ -96,7 +96,9 @@ static void gimp_dialog_close (GtkDialog *dialog); static void gimp_dialog_response (GtkDialog *dialog, gint response_id); +#ifdef G_OS_WIN32 static void gimp_dialog_set_title_bar_theme (GtkWidget *dialog); +#endif G_DEFINE_TYPE_WITH_PRIVATE (GimpDialog, gimp_dialog, GTK_TYPE_DIALOG) @@ -770,10 +772,10 @@ gimp_dialogs_show_help_button (gboolean show) show_help_button = show ? TRUE : FALSE; } +#ifdef G_OS_WIN32 void gimp_dialog_set_title_bar_theme (GtkWidget *dialog) { -#ifdef G_OS_WIN32 HWND hwnd; gboolean use_dark_mode = FALSE; GdkWindow *window = NULL; @@ -810,5 +812,5 @@ gimp_dialog_set_title_bar_theme (GtkWidget *dialog) gdk_window_hide (window); gdk_window_show (window); } -#endif } +#endif