else if (strcmp (key, "time1_format") == 0) {
if (new_config_file == 0) {
clock_enabled = 1;
- if (panel_items_order)
- panel_items_order = strcat(panel_items_order, "C");
+ if (panel_items_order) {
+ char* tmp = g_strconcat(panel_items_order, "C", NULL);
+ g_free( panel_items_order );
+ panel_items_order = tmp;
+ }
else
- panel_items_order = strdup("C");
+ panel_items_order = g_strdup("C");
}
if (strlen(value) > 0) {
time1_format = strdup (value);
if (new_config_file == 0) {
systray_enabled = atoi(value);
if (systray_enabled) {
- if (panel_items_order)
- panel_items_order = strcat(panel_items_order, "S");
- else
- panel_items_order = strdup("S");
+ if (panel_items_order) {
+ char* tmp = g_strconcat(panel_items_order, "S", NULL);
+ g_free( panel_items_order );
+ panel_items_order = tmp;
+ }
+ else
+ panel_items_order = g_strdup("S");
}
}
}
if (new_config_file == 0) {
battery_enabled = atoi(value);
if (battery_enabled) {
- if (panel_items_order)
- panel_items_order = strcat(panel_items_order, "B");
- else
- panel_items_order = strdup("B");
+ if (panel_items_order) {
+ char* tmp = g_strconcat(panel_items_order, "B", NULL);
+ g_free( panel_items_order );
+ panel_items_order = tmp;
+ }
+ else
+ panel_items_order = g_strdup("B");
}
}
}
if (new_config_file == 0) {
taskbar_enabled = 1;
if (panel_items_order) {
- char *tmp = strdup("T");
- panel_items_order = strcat(tmp, panel_items_order);
+ char* tmp = g_strconcat( "T", panel_items_order, NULL );
+ g_free(panel_items_order);
+ panel_items_order = tmp;
}
else
- panel_items_order = strdup("T");
+ panel_items_order = g_strdup("T");
}
return 1;
// we made also sure, that we always have a 32 bit visual, i.e. we can safely create 32 bit pixmaps here
TrayWindow* traywin = t;
traywin->render_timeout = 0;
+ if ( traywin->width == 0 || traywin->height == 0 ) {
+ // reschedule rendering since the geometry information has not yet been processed (can happen on slow cpu)
+ systray_render_icon(traywin);
+ return;
+ }
// good systray icons support 32 bit depth, but some icons are still 24 bit.
// We create a heuristic mask for these icons, i.e. we get the rgb value in the top left corner, and