Commit 15d2570a authored by Chris Lee's avatar Chris Lee

Silence warnings

parent c76f0567
...@@ -510,7 +510,8 @@ tint2conf.cflags += ['-DTINT2CONF', ...@@ -510,7 +510,8 @@ tint2conf.cflags += ['-DTINT2CONF',
'-DINSTALL_PREFIX=\\"{}\\"'.format(prefix), '-DINSTALL_PREFIX=\\"{}\\"'.format(prefix),
'-DLOCALEDIR=\\"{}\\"'.format(localedir), '-DLOCALEDIR=\\"{}\\"'.format(localedir),
'-DGETTEXT_PACKAGE=\\"tint2conf\\"', '-DGETTEXT_PACKAGE=\\"tint2conf\\"',
'-DHAVE_VERSION_H'] '-DHAVE_VERSION_H',
'-Wno-shadow']
tint2conf.sources = ['src/util/bt.c', tint2conf.sources = ['src/util/bt.c',
'src/util/common.c', 'src/util/common.c',
......
...@@ -209,8 +209,8 @@ void init_X11_pre_config() ...@@ -209,8 +209,8 @@ void init_X11_pre_config()
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
server.x11_fd = ConnectionNumber(server.display); server.x11_fd = ConnectionNumber(server.display);
XSetErrorHandler((XErrorHandler)server_catch_error); XSetErrorHandler(server_catch_error);
XSetIOErrorHandler((XIOErrorHandler)x11_io_error); XSetIOErrorHandler(x11_io_error);
server_init_atoms(); server_init_atoms();
server.screen = DefaultScreen(server.display); server.screen = DefaultScreen(server.display);
server.root_win = RootWindow(server.display, server.screen); server.root_win = RootWindow(server.display, server.screen);
......
...@@ -399,7 +399,12 @@ void launcher_icon_dump_geometry(void *obj, int indent) ...@@ -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 scale_icon(Imlib_Image original, int icon_size)
{ {
Imlib_Image icon_scaled; 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); imlib_context_set_image(original);
icon_scaled = imlib_create_cropped_scaled_image(0, icon_scaled = imlib_create_cropped_scaled_image(0,
0, 0,
......
...@@ -383,6 +383,11 @@ static void menuAbout() ...@@ -383,6 +383,11 @@ static void menuAbout()
// ====== Theme import/copy/delete ====== // ====== 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. // Shows open dialog and copies the selected files to ~ without overwrite.
static void menuImportFile() static void menuImportFile()
{ {
...@@ -407,7 +412,7 @@ static void menuImportFile() ...@@ -407,7 +412,7 @@ static void menuImportFile()
gchar *newpath = import_no_overwrite(l->data); gchar *newpath = import_no_overwrite(l->data);
g_free(newpath); g_free(newpath);
} }
g_slist_foreach(list, (GFunc)g_free, NULL); g_slist_foreach(list, free_data, NULL);
g_slist_free(list); g_slist_free(list);
gtk_widget_destroy(dialog); gtk_widget_destroy(dialog);
} }
......
...@@ -362,8 +362,12 @@ pid_t tint_exec(const char *command, ...@@ -362,8 +362,12 @@ pid_t tint_exec(const char *command,
// Allow children to exist after parent destruction // Allow children to exist after parent destruction
setsid(); setsid();
// Run the command // Run the command
if (dir) if (dir) {
chdir(dir); int ret = chdir(dir);
if (ret != 0) {
fprintf(stderr, "tint2: failed to chdir to %s\n", dir);
}
}
close_all_fds(); close_all_fds();
reset_signals(); reset_signals();
if (terminal) { if (terminal) {
......
...@@ -36,8 +36,9 @@ ...@@ -36,8 +36,9 @@
Server server; Server server;
void server_catch_error(Display *d, XErrorEvent *ev) int server_catch_error(Display *d, XErrorEvent *ev)
{ {
return 0;
} }
void server_init_atoms() void server_init_atoms()
...@@ -676,9 +677,10 @@ void handle_crash(const char *reason) ...@@ -676,9 +677,10 @@ void handle_crash(const char *reason)
#endif #endif
} }
void x11_io_error(Display *display) int x11_io_error(Display *display)
{ {
handle_crash("X11 I/O error"); handle_crash("X11 I/O error");
return 0;
} }
#ifdef HAVE_SN #ifdef HAVE_SN
......
...@@ -164,12 +164,12 @@ void send_event32(Window win, Atom at, long data1, long data2, long data3); ...@@ -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); int get_property32(Window win, Atom at, Atom type);
void *server_get_property(Window win, Atom at, Atom type, int *num_results); void *server_get_property(Window win, Atom at, Atom type, int *num_results);
Atom server_get_atom(char *atom_name); 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_atoms();
void server_init_visual(); void server_init_visual();
void server_init_xdamage(); void server_init_xdamage();
void x11_io_error(Display *display); int x11_io_error(Display *display);
void handle_crash(const char *reason); void handle_crash(const char *reason);
// detect root background // detect root background
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment