on_bottom option added
authorelektronisch <elektronisch@users.sourceforge.net>
Mon, 8 Aug 2005 00:54:29 +0000 (00:54 +0000)
committerelektronisch <elektronisch@users.sourceforge.net>
Mon, 8 Aug 2005 00:54:29 +0000 (00:54 +0000)
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@78 7f574dfc-610e-0410-a909-a81674777703

AUTHORS
conky.c
conky.h
metarinfo.c
x11.c

diff --git a/AUTHORS b/AUTHORS
index 5443877..85bec29 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -39,12 +39,22 @@ Gwenhael LE MOINE <cycojesus at yahoo dot fr>
 Hannu Saransaari <hipo at users dot sourceforge dot net>
   Main code
 
+<<<<<<< AUTHORS
+<<<<<<< AUTHORS
+Jason Mitchell <jason.mitchell03 at saintleo dot edu>
+  UTF8 fix
+  Source clean up
+
+=======
+=======
 j-rock - #otw on freenode
   small fix for XFT
 
+>>>>>>> 1.4
 jack_mort - gentoo forums
   $tab patch
 
+>>>>>>> 1.3
 Jarmo Hekkanen
   SETI stuff
 
@@ -101,3 +111,4 @@ Walt Nelson <wnelsonjr at comcast dot net>
 William DiPlacido <bimbasaari at yahoo dot com>
   Frequency from /proc/cpuinfo
   Some other SETI stuff
+
diff --git a/conky.c b/conky.c
index 2aaf5d6..58e6cbd 100644 (file)
--- a/conky.c
+++ b/conky.c
@@ -197,6 +197,9 @@ static unsigned int stuff_in_upper_case;
 static int text_alignment;
 static int gap_x, gap_y;
 
+/* Always on bottom */
+static int on_bottom;
+
 /* Update interval */
 static double update_interval;
 
@@ -3566,6 +3569,7 @@ static enum alignment string_to_alignment(const char *s)
 static void set_default_configurations(void)
 {
        text_alignment = BOTTOM_LEFT;
+       on_bottom = 1;
        fork_to_background = 0;
        border_margin = 3;
        border_width = 1;
@@ -3701,6 +3705,12 @@ else if (strcasecmp(name, a) == 0 || strcasecmp(name, a) == 0)
                        } else
                                CONF_ERR;
                }
+               CONF("on_bottom") {
+                       if(value)
+                               on_bottom = string_to_bool(value);
+                       else
+                               CONF_ERR;
+               }
                CONF("background") {
                        fork_to_background = string_to_bool(value);
                }
@@ -4234,7 +4244,7 @@ int main(int argc, char **argv)
        init_window
            (own_window,
             text_width
-            + border_margin * 2 + 1, text_height + border_margin * 2 + 1);
+            + border_margin * 2 + 1, text_height + border_margin * 2 + 1, on_bottom);
 
        update_text_area();     /* to position text/window on screen */
 
diff --git a/conky.h b/conky.h
index 4ac5083..ae4bc7d 100644 (file)
--- a/conky.h
+++ b/conky.h
@@ -225,7 +225,7 @@ extern int workarea[4];
 extern struct conky_window window;
 
 void init_X11();
-void init_window(int use_own_window, int width, int height);
+void init_window(int use_own_window, int width, int height, int on_bottom);
 void create_gc();
 void set_transparent_background(Window win);
 long get_x11_color(const char *);
index f8ac0ac..a1a94c6 100644 (file)
@@ -167,11 +167,17 @@ void update_metar()
        if (!status) {
                status = 2;
                iret1 = pthread_create(&thread1, NULL, fetch_ftp, NULL);
+<<<<<<< metarinfo.c
+       } else if (status == 2) {       /* thread is still running.  what else can we do? */
+               return;
+       } else {                /* status must be 1 */
+=======
        } else if (status == 2) {       /* thread is still running.  let's kill it and start again */
                pthread_cancel(thread1);
                status = 2;
                iret1 = pthread_create(&thread1, NULL, fetch_ftp, NULL);
        } else {                /* status must be 1 */
+>>>>>>> 1.9
                pthread_join(thread1, NULL);
                status = 2;
                iret1 = pthread_create(&thread1, NULL, fetch_ftp, NULL);
diff --git a/x11.c b/x11.c
index 8fb2892..8c756ea 100644 (file)
--- a/x11.c
+++ b/x11.c
@@ -160,7 +160,7 @@ void set_transparent_background(Window win)
        XClearWindow(display, win);
 }
 
-void init_window(int own_window, int w, int h)
+void init_window(int own_window, int w, int h, int l)
 {
        /* There seems to be some problems with setting transparent background (on
         * fluxbox this time). It doesn't happen always and I don't know why it
@@ -172,8 +172,9 @@ void init_window(int own_window, int w, int h)
                        XSetWindowAttributes attrs;
                        XClassHint class_hints;
 
-                       /* just test color */
+                       /* just test color
                        attrs.background_pixel = get_x11_color("green");
+                       */
 
                        window.window = XCreateWindow(display, RootWindow(display, screen), window.x, window.y, w, h, 0, CopyFromParent,        /* depth */
                                                      CopyFromParent,   /* class */
@@ -216,6 +217,17 @@ void init_window(int own_window, int w, int h)
                                                (unsigned char *) &prop,
                                                1);
                        }
+                       if(l) {
+                       /* make sure the layer is on the bottom */
+         a = XInternAtom(display, "_WIN_LAYER", True);
+         if (a != None) {
+            long prop = 0;
+            XChangeProperty(display, window.window, a,
+            XA_CARDINAL, 32,
+            PropModeReplace,
+            (unsigned char *) &prop, 1);
+         }
+                       }
                }
 
                XMapWindow(display, window.window);