update_text();
#ifdef X11
}
-#ifdef OWN_WINDOW
- if (own_window) {
- set_transparent_background(window.window);
- }
-#endif
}
if (need_to_update) {
if (own_window) {
/* resize window if it isn't right size */
if (!fixed_size &&
- (text_width + border_margin * 2 !=
+ (text_width + border_margin * 2 + 1 !=
window.width
- || text_height + border_margin * 2 !=
+ || text_height + border_margin * 2 + 1 !=
window.height)) {
window.width =
text_width +
window.window,
window.width,
window.height);
+ if (own_window) {
+ set_transparent_background(window.window);
+ }
}
/* move window if it isn't in right position */
{
static int rep, rep2;
char acpi_path[128];
- int design_capacity;
snprintf(acpi_path, 127, ACPI_BATTERY_BASE_PATH "/%s/state", bat);
/* don't update battery too often */
char b[256];
if (fgets(b, 256, fp) == NULL)
break;
- if (sscanf(b, "design capacity: %d", &design_capacity) != 0) {
- continue;
- }
if (sscanf(b, "last full capacity: %d", &acpi_last_full) != 0) {
break;
}
/* thanks to Lukas Zapletal <lzap@seznam.cz> */
else if (strcmp(charging_state, "charged") == 0) {
if (acpi_last_full != 0 && remaining_capacity != acpi_last_full) {
- sprintf(last_battery_str, "charged %d%%", remaining_capacity * 100 / design_capacity);
+ sprintf(last_battery_str, "charged 100%");
} else {
strcpy(last_battery_str, "charged");
}