batt fixed? x11 stuff
authorBrenden Matthews <brenden1@rty.ca>
Tue, 7 Mar 2006 06:24:58 +0000 (06:24 +0000)
committerBrenden Matthews <brenden1@rty.ca>
Tue, 7 Mar 2006 06:24:58 +0000 (06:24 +0000)
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@552 7f574dfc-610e-0410-a909-a81674777703

src/conky.c
src/linux.c

index c71a60e..343082e 100644 (file)
@@ -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 */
index a853532..0ad6676 100644 (file)
@@ -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 <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");
                        }