From 4f5d0da56f5099c6c5b8428400c81670ef68db94 Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Tue, 7 Mar 2006 06:24:58 +0000 Subject: [PATCH] batt fixed? x11 stuff git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@552 7f574dfc-610e-0410-a909-a81674777703 --- src/conky.c | 12 +++++------- src/linux.c | 6 +----- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/conky.c b/src/conky.c index c71a60e1..343082e0 100644 --- a/src/conky.c +++ b/src/conky.c @@ -4430,11 +4430,6 @@ static void main_loop() update_text(); #ifdef X11 } -#ifdef OWN_WINDOW - if (own_window) { - set_transparent_background(window.window); - } -#endif } if (need_to_update) { @@ -4449,9 +4444,9 @@ static void main_loop() 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 + @@ -4463,6 +4458,9 @@ static void main_loop() window.window, window.width, window.height); + if (own_window) { + set_transparent_background(window.window); + } } /* move window if it isn't in right position */ diff --git a/src/linux.c b/src/linux.c index a8535321..0ad6676e 100644 --- a/src/linux.c +++ b/src/linux.c @@ -1087,7 +1087,6 @@ void get_battery_stuff(char *buf, unsigned int n, const char *bat) { 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 */ @@ -1120,9 +1119,6 @@ void get_battery_stuff(char *buf, unsigned int n, const char *bat) 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; } @@ -1187,7 +1183,7 @@ void get_battery_stuff(char *buf, unsigned int n, const char *bat) /* thanks to Lukas Zapletal */ 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"); }