*add* clock tooltip finished, see issue 115 *fix* reset sigmask before forking git-svn-id: http://tint2.googlecode.com/svn/trunk@272 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
Andreas.Fink85 Andreas.Fink85@121b4492-b84c-0410-8b4c-0d4edfb3f3cc
3 files changed,
11 insertions(+),
0 deletions(-)
M
src/clock/clock.c
→
src/clock/clock.c
@@ -23,6 +23,7 @@ #include <cairo.h>
#include <cairo-xlib.h> #include <pango/pangocairo.h> #include <unistd.h> +#include <signal.h> #include "window.h" #include "server.h"@@ -61,6 +62,7 @@
const char* clock_get_tooltip(void* obj) { + strftime(buf_tooltip, sizeof(buf_tooltip), time_tooltip_format, localtime(&time_clock.tv_sec)); return buf_tooltip; }@@ -261,7 +263,11 @@ break;
} if (command) { pid_t pid; + sigset_t sigset; + sigprocmask(SIG_SETMASK, &sigset, 0); + sigprocmask(SIG_UNBLOCK, &sigset, 0); pid = fork(); + sigprocmask(SIG_BLOCK, &sigset, 0); if (pid == 0) { execl("/bin/sh", "/bin/sh", "-c", command, NULL); _exit(0);
M
src/clock/clock.h
→
src/clock/clock.h
@@ -26,6 +26,7 @@
extern char *time1_format; extern char *time2_format; +extern char *time_tooltip_format; extern PangoFontDescription *time1_font_desc; extern PangoFontDescription *time2_font_desc; extern char *clock_lclick_command;
M
src/config.c
→
src/config.c
@@ -382,6 +382,10 @@ Area *a = g_slist_nth_data(list_back, id);
memcpy(&panel_config.clock.area.pix.back, &a->pix.back, sizeof(Color)); memcpy(&panel_config.clock.area.pix.border, &a->pix.border, sizeof(Border)); } + else if (strcmp(key, "clock_tooltip") == 0) { + if (strlen(value) > 0) + time_tooltip_format = strdup (value); + } else if (strcmp(key, "clock_lclick_command") == 0) { if (strlen(value) > 0) clock_lclick_command = strdup(value);