Open current tint2 config automatically when started from tint2
This commit is contained in:
@@ -513,7 +513,7 @@ void button_dump_geometry(void *obj, int indent)
|
||||
button->backend->text);
|
||||
}
|
||||
|
||||
void button_action(void *obj, int mouse_button, int x, int y)
|
||||
void button_action(void *obj, int mouse_button, int x, int y, Time time)
|
||||
{
|
||||
Button *button = (Button *)obj;
|
||||
Panel *panel = (Panel *)button->area.panel;
|
||||
@@ -626,18 +626,8 @@ void button_action(void *obj, int mouse_button, int x, int y)
|
||||
panel_x2,
|
||||
panel_y2,
|
||||
command);
|
||||
pid_t pid = fork();
|
||||
if (pid < 0) {
|
||||
fprintf(stderr, "Could not fork\n");
|
||||
} else if (pid == 0) {
|
||||
// Child process
|
||||
// Allow children to exist after parent destruction
|
||||
setsid();
|
||||
// Run the command
|
||||
execl("/bin/sh", "/bin/sh", "-c", full_cmd, NULL);
|
||||
fprintf(stderr, "Failed to execlp %s\n", full_cmd);
|
||||
exit(1);
|
||||
}
|
||||
tint_exec(full_cmd, NULL, NULL, time);
|
||||
g_free(full_cmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ void draw_button(void *obj, cairo_t *c);
|
||||
gboolean resize_button(void *obj);
|
||||
|
||||
// Called on mouse click event.
|
||||
void button_action(void *obj, int button, int x, int y);
|
||||
void button_action(void *obj, int button, int x, int y, Time time);
|
||||
|
||||
void button_default_font_changed();
|
||||
void button_default_icon_theme_changed();
|
||||
|
||||
Reference in New Issue
Block a user