]> Dogcows Code - chaz/tint2/commitdiff
*add* clock tooltip finished, see issue 115
authorAndreas Fink <andreas.fink85@googlemail.com>
Mon, 16 Nov 2009 17:54:46 +0000 (17:54 +0000)
committerAndreas Fink <andreas.fink85@googlemail.com>
Mon, 16 Nov 2009 17:54:46 +0000 (17:54 +0000)
*fix* reset sigmask before forking

src/clock/clock.c
src/clock/clock.h
src/config.c

index 200996ebd4263c3d95516930cbc7bde578380cd4..b5c3e41920bc271a36e7a857718c84dd289c0c31 100644 (file)
@@ -23,6 +23,7 @@
 #include <cairo-xlib.h>
 #include <pango/pangocairo.h>
 #include <unistd.h>
+#include <signal.h>
 
 #include "window.h"
 #include "server.h"
@@ -61,6 +62,7 @@ void update_clocks()
 
 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 @@ void clock_action(int button)
        }
        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);
index 8652ec53e9f9c3c2d860b98b4a38c82d5c3e547e..750a12e8af6e775fbe22c3c581f3931867ad0e62 100644 (file)
@@ -26,6 +26,7 @@ typedef struct Clock {
 
 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;
index cc8d9f0e2a96dc1b3030dbf3bea74242b3b1b7b0..1e8340452e0be7879f4039f4752743ff0b2d5acd 100644 (file)
@@ -382,6 +382,10 @@ void add_entry (char *key, char *value)
                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);
This page took 0.025783 seconds and 4 git commands to generate.