added own_window_type override
authorPhilip Kovacs <pkovacs@users.sourceforge.net>
Thu, 9 Mar 2006 02:28:38 +0000 (02:28 +0000)
committerPhilip Kovacs <pkovacs@users.sourceforge.net>
Thu, 9 Mar 2006 02:28:38 +0000 (02:28 +0000)
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@570 7f574dfc-610e-0410-a909-a81674777703

README
doc/config_settings.xml
doc/conky.1
doc/conkyrc.sample
src/conky.c
src/conky.h
src/x11.c
vim/syntax/conkyrc.vim

diff --git a/README b/README
index 4d2a99f..75afd0b 100644 (file)
--- a/README
+++ b/README
@@ -284,11 +284,13 @@ CONFIGURATION SETTINGS
 
 
        own_window_type
-             if own_window is yes, you may specify  type  normal  or  desktop
-             (default:  normal).   Desktop  windows  are special windows that
-             have no window decorations; are always visible on your  desktop;
-             do  not  appear  in your pager or taskbar; and are sticky across
-             all workspaces.
+             if own_window is yes, you may specify type  normal,  desktop  or
+             override (default: normal).  Desktop windows are special windows
+             that have no window decorations;  are  always  visible  on  your
+             desktop;  do not appear in your pager or taskbar; and are sticky
+             across all workspaces.  Override windows are not under the  con-
+             trol  of the window manager. This type can be useful for certain
+             situations.
 
 
        own_window_colour colour
index b4e0297..90a7c9b 100644 (file)
 <varlistentry>
        <term><command><option>own_window_type</option></command></term>
        <listitem>
-               if own_window is yes, you may specify type normal or desktop (default: normal).
+               if own_window is yes, you may specify type normal, desktop or override (default: normal).
                Desktop windows are special windows that have no window decorations; are always visible 
                on your desktop; do not appear in your pager or taskbar; and are sticky across all workspaces.
+               Override windows are not under the control of the window manager.  This type can be useful 
+               for certain situations.
                <para></para></listitem>
 </varlistentry>
 
index a733283..b4e9f75 100644 (file)
@@ -264,9 +264,11 @@ Boolean, set pseudo-transparency?
 
 .TP 
 \fBown_window_type\fR
-if own_window is yes, you may specify type normal or desktop (default: normal).
+if own_window is yes, you may specify type normal, desktop or override (default: normal).
 Desktop windows are special windows that have no window decorations; are always visible 
 on your desktop; do not appear in your pager or taskbar; and are sticky across all workspaces.
+Override windows are not under the control of the window manager. This type can be useful 
+for certain situations.
 
 .TP 
 \fBown_window_colour\fR \fBcolour\fR 
index 5063a16..dc07865 100644 (file)
@@ -54,7 +54,7 @@ total_run_times 0
 own_window yes
 
 # If own_window is yes, you may use type normal or desktop
-own_window desktop
+own_window normal
 
 # Use pseudo transparency with own_window?
 own_window_transparent yes
index c3a5089..7b642b9 100644 (file)
@@ -5315,6 +5315,8 @@ else if (strcasecmp(name, a) == 0 || strcasecmp(name, b) == 0)
                                        window.type = TYPE_NORMAL;
                                else if  (strncmp(value,"desktop",7)==0)
                                        window.type = TYPE_DESKTOP;
+                               else if (strncmp(value,"override",8)==0)
+                                       window.type = TYPE_OVERRIDE;
                                else
                                        CONF_ERR;
                        }
index 4eade74..c6908f3 100644 (file)
@@ -302,7 +302,8 @@ char tmpstring2[TEXT_BUFFER_SIZE];
 #ifdef OWN_WINDOW
 enum _window_type {
         TYPE_NORMAL = 0,
-        TYPE_DESKTOP
+        TYPE_DESKTOP,
+       TYPE_OVERRIDE
 };
 
 enum _window_hints {
index 24f1d5f..45d03ae 100644 (file)
--- a/src/x11.c
+++ b/src/x11.c
@@ -208,8 +208,11 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour, c
                         * events are now explicitly forwarded to the desktop window. */
                        XSetWindowAttributes attrs = {
                                ParentRelative,0L,0,0L,0,0,Always,0L,0L,False,
-                               StructureNotifyMask|ExposureMask|ButtonPressMask|ButtonReleaseMask,
-                               0L,False,0,0 };
+                               StructureNotifyMask|ExposureMask|
+                               (window.type==TYPE_OVERRIDE ? ButtonPressMask|ButtonReleaseMask : 0),
+                               0L,
+                               (window.type==TYPE_OVERRIDE ? True : False),
+                               0,0 };
 
                        XClassHint classHint;
                        XWMHints wmHint;
@@ -222,13 +225,14 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour, c
                        if ( !find_desktop_window( &window.root, &window.desktop ) )
                            return;
 
-                       window.window = XCreateWindow(display, window.root, 
-                                                     window.x, window.y, w, h, 0, 
-                                                     CopyFromParent,
-                                                     InputOutput,
-                                                     CopyFromParent,
-                                                     CWBackPixel|CWOverrideRedirect,
-                                                     &attrs);
+                       window.window = XCreateWindow(display, 
+                                                  window.type==TYPE_OVERRIDE ? window.desktop : window.root, 
+                                                  window.x, window.y, w, h, 0, 
+                                                  CopyFromParent,
+                                                  InputOutput,
+                                                  CopyFromParent,
+                                                  CWBackPixel|CWOverrideRedirect,
+                                                  &attrs);
 
                        fprintf(stderr, "Conky: drawing to created window (%lx)\n", window.window);
                        fflush(stderr);
@@ -262,6 +266,11 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour, c
                                        }
                                        break;
                                
+                               case TYPE_OVERRIDE:
+                                       {
+                                       fprintf(stderr, "Conky: window type - override\n"); fflush(stderr);
+                                       }
+                                       break;
                                case TYPE_NORMAL:
                                default:
                                        {
@@ -270,10 +279,11 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour, c
                                        }
                                        break;
                                }
-                               XChangeProperty(display, window.window, xa,
-                                               XA_ATOM, 32,
-                                               PropModeReplace,
-                                               (unsigned char *) &prop, 1);
+                               if (window.type != TYPE_OVERRIDE)
+                                       XChangeProperty(display, window.window, xa,
+                                                       XA_ATOM, 32,
+                                                       PropModeReplace,
+                                                       (unsigned char *) &prop, 1);
                        }
 
                        /* Set desired hints */
@@ -394,8 +404,10 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour, c
                             }
                         }
 
+                       if (window.type == TYPE_OVERRIDE)
+                               XLowerWindow(display, window.window);   
+                       
                        XMapWindow(display, window.window);
-
                }
        } else
 #endif
index 8a0a108..9750936 100644 (file)
@@ -75,6 +75,7 @@ syn keyword ConkyrcConstant
         \ no
         \ none
        \ normal
+       \ override
         \ skip_pager
         \ skip_taskbar
         \ sticky
@@ -119,7 +120,6 @@ syn keyword ConkyrcVarName contained nextgroup=ConkyrcNumber,ConkyrcColour skipw
        \ buffers 
        \ cached 
        \ color 
-       \ colour 
        \ colour 
        \ cpu 
        \ cpubar