From c4bb16479c6501fabd0825933e9808a5d157cf08 Mon Sep 17 00:00:00 2001 From: "Torrance, Douglas" Date: Sun, 23 Sep 2018 02:11:00 +0000 Subject: [PATCH] wmshutdown: Include xpm icon in source rather than installing into a data directory and loading it from file. --- wmshutdown/Makefile.am | 3 +-- wmshutdown/wmshutdown.c | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wmshutdown/Makefile.am b/wmshutdown/Makefile.am index e5128cb..340da82 100644 --- a/wmshutdown/Makefile.am +++ b/wmshutdown/Makefile.am @@ -1,9 +1,8 @@ bin_PROGRAMS = wmshutdown -wmshutdown_SOURCES = wmshutdown.c +wmshutdown_SOURCES = wmshutdown.c wmshutdown.xpm AM_CFLAGS = $(gtk_CFLAGS) $(x11_CFLAGS) AM_CPPFLAGS = -DDATADIR=\"$(pkgdatadir)\" LIBS += $(gtk_LIBS) $(x11_LIBS) -dist_pkgdata_DATA = wmshutdown.xpm dist_man_MANS = wmshutdown.1 diff --git a/wmshutdown/wmshutdown.c b/wmshutdown/wmshutdown.c index ef9df2d..9d7a6aa 100644 --- a/wmshutdown/wmshutdown.c +++ b/wmshutdown/wmshutdown.c @@ -19,6 +19,7 @@ #include #include #include +#include "wmshutdown.xpm" #ifdef HAVE_CONFIG_H #include @@ -234,6 +235,7 @@ int main(int argc, char *argv[]) { GError *error = NULL; GOptionContext *context; + GdkPixbuf *pixbuf; GtkWidget *gtkiw; GtkWidget *dockArea; GtkWidget *pixmap; @@ -254,7 +256,8 @@ int main(int argc, char *argv[]) gtkiw = gtk_window_new(GTK_WINDOW_TOPLEVEL); dockArea = cria_dock(gtkiw, 47); - pixmap = gtk_image_new_from_file(DATADIR"/wmshutdown.xpm"); + pixbuf = gdk_pixbuf_new_from_xpm_data(image_name); + pixmap = gtk_image_new_from_pixbuf(pixbuf); gtk_widget_show(pixmap); gtk_container_add(GTK_CONTAINER(dockArea), pixmap); -- 2.11.4.GIT