Commit eb93af36 authored by o9000's avatar o9000

preprent "tint2:" to all logging messages

parent b7691afb
......@@ -208,7 +208,7 @@ void battery_update_text(char *dest, char *format)
strnappend(dest, "%", BATTERY_BUF_SIZE);
break;
default:
fprintf(stderr, "Battery: unrecognised format specifier '%%%c'.\n", *c);
fprintf(stderr, "tint2: Battery: unrecognised format specifier '%%%c'.\n", *c);
buf[0] = *c;
strnappend(dest, buf, BATTERY_BUF_SIZE);
}
......@@ -435,8 +435,8 @@ void draw_battery(void *obj, cairo_t *c)
void battery_dump_geometry(void *obj, int indent)
{
Battery *battery = (Battery *)obj;
fprintf(stderr, "%*sText 1: y = %d, text = %s\n", indent, "", battery->bat1_posy, buf_bat_line1);
fprintf(stderr, "%*sText 2: y = %d, text = %s\n", indent, "", battery->bat2_posy, buf_bat_line2);
fprintf(stderr, "tint2: %*sText 1: y = %d, text = %s\n", indent, "", battery->bat1_posy, buf_bat_line1);
fprintf(stderr, "tint2: %*sText 2: y = %d, text = %s\n", indent, "", battery->bat2_posy, buf_bat_line2);
}
char *battery_get_tooltip(void *obj)
......
......@@ -58,7 +58,7 @@ int battery_os_update(BatteryState *state)
break;
}
} else {
fprintf(stderr, "power update: no such sysctl");
fprintf(stderr, "tint2: power update: no such sysctl");
err = -1;
}
......
......@@ -68,7 +68,7 @@ static struct uevent_notify psy_change = {UEVENT_CHANGE, "power_supply", NULL, u
static void uevent_battery_plug()
{
fprintf(stderr, "reinitialize batteries after HW change\n");
fprintf(stderr, "tint2: reinitialize batteries after HW change\n");
reinit_battery();
}
static struct uevent_notify psy_plug = {UEVENT_ADD | UEVENT_REMOVE, "power_supply", NULL, uevent_battery_plug};
......@@ -76,7 +76,7 @@ static struct uevent_notify psy_plug = {UEVENT_ADD | UEVENT_REMOVE, "power_suppl
#define RETURN_ON_ERROR(err) \
if (err) { \
g_error_free(err); \
fprintf(stderr, RED "%s:%d: errror" RESET "\n", __FILE__, __LINE__); \
fprintf(stderr, RED "tint2: %s:%d: errror" RESET "\n", __FILE__, __LINE__); \
return FALSE; \
}
......@@ -98,7 +98,7 @@ static enum psy_type power_supply_get_type(const gchar *entryname)
g_file_get_contents(path_type, &type, &typelen, &error);
g_free(path_type);
if (error) {
fprintf(stderr, RED "%s:%d: read failed" RESET "\n", __FILE__, __LINE__);
fprintf(stderr, RED "tint2: %s:%d: read failed" RESET "\n", __FILE__, __LINE__);
g_error_free(error);
return PSY_UNKNOWN;
}
......@@ -124,7 +124,7 @@ static gboolean init_linux_battery(struct psy_battery *bat)
bat->path_present = g_build_filename(battery_sys_prefix, "/sys/class/power_supply", entryname, "present", NULL);
if (!g_file_test(bat->path_present, G_FILE_TEST_EXISTS)) {
fprintf(stderr, RED "%s:%d: read failed" RESET "\n", __FILE__, __LINE__);
fprintf(stderr, RED "tint2: %s:%d: read failed" RESET "\n", __FILE__, __LINE__);
goto err0;
}
......@@ -152,13 +152,13 @@ static gboolean init_linux_battery(struct psy_battery *bat)
if (!g_file_test(bat->path_level_now, G_FILE_TEST_EXISTS) ||
!g_file_test(bat->path_level_full, G_FILE_TEST_EXISTS) ||
!g_file_test(bat->path_rate_now, G_FILE_TEST_EXISTS)) {
fprintf(stderr, RED "%s:%d: read failed" RESET "\n", __FILE__, __LINE__);
fprintf(stderr, RED "tint2: %s:%d: read failed" RESET "\n", __FILE__, __LINE__);
goto err1;
}
bat->path_status = g_build_filename(battery_sys_prefix, "/sys/class/power_supply", entryname, "status", NULL);
if (!g_file_test(bat->path_status, G_FILE_TEST_EXISTS)) {
fprintf(stderr, RED "%s:%d: read failed" RESET "\n", __FILE__, __LINE__);
fprintf(stderr, RED "tint2: %s:%d: read failed" RESET "\n", __FILE__, __LINE__);
goto err2;
}
......@@ -182,7 +182,7 @@ static gboolean init_linux_mains(struct psy_mains *ac)
ac->path_online = g_build_filename(battery_sys_prefix, "/sys/class/power_supply", entryname, "online", NULL);
if (!g_file_test(ac->path_online, G_FILE_TEST_EXISTS)) {
fprintf(stderr, RED "%s:%d: read failed" RESET "\n", __FILE__, __LINE__);
fprintf(stderr, RED "tint2: %s:%d: read failed" RESET "\n", __FILE__, __LINE__);
g_free(ac->path_online);
return FALSE;
}
......@@ -228,10 +228,10 @@ static void add_battery(const char *entryname)
if (init_linux_battery(bat)) {
batteries = g_list_append(batteries, bat);
fprintf(stdout, GREEN "Found battery \"%s\"" RESET "\n", bat->name);
fprintf(stderr, GREEN "Found battery \"%s\"" RESET "\n", bat->name);
} else {
g_free(bat);
fprintf(stderr, RED "Failed to initialize battery \"%s\"" RESET "\n", entryname);
fprintf(stderr, RED "tint2: Failed to initialize battery \"%s\"" RESET "\n", entryname);
}
}
......@@ -242,10 +242,10 @@ static void add_mains(const char *entryname)
if (init_linux_mains(ac)) {
mains = g_list_append(mains, ac);
fprintf(stdout, GREEN "Found mains \"%s\"" RESET "\n", ac->name);
fprintf(stderr, GREEN "Found mains \"%s\"" RESET "\n", ac->name);
} else {
g_free(ac);
fprintf(stderr, RED "Failed to initialize mains \"%s\"" RESET "\n", entryname);
fprintf(stderr, RED "tint2: Failed to initialize mains \"%s\"" RESET "\n", entryname);
}
}
......@@ -263,7 +263,7 @@ gboolean battery_os_init()
RETURN_ON_ERROR(error);
while ((entryname = g_dir_read_name(directory))) {
fprintf(stderr, GREEN "Found power device %s" RESET "\n", entryname);
fprintf(stderr, GREEN "tint2: Found power device %s" RESET "\n", entryname);
enum psy_type type = power_supply_get_type(entryname);
switch (type) {
......
......@@ -78,7 +78,7 @@ void destroy_button(void *obj)
free_and_null(button->backend->uwheel_command);
if (button->backend->instances) {
fprintf(stderr, "Error: Attempt to destroy backend while there are still frontend instances!\n");
fprintf(stderr, "tint2: Error: Attempt to destroy backend while there are still frontend instances!\n");
exit(-1);
}
free(button->backend);
......
......@@ -321,9 +321,9 @@ void draw_clock(void *obj, cairo_t *c)
void clock_dump_geometry(void *obj, int indent)
{
Clock *clock = (Clock *)obj;
fprintf(stderr, "%*sText 1: y = %d, text = %s\n", indent, "", clock->time1_posy, buf_time);
fprintf(stderr, "tint2: %*sText 1: y = %d, text = %s\n", indent, "", clock->time1_posy, buf_time);
if (time2_format) {
fprintf(stderr, "%*sText 2: y = %d, text = %s\n", indent, "", clock->time2_posy, buf_date);
fprintf(stderr, "tint2: %*sText 2: y = %d, text = %s\n", indent, "", clock->time2_posy, buf_date);
}
}
......
......@@ -119,7 +119,7 @@ void get_action(char *event, MouseAction *action)
else if (strcmp(event, "prev_task") == 0)
*action = PREV_TASK;
else
fprintf(stderr, "Error: unrecognized action '%s'. Please fix your config file.\n", event);
fprintf(stderr, "tint2: Error: unrecognized action '%s'. Please fix your config file.\n", event);
}
int get_task_status(char *status)
......@@ -215,7 +215,7 @@ void load_launcher_app_dir(const char *path)
Separator *get_or_create_last_separator()
{
if (!panel_config.separator_list) {
fprintf(stderr, "Warning: separator items should shart with 'separator = new'\n");
fprintf(stderr, "tint2: Warning: separator items should shart with 'separator = new'\n");
panel_config.separator_list = g_list_append(panel_config.separator_list, create_separator());
}
return (Separator *)g_list_last(panel_config.separator_list)->data;
......@@ -224,7 +224,7 @@ Separator *get_or_create_last_separator()
Execp *get_or_create_last_execp()
{
if (!panel_config.execp_list) {
fprintf(stderr, "Warning: execp items should start with 'execp = new'\n");
fprintf(stderr, "tint2: Warning: execp items should start with 'execp = new'\n");
panel_config.execp_list = g_list_append(panel_config.execp_list, create_execp());
}
return (Execp *)g_list_last(panel_config.execp_list)->data;
......@@ -233,7 +233,7 @@ Execp *get_or_create_last_execp()
Button *get_or_create_last_button()
{
if (!panel_config.button_list) {
fprintf(stderr, "Warning: button items should start with 'button = new'\n");
fprintf(stderr, "tint2: Warning: button items should start with 'button = new'\n");
panel_config.button_list = g_list_append(panel_config.button_list, create_button());
}
return (Button *)g_list_last(panel_config.button_list)->data;
......@@ -433,7 +433,7 @@ void add_entry(char *key, char *value)
#ifdef ENABLE_BATTERY
battery_enabled = 1;
#else
fprintf(stderr, "tint2 is build without battery support\n");
fprintf(stderr, "tint2: tint2 has been compiled without battery support\n");
#endif
}
if (panel_items_order[j] == 'S') {
......@@ -654,7 +654,7 @@ void add_entry(char *key, char *value)
else if (g_str_equal(value, "dots"))
separator->style = SEPARATOR_DOTS;
else
fprintf(stderr, RED "Invalid separator_style value: %s" RESET "\n", value);
fprintf(stderr, RED "tint2: Invalid separator_style value: %s" RESET "\n", value);
} else if (strcmp(key, "separator_size") == 0) {
Separator *separator = get_or_create_last_separator();
separator->thickness = atoi(value);
......@@ -681,7 +681,7 @@ void add_entry(char *key, char *value)
execp->backend->interval = 0;
int v = atoi(value);
if (v < 0) {
fprintf(stderr, "execp_interval must be an integer >= 0\n");
fprintf(stderr, "tint2: execp_interval must be an integer >= 0\n");
} else {
execp->backend->interval = v;
}
......@@ -737,7 +737,7 @@ void add_entry(char *key, char *value)
Execp *execp = get_or_create_last_execp();
int v = atoi(value);
if (v < 0) {
fprintf(stderr, "execp_icon_w must be an integer >= 0\n");
fprintf(stderr, "tint2: execp_icon_w must be an integer >= 0\n");
} else {
execp->backend->icon_w = v;
}
......@@ -745,7 +745,7 @@ void add_entry(char *key, char *value)
Execp *execp = get_or_create_last_execp();
int v = atoi(value);
if (v < 0) {
fprintf(stderr, "execp_icon_h must be an integer >= 0\n");
fprintf(stderr, "tint2: execp_icon_h must be an integer >= 0\n");
} else {
execp->backend->icon_h = v;
}
......@@ -1290,7 +1290,7 @@ void add_entry(char *key, char *value)
else if (strcmp(key, "primary_monitor_first") == 0) {
fprintf(stderr,
"tint2: deprecated config option \"%s\"\n"
" Please see the documentation regarding the alternatives.\n",
" Please see the documentation regarding the alternatives.\n",
key);
} else
fprintf(stderr, "tint2: invalid option \"%s\",\n upgrade tint2 or correct your config file\n", key);
......@@ -1305,7 +1305,7 @@ void add_entry(char *key, char *value)
gboolean config_read_file(const char *path)
{
fprintf(stderr, "Loading config file: %s\n", path);
fprintf(stderr, "tint2: Loading config file: %s\n", path);
FILE *fp = fopen(path, "r");
if (!fp)
......@@ -1375,7 +1375,7 @@ gboolean config_read_default_path()
// copy tint2rc from system directory to user directory
fprintf(stderr, "tint2 warning: could not find a config file! Creating a default one.\n");
fprintf(stderr, "tint2: could not find a config file! Creating a default one.\n");
// According to the XDG Base Directory Specification
// (https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.6.html)
// if the user's config directory does not exist, we should create it with permissions set to 0700.
......
......@@ -55,16 +55,16 @@ void handle_dnd_enter(XClientMessageEvent *e)
dnd_version = (e->data.l[1] >> 24);
if (dnd_debug) {
fprintf(stderr, "DnD %s:%d: DnDEnter\n", __FILE__, __LINE__);
fprintf(stderr, "tint2: DnD %s:%d: DnDEnter\n", __FILE__, __LINE__);
fprintf(stderr,
"DnD %s:%d: DnDEnter. Supports > 3 types = %s\n",
__FILE__,
__LINE__,
more_than_3 ? "yes" : "no");
fprintf(stderr, "DnD %s:%d: Protocol version = %d\n", __FILE__, __LINE__, dnd_version);
fprintf(stderr, "DnD %s:%d: Type 1 = %s\n", __FILE__, __LINE__, GetAtomName(server.display, e->data.l[2]));
fprintf(stderr, "DnD %s:%d: Type 2 = %s\n", __FILE__, __LINE__, GetAtomName(server.display, e->data.l[3]));
fprintf(stderr, "DnD %s:%d: Type 3 = %s\n", __FILE__, __LINE__, GetAtomName(server.display, e->data.l[4]));
fprintf(stderr, "tint2: DnD %s:%d: Protocol version = %d\n", __FILE__, __LINE__, dnd_version);
fprintf(stderr, "tint2: DnD %s:%d: Type 1 = %s\n", __FILE__, __LINE__, GetAtomName(server.display, e->data.l[2]));
fprintf(stderr, "tint2: DnD %s:%d: Type 2 = %s\n", __FILE__, __LINE__, GetAtomName(server.display, e->data.l[3]));
fprintf(stderr, "tint2: DnD %s:%d: Type 3 = %s\n", __FILE__, __LINE__, GetAtomName(server.display, e->data.l[4]));
}
// Query which conversions are available and pick the best
......@@ -80,7 +80,7 @@ void handle_dnd_enter(XClientMessageEvent *e)
}
if (dnd_debug)
fprintf(stderr, "DnD %s:%d: Requested type = %s\n", __FILE__, __LINE__, GetAtomName(server.display, dnd_atom));
fprintf(stderr, "tint2: DnD %s:%d: Requested type = %s\n", __FILE__, __LINE__, GetAtomName(server.display, dnd_atom));
}
void handle_dnd_position(XClientMessageEvent *e)
......@@ -167,13 +167,13 @@ void handle_dnd_selection_notify(XSelectionEvent *e)
Atom target = e->target;
if (dnd_debug) {
fprintf(stderr, "DnD %s:%d: A selection notify has arrived!\n", __FILE__, __LINE__);
fprintf(stderr, "tint2: DnD %s:%d: A selection notify has arrived!\n", __FILE__, __LINE__);
fprintf(stderr,
"DnD %s:%d: Selection atom = %s\n",
__FILE__,
__LINE__,
GetAtomName(server.display, e->selection));
fprintf(stderr, "DnD %s:%d: Target atom = %s\n", __FILE__, __LINE__, GetAtomName(server.display, target));
fprintf(stderr, "tint2: DnD %s:%d: Target atom = %s\n", __FILE__, __LINE__, GetAtomName(server.display, target));
fprintf(stderr,
"DnD %s:%d: Property atom = %s\n",
__FILE__,
......@@ -191,11 +191,11 @@ void handle_dnd_selection_notify(XSelectionEvent *e)
if (dnd_atom == None) {
if (dnd_debug)
fprintf(stderr, "No matching datatypes.\n");
fprintf(stderr, "tint2: No matching datatypes.\n");
} else {
// Request the data type we are able to select
if (dnd_debug)
fprintf(stderr, "Now requsting type %s", GetAtomName(server.display, dnd_atom));
fprintf(stderr, "tint2: Now requsting type %s", GetAtomName(server.display, dnd_atom));
XConvertSelection(server.display,
dnd_selection,
dnd_atom,
......@@ -206,11 +206,11 @@ void handle_dnd_selection_notify(XSelectionEvent *e)
} else if (target == dnd_atom) {
// Dump the binary data
if (dnd_debug) {
fprintf(stderr, "DnD %s:%d: Data begins:\n", __FILE__, __LINE__);
fprintf(stderr, "--------\n");
fprintf(stderr, "tint2: DnD %s:%d: Data begins:\n", __FILE__, __LINE__);
fprintf(stderr, "tint2: --------\n");
for (int i = 0; i < prop.nitems * prop.format / 8; i++)
fprintf(stderr, "%c", ((char *)prop.data)[i]);
fprintf(stderr, "--------\n");
fprintf(stderr, "tint2: %c", ((char *)prop.data)[i]);
fprintf(stderr, "tint2: --------\n");
}
int cmd_length = 0;
......@@ -262,7 +262,7 @@ void handle_dnd_selection_notify(XSelectionEvent *e)
strcat(cmd, "\"");
strcat(cmd, "&)");
if (dnd_debug)
fprintf(stderr, "DnD %s:%d: Running command: %s\n", __FILE__, __LINE__, cmd);
fprintf(stderr, "tint2: DnD %s:%d: Running command: %s\n", __FILE__, __LINE__, cmd);
tint_exec(cmd, NULL, NULL, e->time, NULL, 0, 0);
free(cmd);
......
......@@ -108,7 +108,7 @@ void destroy_execp(void *obj)
free_and_null(execp->backend->uwheel_command);
if (execp->backend->instances) {
fprintf(stderr, "Error: Attempt to destroy backend while there are still frontend instances!\n");
fprintf(stderr, "tint2: Error: Attempt to destroy backend while there are still frontend instances!\n");
exit(-1);
}
free(execp->backend);
......@@ -609,7 +609,7 @@ void execp_timer_callback(void *arg)
int pipe_fd_stdout[2];
if (pipe(pipe_fd_stdout)) {
// TODO maybe write this in tooltip, but if this happens we're screwed anyways
fprintf(stderr, "Execp: Creating pipe failed!\n");
fprintf(stderr, "tint2: Execp: Creating pipe failed!\n");
return;
}
......@@ -620,7 +620,7 @@ void execp_timer_callback(void *arg)
close(pipe_fd_stdout[1]);
close(pipe_fd_stdout[0]);
// TODO maybe write this in tooltip, but if this happens we're screwed anyways
fprintf(stderr, "Execp: Creating pipe failed!\n");
fprintf(stderr, "tint2: Execp: Creating pipe failed!\n");
return;
}
......@@ -630,14 +630,14 @@ void execp_timer_callback(void *arg)
pid_t child = fork();
if (child == -1) {
// TODO maybe write this in tooltip, but if this happens we're screwed anyways
fprintf(stderr, "Fork failed.\n");
fprintf(stderr, "tint2: Fork failed.\n");
close(pipe_fd_stdout[1]);
close(pipe_fd_stdout[0]);
close(pipe_fd_stderr[1]);
close(pipe_fd_stderr[0]);
return;
} else if (child == 0) {
fprintf(stderr, "Executing: %s\n", execp->backend->command);
fprintf(stderr, "tint2: Executing: %s\n", execp->backend->command);
// We are in the child
close(pipe_fd_stdout[0]);
dup2(pipe_fd_stdout[1], 1); // 1 is stdout
......@@ -649,8 +649,7 @@ void execp_timer_callback(void *arg)
setpgid(0, 0);
execl("/bin/sh", "/bin/sh", "-c", execp->backend->command, NULL);
// This should never happen!
fprintf(stdout, "execl() failed\nexecl() failed\n");
fflush(stdout);
fprintf(stderr, "execl() failed\nexecl() failed\n");
exit(0);
}
close(pipe_fd_stdout[1]);
......
......@@ -115,7 +115,7 @@ void detect_compositor(void *arg)
if (XGetSelectionOwner(server.display, server.atom._NET_WM_CM_S0) != None) {
stop_timeout(detect_compositor_timer);
// Restart tint2
fprintf(stderr, "Detected compositor, restarting tint2...\n");
fprintf(stderr, "tint2: Detected compositor, restarting tint2...\n");
kill(getpid(), SIGUSR1);
}
}
......@@ -181,7 +181,7 @@ void init_X11_pre_config()
{
server.display = XOpenDisplay(NULL);
if (!server.display) {
fprintf(stderr, "tint2: could not open display.\n");
fprintf(stderr, "tint2: could not open display!\n");
exit(1);
}
server.x11_fd = ConnectionNumber(server.display);
......@@ -220,7 +220,7 @@ void init(int argc, char **argv)
init_X11_pre_config();
if (!config_read()) {
fprintf(stderr, "Could not read config file.\n");
fprintf(stderr, "tint2: Could not read config file.\n");
print_usage();
cleanup();
return;
......
......@@ -116,7 +116,7 @@ gboolean read_desktop_file_full_path(const char *path, DesktopEntry *entry)
FILE *fp = fopen(path, "rt");
if (fp == NULL) {
fprintf(stderr, "Could not open file %s\n", path);
fprintf(stderr, "tint2: Could not open file %s\n", path);
return FALSE;
}
......@@ -126,14 +126,14 @@ gboolean read_desktop_file_full_path(const char *path, DesktopEntry *entry)
int lang_index_default = 1;
#define LANG_DBG 0
if (LANG_DBG)
fprintf(stderr, "Languages:");
fprintf(stderr, "tint2: Languages:");
for (int i = 0; languages[i]; i++) {
lang_index_default = i + 1;
if (LANG_DBG)
fprintf(stderr, " %s", languages[i]);
fprintf(stderr, "tint2: %s", languages[i]);
}
if (LANG_DBG)
fprintf(stderr, "\n");
fprintf(stderr, "tint2: \n");
// we currently do not know about any Name key at all, so use an invalid index
int lang_index_name = lang_index_default + 1;
int lang_index_generic_name = lang_index_default + 1;
......@@ -278,11 +278,11 @@ void free_desktop_entry(DesktopEntry *entry)
void test_read_desktop_file()
{
fprintf(stdout, "\033[1;33m");
fprintf(stderr, YELLOW);
DesktopEntry entry;
read_desktop_file("/usr/share/applications/firefox.desktop", &entry);
fprintf(stderr, "Name:%s GenericName:%s Icon:%s Exec:%s\n", entry.name, entry.generic_name, entry.icon, entry.exec);
fprintf(stdout, "\033[0m");
fprintf(stderr, "tint2: Name:%s GenericName:%s Icon:%s Exec:%s\n", entry.name, entry.generic_name, entry.icon, entry.exec);
fprintf(stderr, RESET);
}
GSList *apps_locations = NULL;
......
This diff is collapsed.
......@@ -297,7 +297,7 @@ gboolean resize_launcher(void *obj)
launcherIcon->y = posy;
launcherIcon->x = posx;
launcher_icon_on_change_layout(launcherIcon);
// fprintf(stderr, "launcher %d : %d,%d\n", i, posx, posy);
// fprintf(stderr, "tint2: launcher %d : %d,%d\n", i, posx, posy);
if (panel_horizontal) {
if (i % icons_per_column) {
posy += launcher->icon_size + launcher->area.paddingx;
......@@ -385,7 +385,7 @@ void draw_launcher_icon(void *obj, cairo_t *c)
void launcher_icon_dump_geometry(void *obj, int indent)
{
LauncherIcon *launcherIcon = (LauncherIcon *)obj;
fprintf(stderr, "%*sIcon: w = h = %d, name = %s\n", indent, "", launcherIcon->icon_size, launcherIcon->icon_name);
fprintf(stderr, "tint2: %*sIcon: w = h = %d, name = %s\n", indent, "", launcherIcon->icon_size, launcherIcon->icon_name);
}
Imlib_Image scale_icon(Imlib_Image original, int icon_size)
......@@ -545,7 +545,7 @@ void launcher_reload_icon_image(Launcher *launcher, LauncherIcon *launcherIcon)
free_icon(original);
free(launcherIcon->icon_path);
launcherIcon->icon_path = new_icon_path;
// fprintf(stderr, "launcher.c %d: Using icon %s\n", __LINE__, launcherIcon->icon_path);
// fprintf(stderr, "tint2: launcher.c %d: Using icon %s\n", __LINE__, launcherIcon->icon_path);
if (panel_config.mouse_effects) {
launcherIcon->image_hover = adjust_icon(launcherIcon->image,
......
......@@ -48,7 +48,7 @@ void xsettings_notify_cb(const char *name, XSettingsAction action, XSettingsSett
{
if ((action == XSETTINGS_ACTION_NEW || action == XSETTINGS_ACTION_CHANGED) && name != NULL && setting != NULL) {
if (strcmp(name, "Net/IconThemeName") == 0 && setting->type == XSETTINGS_TYPE_STRING) {
fprintf(stderr, "xsettings: %s = %s\n", name, setting->data.v_string);
fprintf(stderr, "tint2: xsettings: %s = %s\n", name, setting->data.v_string);
if (icon_theme_name_xsettings) {
if (strcmp(icon_theme_name_xsettings, setting->data.v_string) == 0)
return;
......@@ -57,7 +57,7 @@ void xsettings_notify_cb(const char *name, XSettingsAction action, XSettingsSett
icon_theme_name_xsettings = strdup(setting->data.v_string);
default_icon_theme_changed();
} else if (strcmp(name, "Gtk/FontName") == 0 && setting->type == XSETTINGS_TYPE_STRING) {
fprintf(stderr, "xsettings: %s = %s\n", name, setting->data.v_string);
fprintf(stderr, "tint2: xsettings: %s = %s\n", name, setting->data.v_string);
if (default_font) {
if (strcmp(default_font, setting->data.v_string) == 0)
return;
......@@ -191,7 +191,7 @@ static XSettingsList *parse_settings(unsigned char *data, size_t len)
result = fetch_card8(&buffer, (CARD8 *)&buffer.byte_order);
if (buffer.byte_order != MSBFirst && buffer.byte_order != LSBFirst) {
fprintf(stderr, "Invalid byte order %x in XSETTINGS property\n", buffer.byte_order);
fprintf(stderr, "tint2: Invalid byte order %x in XSETTINGS property\n", buffer.byte_order);
result = XSETTINGS_FAILED;
goto out;
}
......@@ -312,13 +312,13 @@ out:
if (result != XSETTINGS_SUCCESS) {
switch (result) {
case XSETTINGS_NO_MEM:
fprintf(stderr, "Out of memory reading XSETTINGS property\n");
fprintf(stderr, "tint2: Out of memory reading XSETTINGS property\n");
break;
case XSETTINGS_ACCESS:
fprintf(stderr, "Invalid XSETTINGS property (read off end)\n");
fprintf(stderr, "tint2: Invalid XSETTINGS property (read off end)\n");
break;
case XSETTINGS_DUPLICATE_ENTRY:
fprintf(stderr, "Duplicate XSETTINGS entry for '%s'\n", setting->name);
fprintf(stderr, "tint2: Duplicate XSETTINGS entry for '%s'\n", setting->name);
case XSETTINGS_FAILED:
case XSETTINGS_SUCCESS:
case XSETTINGS_NO_ENTRY:
......@@ -365,7 +365,7 @@ static void read_settings(XSettingsClient *client)
if (result == Success && type == server.atom._XSETTINGS_SETTINGS) {
if (format != 8) {
fprintf(stderr, "Invalid format for XSETTINGS property %d", format);
fprintf(stderr, "tint2: Invalid format for XSETTINGS property %d", format);
} else
client->settings = parse_settings(data, n_items);
XFree(data);
......@@ -420,7 +420,7 @@ XSettingsClient *xsettings_client_new(Display *display,
check_manager_window(client);
if (client->manager_window == None) {
fprintf(stderr, "No XSETTINGS manager, tint2 uses config option 'launcher_icon_theme'.\n");
fprintf(stderr, "tint2: No XSETTINGS manager, tint2 uses config option 'launcher_icon_theme'.\n");
free(client);
return NULL;
} else {
......
......@@ -104,7 +104,7 @@ void handle_event_property_notify(XEvent *e)
// Change name of desktops
else if (at == server.atom._NET_DESKTOP_NAMES) {
if (debug)
fprintf(stderr, "%s %d: win = root, atom = _NET_DESKTOP_NAMES\n", __FUNCTION__, __LINE__);
fprintf(stderr, "tint2: %s %d: win = root, atom = _NET_DESKTOP_NAMES\n", __FUNCTION__, __LINE__);
update_desktop_names();
}
// Change desktops
......@@ -112,7 +112,7 @@ void handle_event_property_notify(XEvent *e)
at == server.atom._NET_DESKTOP_VIEWPORT || at == server.atom._NET_WORKAREA ||
at == server.atom._NET_CURRENT_DESKTOP) {
if (debug)
fprintf(stderr, "%s %d: win = root, atom = ?? desktops changed\n", __FUNCTION__, __LINE__);
fprintf(stderr, "tint2: %s %d: win = root, atom = ?? desktops changed\n", __FUNCTION__, __LINE__);
if (!taskbar_enabled)
return;
int old_num_desktops = server.num_desktops;
......@@ -202,7 +202,7 @@ void handle_event_property_notify(XEvent *e)
// Window list
else if (at == server.atom._NET_CLIENT_LIST) {
if (debug)
fprintf(stderr, "%s %d: win = root, atom = _NET_CLIENT_LIST\n", __FUNCTION__, __LINE__);
fprintf(stderr, "tint2: %s %d: win = root, atom = _NET_CLIENT_LIST\n", __FUNCTION__, __LINE__);
taskbar_refresh_tasklist();
update_all_taskbars_visibility();
schedule_panel_redraw();
......@@ -210,12 +210,12 @@ void handle_event_property_notify(XEvent *e)
// Change active
else if (at == server.atom._NET_ACTIVE_WINDOW) {
if (debug)
fprintf(stderr, "%s %d: win = root, atom = _NET_ACTIVE_WINDOW\n", __FUNCTION__, __LINE__);
fprintf(stderr, "tint2: %s %d: win = root, atom = _NET_ACTIVE_WINDOW\n", __FUNCTION__, __LINE__);
reset_active_task();
schedule_panel_redraw();
} else if (at == server.atom._XROOTPMAP_ID || at == server.atom._XROOTMAP_ID) {
if (debug)
fprintf(stderr, "%s %d: win = root, atom = _XROOTPMAP_ID\n", __FUNCTION__, __LINE__);
fprintf(stderr, "tint2: %s %d: win = root, atom = _XROOTPMAP_ID\n", __FUNCTION__, __LINE__);
// change Wallpaper
for (int i = 0; i < num_panels; i++) {
set_panel_background(&panels[i]);
......@@ -243,7 +243,7 @@ void handle_event_property_notify(XEvent *e)
}
if (!task) {
if (debug)
fprintf(stderr, "%s %d\n", __FUNCTION__, __LINE__);
fprintf(stderr, "tint2: %s %d\n", __FUNCTION__, __LINE__);
if (at == server.atom._NET_WM_STATE) {
// xfce4 sends _NET_WM_STATE after minimized to tray, so we need to check if window is mapped
// if it is mapped and not set as skip_taskbar, we must add it to our task list
......@@ -256,7 +256,7 @@ void handle_event_property_notify(XEvent *e)
}
return;
}
// fprintf(stderr, "atom root_win = %s, %s\n", XGetAtomName(server.display, at), task->title);
// fprintf(stderr, "tint2: atom root_win = %s, %s\n", XGetAtomName(server.display, at), task->title);
// Window title changed
if (at == server.atom._NET_WM_VISIBLE_NAME || at == server.atom._NET_WM_NAME || at == server.atom.WM_NAME) {
......@@ -277,7 +277,7 @@ void handle_event_property_notify(XEvent *e)
Atom *atom_state = server_get_property(win, server.atom._NET_WM_STATE, XA_ATOM, &count);
for (int j = 0; j < count; j++) {
char *atom_state_name = XGetAtomName(server.display, atom_state[j]);
fprintf(stderr, "%s %d: _NET_WM_STATE = %s\n", __FUNCTION__, __LINE__, atom_state_name);
fprintf(stderr, "tint2: %s %d: _NET_WM_STATE = %s\n", __FUNCTION__, __LINE__, atom_state_name);
XFree(atom_state_name);
}
XFree(atom_state);
......@@ -305,7 +305,7 @@ void handle_event_property_notify(XEvent *e)
// Window desktop changed
else if (at == server.atom._NET_WM_DESKTOP) {
int desktop = get_window_desktop(win);
// fprintf(stderr, " Window desktop changed %d, %d\n", task->desktop, desktop);
// fprintf(stderr, "tint2: Window desktop changed %d, %d\n", task->desktop, desktop);
// bug in windowmaker : send unecessary 'desktop changed' when focus changed
if (desktop != task->desktop) {
task_update_desktop(task);
......@@ -779,13 +779,13 @@ void tint2(int argc, char **argv, gboolean *restart)
if (get_signal_pending()) {
cleanup();
if (get_signal_pending() == SIGUSR1) {
fprintf(stderr, YELLOW "%s %d: restarting tint2..." RESET "\n", __FILE__, __LINE__);
fprintf(stderr, YELLOW "tint2: %s %d: restarting tint2..." RESET "\n", __FILE__, __LINE__);
*restart = TRUE;
return;
} else if (get_signal_pending() == SIGUSR2) {
fprintf(stderr, YELLOW "%s %d: reexecuting tint2..." RESET "\n", __FILE__, __LINE__);
fprintf(stderr, YELLOW "tint2: %s %d: reexecuting tint2..." RESET "\n", __FILE__, __LINE__);
if (execvp(argv[0], argv) == -1) {
fprintf(stderr, RED "%s %d: failed!" RESET "\n", __FILE__, __LINE__);
fprintf(stderr, RED "tint2: %s %d: failed!" RESET "\n", __FILE__, __LINE__);
return;
}
} else {
......
......@@ -177,11 +177,11 @@ void init_panel()
{
if (panel_config.monitor > (server.num_monitors - 1)) {
// server.num_monitors minimum value is 1 (see get_monitors())
fprintf(stderr, "warning : monitor not found. tint2 default to all monitors.\n");
fprintf(stderr, "tint2: warning : monitor not found. tint2 default to all monitors.\n");
panel_config.monitor = 0;
}
fprintf(stderr, "panel items: %s\n", panel_items_order);
fprintf(stderr, "tint2: panel items: %s\n", panel_items_order);
icon_theme_wrapper = NULL;
......@@ -209,7 +209,7 @@ void init_panel()
}
fprintf(stderr,
"tint2 : nb monitors %d, nb monitors used %d, nb desktops %d\n",
"tint2: nb monitors %d, nb monitors used %d, nb desktops %d\n",
server.num_monitors,
num_panels,
server.num_desktops);
......@@ -289,7 +289,7 @@ void init_panel()
XGCValues gcv;
server.gc = XCreateGC(server.display, p->main_win, 0, &gcv);
}
// fprintf(stderr, "panel %d : %d, %d, %d, %d\n", i, p->posx, p->posy, p->area.width, p->area.height);
// fprintf(stderr, "tint2: panel %d : %d, %d, %d, %d\n", i, p->posx, p->posy, p->area.width, p->area.height);
set_panel_properties(p);
set_panel_background(p);
if (!snapshot_path) {
......@@ -322,7 +322,7 @@ void panel_compute_size(Panel *panel)
if (panel->fractional_height)
panel->area.height = (server.monitors[panel->monitor].height - panel->marginy) * panel->area.height / 100;
if (panel->area.bg->border.radius > panel->area.height / 2) {
fprintf(stderr, "panel_background_id rounded is too big... please fix your tint2rc\n");
fprintf(stderr, "tint2: panel_background_id rounded is too big... please fix your tint2rc\n");
g_array_append_val(backgrounds, *panel->area.bg);
panel->area.bg = &g_array_index(backgrounds, Background, backgrounds->len - 1);
panel->area.bg->border.radius = panel->area.height / 2;
......@@ -348,7 +348,7 @@ void panel_compute_size(Panel *panel)
panel->area.width = old_panel_height;
if (panel->area.bg->border.radius > panel->area.width / 2) {
fprintf(stderr, "panel_background_id rounded is too big... please fix your tint2rc\n");
fprintf(stderr, "tint2: panel_background_id rounded is too big... please fix your tint2rc\n");
g_array_append_val(backgrounds, *panel->area.bg);
panel->area.bg = &g_array_index(backgrounds, Background, backgrounds->len - 1);
panel->area.bg->border.radius = panel->area.width / 2;
......@@ -401,7 +401,7 @@ void panel_compute_position(Panel *panel)
panel->hidden_width = panel->area.width - diff;
panel->hidden_height = panel->area.height;
}
// fprintf(stderr, "panel : posx %d, posy %d, width %d, height %d\n", panel->posx, panel->posy, panel->area.width,
// fprintf(stderr, "tint2: panel : posx %d, posy %d, width %d, height %d\n", panel->posx, panel->posy, panel->area.width,
// panel->area.height);
}
......@@ -416,7 +416,7 @@ gboolean resize_panel(void *obj)
Panel *panel = (Panel *)obj;
relayout_with_constraint(&panel->area, 0);
// fprintf(stderr, "resize_panel\n");
// fprintf(stderr, "tint2: resize_panel\n");
if (taskbar_mode != MULTI_DESKTOP && taskbar_enabled) {
// propagate width/height on hidden taskbar
int width = panel->taskbar[server.desktop].area.width;
......@@ -1146,7 +1146,7 @@ void _schedule_panel_redraw(const char *file, const char *function, const int li
{
panel_refresh = TRUE;
if (debug_fps) {
fprintf(stderr, YELLOW "%s %s %d: triggering panel redraw" RESET "\n", file, function, line);
fprintf(stderr, YELLOW "tint2: %s %s %d: triggering panel redraw" RESET "\n", file, function, line);
}
}
......
......@@ -162,10 +162,10 @@ struct Property read_property(Display *disp, Window w, Atom property)
read_bytes *= 2;