diff --git a/packaging/configure b/packaging/configure index 6cd7b49..eda8874 100755 --- a/packaging/configure +++ b/packaging/configure @@ -510,7 +510,8 @@ tint2conf.cflags += ['-DTINT2CONF', '-DINSTALL_PREFIX=\\"{}\\"'.format(prefix), '-DLOCALEDIR=\\"{}\\"'.format(localedir), '-DGETTEXT_PACKAGE=\\"tint2conf\\"', - '-DHAVE_VERSION_H'] + '-DHAVE_VERSION_H', + '-Wno-shadow'] tint2conf.sources = ['src/util/bt.c', 'src/util/common.c', diff --git a/src/init.c b/src/init.c index 8b2907a..97fc76d 100644 --- a/src/init.c +++ b/src/init.c @@ -209,8 +209,8 @@ void init_X11_pre_config() exit(EXIT_FAILURE); } server.x11_fd = ConnectionNumber(server.display); - XSetErrorHandler((XErrorHandler)server_catch_error); - XSetIOErrorHandler((XIOErrorHandler)x11_io_error); + XSetErrorHandler(server_catch_error); + XSetIOErrorHandler(x11_io_error); server_init_atoms(); server.screen = DefaultScreen(server.display); server.root_win = RootWindow(server.display, server.screen); diff --git a/src/launcher/launcher.c b/src/launcher/launcher.c index a592896..9c79d1e 100644 --- a/src/launcher/launcher.c +++ b/src/launcher/launcher.c @@ -399,7 +399,12 @@ void launcher_icon_dump_geometry(void *obj, int indent) Imlib_Image scale_icon(Imlib_Image original, int icon_size) { Imlib_Image icon_scaled; - if (original) { + if (!icon_size) { + icon_scaled = imlib_create_image(1, 1); + imlib_context_set_image(icon_scaled); + imlib_context_set_color(255, 255, 255, 255); + imlib_image_fill_rectangle(0, 0, icon_size, icon_size); + } else if (original) { imlib_context_set_image(original); icon_scaled = imlib_create_cropped_scaled_image(0, 0, diff --git a/src/tint2conf/main.c b/src/tint2conf/main.c index bcb81ae..28d595c 100644 --- a/src/tint2conf/main.c +++ b/src/tint2conf/main.c @@ -383,6 +383,11 @@ static void menuAbout() // ====== Theme import/copy/delete ====== +static void free_data(gpointer data, gpointer userdata) +{ + g_free(data); +} + // Shows open dialog and copies the selected files to ~ without overwrite. static void menuImportFile() { @@ -407,7 +412,7 @@ static void menuImportFile() gchar *newpath = import_no_overwrite(l->data); g_free(newpath); } - g_slist_foreach(list, (GFunc)g_free, NULL); + g_slist_foreach(list, free_data, NULL); g_slist_free(list); gtk_widget_destroy(dialog); } diff --git a/src/util/common.c b/src/util/common.c index cb4928e..7d868c1 100644 --- a/src/util/common.c +++ b/src/util/common.c @@ -362,8 +362,12 @@ pid_t tint_exec(const char *command, // Allow children to exist after parent destruction setsid(); // Run the command - if (dir) - chdir(dir); + if (dir) { + int ret = chdir(dir); + if (ret != 0) { + fprintf(stderr, "tint2: failed to chdir to %s\n", dir); + } + } close_all_fds(); reset_signals(); if (terminal) { diff --git a/src/util/server.c b/src/util/server.c index 770c640..41a7a2c 100644 --- a/src/util/server.c +++ b/src/util/server.c @@ -36,8 +36,9 @@ Server server; -void server_catch_error(Display *d, XErrorEvent *ev) +int server_catch_error(Display *d, XErrorEvent *ev) { + return 0; } void server_init_atoms() @@ -676,9 +677,10 @@ void handle_crash(const char *reason) #endif } -void x11_io_error(Display *display) +int x11_io_error(Display *display) { handle_crash("X11 I/O error"); + return 0; } #ifdef HAVE_SN diff --git a/src/util/server.h b/src/util/server.h index 079c23e..53db5aa 100644 --- a/src/util/server.h +++ b/src/util/server.h @@ -164,12 +164,12 @@ void send_event32(Window win, Atom at, long data1, long data2, long data3); int get_property32(Window win, Atom at, Atom type); void *server_get_property(Window win, Atom at, Atom type, int *num_results); Atom server_get_atom(char *atom_name); -void server_catch_error(Display *d, XErrorEvent *ev); +int server_catch_error(Display *d, XErrorEvent *ev); void server_init_atoms(); void server_init_visual(); void server_init_xdamage(); -void x11_io_error(Display *display); +int x11_io_error(Display *display); void handle_crash(const char *reason); // detect root background