From db30d6b0022d65c0e4d3676b9471a78d7a604cca Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Wed, 12 Feb 2025 23:56:49 +0100 Subject: [PATCH] progress: fix the build for Gtk+ without X11 --- src/progress.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/progress.c b/src/progress.c index a80b720..23645e8 100644 --- a/src/progress.c +++ b/src/progress.c @@ -43,7 +43,9 @@ #include #include #if GTK_CHECK_VERSION(3, 0, 0) -# include +# if defined(GDK_WINDOWING_X11) +# include +# endif #endif #include "../config.h" #define _(string) gettext(string) @@ -193,12 +195,14 @@ static int _progress(Prefs * prefs, char * argv[]) g_signal_connect_swapped(p.window, "delete-event", G_CALLBACK( _progress_closex), p.window); } +#if defined(GDK_WINDOWING_X11) else { p.window = gtk_plug_new(0); g_signal_connect_swapped(p.window, "embedded", G_CALLBACK( _progress_embedded), &p); } +#endif #if GTK_CHECK_VERSION(3, 0, 0) vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); @@ -333,6 +337,7 @@ static int _progress(Prefs * prefs, char * argv[]) if((prefs->flags & PREFS_x) == 0) /* show the window */ gtk_widget_show(p.window); +#if defined(GDK_WINDOWING_X11) else { /* print the window ID and force a flush */ @@ -340,6 +345,7 @@ static int _progress(Prefs * prefs, char * argv[]) printf("%lu\n", id); fclose(stdout); } +#endif gtk_main(); close(p.fd); close(p.fds[1]);