]> Dogcows Code - chaz/tint2/commitdiff
fixed issue 48
authorThierry Lorthiois <lorthiois@bbsoft.fr>
Wed, 25 Feb 2009 20:04:43 +0000 (20:04 +0000)
committerThierry Lorthiois <lorthiois@bbsoft.fr>
Wed, 25 Feb 2009 20:04:43 +0000 (20:04 +0000)
15 files changed:
AUTHORS
doc/tint2-0.7.pdf
src/clock/clock.c
src/config.c
src/server.c
src/server.h
src/systray/systraybar.c
src/systray/systraybar.h
src/taskbar/task.c
src/tint.c
src/tint2
src/util/window.c
src/util/window.h
tintrc01
tintrc02

diff --git a/AUTHORS b/AUTHORS
index e674179755870309cce25ba2d58ce4ed421ca1c7..c01961c5d6ad31e5e96a132ba61a7590bcf7c9ff 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,17 +1,18 @@
 
 tint2 is developped by :
-- 2008 Thierry Lorthiois <lorthiois@bbsoft.fr>, project maintainer
+- 2008-2009 Thierry Lorthiois <lorthiois@bbsoft.fr>, project maintainer
 
 
 tint2 is based on ttm source code (http://code.google.com/p/ttm/)
-- 2007 Pål Staurland <staura@gmail.com>
+- 2007-2008 Pål Staurland <staura@gmail.com>
 
 
 Contributors:
+  Kwaku Yeboah <kwakuyeboah@gmail.com> : wiki page
   Daniel Moerner <dmoerner@gmail.com> : man page and debian package
   Doug Barton : freebsd package
   James Buren <ryuo@frugalware.org> : Frugalware package
   Pierre-Emmanuel Andre <pea@raveland.org> : openbsd port
   Redroar : arch package
-  
-  
+
+
index 06ca8adaacb2e725f2d025aba10f7af58b6b7f73..f9f4ea9bc69eb779e7225c572f9c2f9f5ee0e7df 100644 (file)
Binary files a/doc/tint2-0.7.pdf and b/doc/tint2-0.7.pdf differ
index 19aaf4ac4a82e8fc907d8798f5fb4b96c7f64b48..0a55a8b7591abb89be3b05c1e24ea23f9c960b85 100644 (file)
@@ -163,13 +163,14 @@ void resize_clock (void *obj)
    else new_width = date_width;
    new_width += (2*clock->area.paddingxlr) + (2*clock->area.pix.border.width);
 
-   if (new_width > clock->area.width || new_width < (clock->area.width-3)) {
+   if (new_width > clock->area.width || new_width < (clock->area.width-6)) {
       int i;
       Panel *panel = ((Area*)obj)->panel;
 
-      //printf("clock_width %d, new_width %d\n", clock->area.width, new_width);
+      printf("clock_width %d, new_width %d\n", clock->area.width, new_width);
       // resize clock
-      clock->area.width = new_width;
+      // we try to limit the number of resize
+      clock->area.width = new_width + 1;
       clock->area.posx = panel->area.width - clock->area.width - panel->area.paddingxlr - panel->area.pix.border.width;
 
       // resize other objects on panel
index 757eff6e73b915ee34ddb89e840ea5402a43082c..98938e4dae425ffd72382e2e5cc7633203c2a285 100644 (file)
@@ -513,7 +513,7 @@ void add_entry (char *key, char *value)
    }
 
    else
-      fprintf(stderr, "Invalid option: \"%s\", correct your config file\n", key);
+      fprintf(stderr, "tint2 : invalid option \"%s\", correct your config file\n", key);
 
    if (value1) free (value1);
    if (value2) free (value2);
@@ -601,61 +601,70 @@ void config_finish ()
 int config_read ()
 {
    const gchar * const * system_dirs;
-   char *path1, *path2, *dir;
+   char *path1;
    gint i;
 
        save_file_config = 0;
 
+   // follow XDG specification
 deb:
-   // check tint2rc file according to XDG specification
+   // check tint2rc in user directory
    path1 = g_build_filename (g_get_user_config_dir(), "tint2", "tint2rc", NULL);
-   if (!g_file_test (path1, G_FILE_TEST_EXISTS)) {
+   if (g_file_test (path1, G_FILE_TEST_EXISTS)) {
+               i = config_read_file (path1);
+               g_free(path1);
+          return i;
+       }
 
-               if (save_file_config) {
-                  fprintf(stderr, "tint2 error : enable to write $HOME/.config/tint2/tint2rc\n");
-                       exit(0);
-               }
-               // check old tintrc config file
-               path1 = g_build_filename (g_get_user_config_dir(), "tint", "tintrc", NULL);
-               if (g_file_test (path1, G_FILE_TEST_EXISTS)) {
-               save_file_config = 1;
-                       old_task_font = 0;
-                       old_time1_font = 0;
-                       old_time2_font = 0;
-                  config_read_file (path1);
-               save_config();
-                       if (old_task_font) g_free(old_task_font);
-                       if (old_time1_font) g_free(old_time1_font);
-                       if (old_time2_font) g_free(old_time2_font);
-               goto deb;
-               }
-               else {
-                       path2 = 0;
-                       system_dirs = g_get_system_config_dirs();
-                       for (i = 0; system_dirs[i]; i++) {
-                               path2 = g_build_filename(system_dirs[i], "tint2", "tint2rc", NULL);
-
-                               if (g_file_test(path2, G_FILE_TEST_EXISTS)) break;
-                               g_free (path2);
-                               path2 = 0;
-                       }
+       g_free(path1);
+       if (save_file_config) {
+               fprintf(stderr, "tint2 exit : enable to write $HOME/.config/tint2/tint2rc\n");
+               exit(0);
+       }
+
+       // check old tintrc config file
+       path1 = g_build_filename (g_get_user_config_dir(), "tint", "tintrc", NULL);
+       if (g_file_test (path1, G_FILE_TEST_EXISTS)) {
+               save_file_config = 1;
+               old_task_font = 0;
+               old_time1_font = 0;
+               old_time2_font = 0;
+               config_read_file (path1);
+               save_config();
+               if (old_task_font) g_free(old_task_font);
+               if (old_time1_font) g_free(old_time1_font);
+               if (old_time2_font) g_free(old_time2_font);
+               g_free(path1);
+               goto deb;
+       }
 
-                       if (path2) {
-                               // copy file in user directory (path1)
-                               dir = g_build_filename (g_get_user_config_dir(), "tint2", NULL);
-                               if (!g_file_test (dir, G_FILE_TEST_IS_DIR)) g_mkdir(dir, 0777);
-                               g_free(dir);
+       // copy tint2rc from system directory to user directory
+       g_free(path1);
+       char *path2 = 0;
+       system_dirs = g_get_system_config_dirs();
+       for (i = 0; system_dirs[i]; i++) {
+               path2 = g_build_filename(system_dirs[i], "tint2", "tint2rc", NULL);
 
-                               copy_file(path2, path1);
-                               g_free(path2);
-                       }
-               }
-   }
+               if (g_file_test(path2, G_FILE_TEST_EXISTS)) break;
+               g_free (path2);
+               path2 = 0;
+       }
+
+       if (path2) {
+               // copy file in user directory (path1)
+               char *dir = g_build_filename (g_get_user_config_dir(), "tint2", NULL);
+               if (!g_file_test (dir, G_FILE_TEST_IS_DIR)) g_mkdir(dir, 0777);
+               g_free(dir);
 
-   i = config_read_file (path1);
-   g_free(path1);
+               path1 = g_build_filename (g_get_user_config_dir(), "tint2", "tint2rc", NULL);
+               copy_file(path2, path1);
+               g_free(path2);
 
-   return i;
+               i = config_read_file (path1);
+               g_free(path1);
+               return i;
+       }
+       return 0;
 }
 
 
@@ -676,7 +685,7 @@ int config_read_file (const char *path)
 
 void save_config ()
 {
-   fprintf(stderr, "tint2 warning : convert user's config file tintrc to tint2rc\n");
+   fprintf(stderr, "tint2 : convert user's config file tintrc to tint2rc\n");
 
    char *path, *dir;
    FILE *fp;
index 454a8122b26a127a1bc235ee426dacbdbecd4665..db069930a6bfdf3e9da783febad492fb823c5ca8 100644 (file)
@@ -43,6 +43,7 @@ void server_init_atoms ()
    server.atom._NET_WM_STATE_SKIP_PAGER = XInternAtom (server.dsp, "_NET_WM_STATE_SKIP_PAGER", False);
    server.atom._NET_WM_STATE_SKIP_TASKBAR = XInternAtom (server.dsp, "_NET_WM_STATE_SKIP_TASKBAR", False);
    server.atom._NET_WM_STATE_STICKY = XInternAtom (server.dsp, "_NET_WM_STATE_STICKY", False);
+   server.atom._NET_WM_STATE_DEMANDS_ATTENTION = XInternAtom (server.dsp, "_NET_WM_STATE_DEMANDS_ATTENTION", False);
    server.atom._NET_WM_WINDOW_TYPE_DOCK = XInternAtom (server.dsp, "_NET_WM_WINDOW_TYPE_DOCK", False);
    server.atom._NET_WM_WINDOW_TYPE_DESKTOP = XInternAtom (server.dsp, "_NET_WM_WINDOW_TYPE_DESKTOP", False);
    server.atom._NET_WM_WINDOW_TYPE_TOOLBAR = XInternAtom (server.dsp, "_NET_WM_WINDOW_TYPE_TOOLBAR", False);
@@ -77,6 +78,7 @@ void server_init_atoms ()
        server.atom._NET_SYSTEM_TRAY_OPCODE = XInternAtom(server.dsp, "_NET_SYSTEM_TRAY_OPCODE", False);
        server.atom.MANAGER = XInternAtom(server.dsp, "MANAGER", False);
        server.atom._NET_SYSTEM_TRAY_MESSAGE_DATA = XInternAtom(server.dsp, "_NET_SYSTEM_TRAY_MESSAGE_DATA", False);
+       server.atom._NET_SYSTEM_TRAY_ORIENTATION = XInternAtom(server.dsp, "_NET_SYSTEM_TRAY_ORIENTATION", False);
 }
 
 
@@ -168,7 +170,7 @@ void get_root_pixmap()
        server.root_pmap = ret;
 
        if (server.root_pmap == None)
-               fprintf(stderr, "pixmap background detection failed\n");
+               fprintf(stderr, "tint2 : pixmap background detection failed\n");
        else {
                XGCValues  gcv;
                gcv.ts_x_origin = 0;
@@ -272,9 +274,9 @@ next:
    }
    if (server.nb_desktop == 0) {
       server.nb_desktop = 1;
-      fprintf(stderr, "tint2 warning : cannot found number of desktop.\n");
+      fprintf(stderr, "tint2 : cannot found number of desktop.\n");
    }
-       fprintf(stderr, "nb monitor %d, nb desktop %d\n", server.nb_monitor, server.nb_desktop);
+       fprintf(stderr, "tint2 : nb monitor %d, nb desktop %d\n", server.nb_monitor, server.nb_desktop);
 }
 
 
index 00e40d39c2e2ecd8a4d9dc080fe35d9527384123..d2c371bcf00237aec6bf9dda85656538cca53b03 100644 (file)
@@ -27,6 +27,7 @@ typedef struct Global_atom
        Atom _NET_WM_STATE_SKIP_PAGER;
        Atom _NET_WM_STATE_SKIP_TASKBAR;
        Atom _NET_WM_STATE_STICKY;
+       Atom _NET_WM_STATE_DEMANDS_ATTENTION;
        Atom _NET_WM_WINDOW_TYPE_DOCK;
        Atom _NET_WM_WINDOW_TYPE_DESKTOP;
        Atom _NET_WM_WINDOW_TYPE_TOOLBAR;
@@ -57,6 +58,7 @@ typedef struct Global_atom
        Atom _NET_SYSTEM_TRAY_OPCODE;
        Atom MANAGER;
        Atom _NET_SYSTEM_TRAY_MESSAGE_DATA;
+       Atom _NET_SYSTEM_TRAY_ORIENTATION;
 } Global_atom;
 
 
index 26b9b8d1b99369ef1cf02db5b5f5bebab6d017be..0fa8daeb56e42656b33f36d1a59c9de15f33f156 100644 (file)
@@ -36,6 +36,7 @@ GSList *icons;
 #define SYSTEM_TRAY_BEGIN_MESSAGE   1
 #define SYSTEM_TRAY_CANCEL_MESSAGE  2
 
+// selection window
 Window net_sel_win = None;
 
 
@@ -56,7 +57,7 @@ void init_systray()
        }
        if (run_systray) {
                if (XGetSelectionOwner(server.dsp, server.atom._NET_SYSTEM_TRAY_SCREEN) != None) {
-                       fprintf(stderr, "tint2 warning : another systray is running\n");
+                       fprintf(stderr, "tint2 : another systray is running\n");
                        run_systray = 0;
                }
        }
@@ -64,6 +65,7 @@ void init_systray()
        if (run_systray)
                run_systray = net_init();
 
+       // configure sysbar on all panels
        for (i=0 ; i < nb_panel ; i++) {
           panel = &panel1[i];
           sysbar = &panel->systray;
@@ -110,6 +112,37 @@ void cleanup_systray()
 }
 
 
+int net_init()
+{
+       // init systray protocol
+   net_sel_win = XCreateSimpleWindow(server.dsp, server.root_win, -1, -1, 1, 1, 0, 0, 0);
+
+       // v0.2 trayer specification. tint2 always orizontal.
+       int orient = 0;
+       XChangeProperty(server.dsp, net_sel_win, server.atom._NET_SYSTEM_TRAY_ORIENTATION, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &orient, 1);
+
+       XSetSelectionOwner(server.dsp, server.atom._NET_SYSTEM_TRAY_SCREEN, net_sel_win, CurrentTime);
+       if (XGetSelectionOwner(server.dsp, server.atom._NET_SYSTEM_TRAY_SCREEN) != net_sel_win) {
+               fprintf(stderr, "tint2 : can't get systray manager\n");
+               return 0;
+       }
+
+   XClientMessageEvent ev;
+       ev.type = ClientMessage;
+   ev.window = server.root_win;
+       ev.message_type = server.atom.MANAGER;
+       ev.format = 32;
+       ev.data.l[0] = CurrentTime;
+       ev.data.l[1] = server.atom._NET_SYSTEM_TRAY_SCREEN;
+       ev.data.l[2] = net_sel_win;
+       ev.data.l[3] = 0;
+       ev.data.l[4] = 0;
+       XSendEvent(server.dsp, server.root_win, False, StructureNotifyMask, &ev);
+
+       return 1;
+}
+
+
 int resize_systray (Systraybar *sysbar)
 {
    return 0;
@@ -127,7 +160,7 @@ void fix_geometry()
 {
   GSList *it;
 
-  //* find the proper width and height
+  // find the proper width and height
   width = 0;
   height = icon_size;
   for (it = icons; it != NULL; it = g_slist_next(it)) {
@@ -169,109 +202,84 @@ gboolean icon_swallow(TrayWindow *traywin)
 // The traywin must have its id and type set.
 gboolean icon_add(Window id)
 {
-  TrayWindow *traywin;
+       TrayWindow *traywin;
 
-  traywin = g_new0(TrayWindow, 1);
-  traywin->id = id;
+       traywin = g_new0(TrayWindow, 1);
+       traywin->id = id;
 
-  if (!icon_swallow(traywin)) {
-    g_free(traywin);
-    return FALSE;
-  }
+       if (!icon_swallow(traywin)) {
+               printf("not icon_swallow\n");
+               g_free(traywin);
+               return FALSE;
+       }
 
-  // find the positon for the systray app window
+       // find the positon for the systray app window
        int count = g_slist_length(icons);
        traywin->x = border + ((width % icon_size) / 2) +
        (count % (width / icon_size)) * icon_size;
        traywin->y = border + ((height % icon_size) / 2) +
        (count / (height / icon_size)) * icon_size;
 
-  // add the new icon to the list
-  icons = g_slist_append(icons, traywin);
-
-  // watch for the icon trying to resize itself!
-  XSelectInput(server.dsp, traywin->id, StructureNotifyMask);
+       // add the new icon to the list
+       icons = g_slist_append(icons, traywin);
 
-  // position and size the icon window
-  XMoveResizeWindow(server.dsp, traywin->id, traywin->x, traywin->y, icon_size, icon_size);
+       // watch for the icon trying to resize itself!
+       XSelectInput(server.dsp, traywin->id, StructureNotifyMask);
 
-  // resize our window so that the new window can fit in it
-  fix_geometry();
+       // position and size the icon window
+       XMoveResizeWindow(server.dsp, traywin->id, traywin->x, traywin->y, icon_size, icon_size);
 
-  // flush before clearing, otherwise the clear isn't effective.
-  XFlush(server.dsp);
-  // make sure the new child will get the right stuff in its background
-  // for ParentRelative.
-  XClearWindow(server.dsp, win);
+       // resize our window so that the new window can fit in it
+       fix_geometry();
 
-  // show the window
-  XMapRaised(server.dsp, traywin->id);
+       // flush before clearing, otherwise the clear isn't effective.
+       XFlush(server.dsp);
+       // make sure the new child will get the right stuff in its background
+       // for ParentRelative.
+       XClearWindow(server.dsp, win);
 
-  return TRUE;
-}
-
-
-int net_init()
-{
-       // init systray protocol
-   net_sel_win = XCreateSimpleWindow(server.dsp, server.root_win, -1, -1, 1, 1, 0, 0, 0);
+       // show the window
+       XMapRaised(server.dsp, traywin->id);
 
-       XSetSelectionOwner(server.dsp, server.atom._NET_SYSTEM_TRAY_SCREEN, net_sel_win, CurrentTime);
-       if (XGetSelectionOwner(server.dsp, server.atom._NET_SYSTEM_TRAY_SCREEN) != net_sel_win) {
-               fprintf(stderr, "tint2 warning : can't get systray manager\n");
-               return 0;
-       }
-
-       XEvent m;
-       m.type = ClientMessage;
-       m.xclient.message_type = server.atom.MANAGER;
-       m.xclient.format = 32;
-       m.xclient.data.l[0] = CurrentTime;
-       m.xclient.data.l[1] = server.atom._NET_SYSTEM_TRAY_SCREEN;
-       m.xclient.data.l[2] = net_sel_win;
-       m.xclient.data.l[3] = 0;
-       m.xclient.data.l[4] = 0;
-       XSendEvent(server.dsp, server.root_win, False, StructureNotifyMask, &m);
-       return 1;
+       return TRUE;
 }
 
 
 void net_message(XClientMessageEvent *e)
 {
-  unsigned long opcode;
-  Window id;
-
-  opcode = e->data.l[1];
-
-  switch (opcode)
-  {
-  case SYSTEM_TRAY_REQUEST_DOCK: /* dock a new icon */
-    id = e->data.l[2];
-    if (id && icon_add(id))
-      XSelectInput(server.dsp, id, StructureNotifyMask);
-    break;
-
-  case SYSTEM_TRAY_BEGIN_MESSAGE:
-    //g_printerr("Message From Dockapp\n");
-    id = e->window;
-    break;
-
-  case SYSTEM_TRAY_CANCEL_MESSAGE:
-    //g_printerr("Message Cancelled\n");
-    id = e->window;
-    break;
-
-  default:
-    if (opcode == server.atom._NET_SYSTEM_TRAY_MESSAGE_DATA) {
-      //g_printerr("Text For Message From Dockapp:\n%s\n", e->data.b);
-      id = e->window;
-      break;
-    }
-
-    /* unknown message type. not in the spec. */
-    //g_printerr("Warning: Received unknown client message to System Tray selection window.\n");
-    break;
-  }
+       unsigned long opcode;
+       Window id;
+
+       opcode = e->data.l[1];
+
+       switch (opcode) {
+       case SYSTEM_TRAY_REQUEST_DOCK:
+               panel_refresh = 1;
+               id = e->data.l[2];
+               printf("add dockapp\n");
+               if (id && icon_add(id)) {
+                       XSelectInput(server.dsp, id, StructureNotifyMask);
+               }
+               break;
+
+       case SYSTEM_TRAY_BEGIN_MESSAGE:
+               //g_printerr("Message From Dockapp\n");
+               id = e->window;
+               break;
+
+       case SYSTEM_TRAY_CANCEL_MESSAGE:
+               //g_printerr("Message Cancelled\n");
+               id = e->window;
+               break;
+
+       default:
+               if (opcode == server.atom._NET_SYSTEM_TRAY_MESSAGE_DATA) {
+                       printf("message from dockapp:\n  %s\n", e->data.b);
+                       id = e->window;
+               }
+               // unknown message type. not in the spec
+               break;
+       }
 }
 
 
index 0c5e6249b2f002337ffb8f23e7c214e7d6e2f3e1..5222dd6b3d36b8bb22c5404c089470d8796b4a89 100644 (file)
@@ -2,12 +2,16 @@
 * Copyright (C) 2009 thierry lorthiois (lorthiois@bbsoft.fr)
 *
 * systraybar
+* based on 'docker-1.5' from Ben Jansens
 *
 **************************************************************************/
 
 #ifndef SYSTRAYBAR_H
 #define SYSTRAYBAR_H
 
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/Xatom.h>
 #include "area.h"
 
 
@@ -15,6 +19,7 @@ typedef struct {
    // always start with area
    Area area;
 
+       GSList *list_icons;
 } Systraybar;
 
 
@@ -22,17 +27,19 @@ typedef struct
 {
    Window id;
    int x, y;
+   int width, height;
 
-   Window win;
    long *icon_data;
-   int icon_width;
-   int icon_height;
 } TrayWindow;
 
 
+extern Window net_sel_win;
+
+
 void init_systray();
 void cleanup_systray();
-int  net_init();
+int net_init();
+void net_message(XClientMessageEvent *e);
 
 // return 1 if task_width changed
 int resize_systray (Systraybar *sysbar);
index 50a64d4c5a9c7d61f2565f8807052b9a712e742c..aaa86a97e2b06eca211086a745edbc3c1c42979c 100644 (file)
@@ -298,6 +298,7 @@ void draw_foreground_task (void *obj, cairo_t *c, int active)
                pango_layout_set_text (layout, tsk->title, -1);
 
                /* Drawing width and Cut text */
+               // pango use U+22EF or U+2026
                pango_layout_set_width (layout, ((Taskbar*)tsk->area.parent)->text_width * PANGO_SCALE);
                pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_END);
 
index 20038c14c88eeddb698e6e99352193edb5d6e456..13e380fdd1c78c67e629bae633a3c4b196dfad9f 100644 (file)
@@ -58,7 +58,7 @@ void init ()
 
    server.dsp = XOpenDisplay (NULL);
    if (!server.dsp) {
-      fprintf(stderr, "Could not open display.\n");
+      fprintf(stderr, "tint2 exit : could not open display.\n");
       exit(0);
    }
    server_init_atoms ();
@@ -234,10 +234,12 @@ suite:
 }
 
 
-void event_property_notify (Window win, Atom at)
+void event_property_notify (XEvent *e)
 {
        int i, j;
    Task *tsk;
+   Window win = e->xproperty.window;
+   Atom at = e->xproperty.atom;
 
    if (win == server.root_win) {
       if (!server.got_root_win) {
@@ -245,7 +247,7 @@ void event_property_notify (Window win, Atom at)
          server.got_root_win = 1;
       }
 
-      /* Change number of desktops */
+      // Change number of desktops
       else if (at == server.atom._NET_NUMBER_OF_DESKTOPS) {
              server.nb_desktop = server_get_number_of_desktop ();
                        cleanup_taskbar();
@@ -257,19 +259,19 @@ void event_property_notify (Window win, Atom at)
                        task_refresh_tasklist();
                        panel_refresh = 1;
       }
-      /* Change desktop */
+      // Change desktop
       else if (at == server.atom._NET_CURRENT_DESKTOP) {
          server.desktop = server_get_current_desktop ();
          if (panel_mode != MULTI_DESKTOP) {
                                visible_object();
          }
       }
-      /* Window list */
+      // Window list
       else if (at == server.atom._NET_CLIENT_LIST) {
          task_refresh_tasklist();
          panel_refresh = 1;
       }
-      /* Change active */
+      // Change active
       else if (at == server.atom._NET_ACTIVE_WINDOW) {
          GSList *l0;
        if (task_active) {
@@ -306,7 +308,7 @@ void event_property_notify (Window win, Atom at)
                        }
          panel_refresh = 1;
       }
-      /* Wallpaper changed */
+      // Wallpaper changed
       else if (at == server.atom._XROOTPMAP_ID) {
                        for (i=0 ; i < nb_panel ; i++) {
                                set_panel_background(&panel1[i]);
@@ -319,7 +321,7 @@ void event_property_notify (Window win, Atom at)
       if (!tsk) return;
       //printf("atom root_win = %s, %s\n", XGetAtomName(server.dsp, at), tsk->title);
 
-      /* Window title changed */
+      // Window title changed
       if (at == server.atom._NET_WM_VISIBLE_NAME || at == server.atom._NET_WM_NAME || at == server.atom.WM_NAME) {
                        Task *tsk2;
                        GSList *l0;
@@ -338,9 +340,18 @@ void event_property_notify (Window win, Atom at)
                        }
          panel_refresh = 1;
       }
-      /* Iconic state */
+               // Demand attention
+      else if (at == server.atom._NET_WM_STATE) {
+         if (window_is_urgent (win)) {
+                               printf("  event_property_notify _NET_WM_STATE_DEMANDS_ATTENTION\n");
+                       }
+                       else {
+                       }
+               }
       else if (at == server.atom.WM_STATE) {
-         if (window_is_iconified (win))
+       // Iconic state
+                       // TODO : try to delete following code
+         if (window_is_iconified (win)) {
             if (task_active) {
                if (task_active->win == tsk->win) {
                                                Task *tsk2;
@@ -356,8 +367,9 @@ void event_property_notify (Window win, Atom at)
                   task_active = 0;
                }
             }
-      }
-      /* Window icon changed */
+                       }
+               }
+      // Window icon changed
       else if (at == server.atom._NET_WM_ICON) {
                   get_icon(tsk);
                        Task *tsk2;
@@ -377,7 +389,7 @@ void event_property_notify (Window win, Atom at)
                        }
          panel_refresh = 1;
       }
-      /* Window desktop changed */
+      // Window desktop changed
       else if (at == server.atom._NET_WM_DESKTOP) {
          remove_task (tsk);
          add_task (win);
@@ -493,7 +505,7 @@ load_config:
                   break;
 
                case PropertyNotify:
-                  event_property_notify (e.xproperty.window, e.xproperty.atom);
+                  event_property_notify (&e);
                   break;
 
                case ConfigureNotify:
@@ -505,6 +517,7 @@ load_config:
 
                                        case UnmapNotify:
                                        case DestroyNotify:
+//     printf("destroy client\n");
                                        /*
                                                GSList *it;
                                                for (it = icons; it; it = g_slist_next(it)) {
@@ -516,10 +529,10 @@ load_config:
                                        break;
 
                                        case ClientMessage:
-                                               break;
-                                               if (e.xclient.message_type == server.atom._NET_SYSTEM_TRAY_OPCODE && e.xclient.format == 32)
-                                               // &&   e.xclient.window == net_sel_win)
+                                               //printf("ClientMessage\n");
+                                               if (e.xclient.message_type == server.atom._NET_SYSTEM_TRAY_OPCODE && e.xclient.format == 32 && e.xclient.window == net_sel_win) {
                                                        net_message(&e.xclient);
+                                               }
                   break;
             }
          }
index 3d3fb134cd8028a7eed2c16cffd95a7408936ccc..7a98f5f57a118cf794e527ce0cdd523aa357a0cc 100755 (executable)
Binary files a/src/tint2 and b/src/tint2 differ
index 730178d78cc0430ef0a63643777bdaf1cf110618..446bf5f0ae29ba16498321cbdfca779a2447abe2 100644 (file)
@@ -140,6 +140,23 @@ int window_is_iconified (Window win)
 }
 
 
+int window_is_urgent (Window win)
+{
+   Atom *at;
+   int count, i;
+
+   at = server_get_property (win, server.atom._NET_WM_STATE, XA_ATOM, &count);
+   for (i = 0; i < count; i++) {
+      if (at[i] == server.atom._NET_WM_STATE_DEMANDS_ATTENTION) {
+         XFree(at);
+         return 1;
+      }
+   }
+   XFree(at);
+       return 0;
+}
+
+
 int server_get_number_of_desktop ()
 {
    return get_property32(server.root_win, server.atom._NET_NUMBER_OF_DESKTOPS, XA_CARDINAL);
index 5125fe2c36cba32cfb4abc336b898abf672bc544..1c14bca09ac45a1a7f622210f56fcca3fff591e6 100644 (file)
@@ -18,6 +18,7 @@ void set_close (Window win);
 int server_get_current_desktop ();
 int server_get_number_of_desktop ();
 int window_is_iconified (Window win);
+int window_is_urgent (Window win);
 int window_is_hidden (Window win);
 int window_is_active (Window win);
 int get_icon_count (long *data, int num);
index 5f58688dc1f0d0f1c37ad6e0bee78a5da8aff8bf..ccec170b55d2ef10ab1d0f65801f826d1d5212fb 100644 (file)
--- a/tintrc01
+++ b/tintrc01
@@ -25,7 +25,7 @@ border_color = #ffffff 70
 #---------------------------------------------
 panel_monitor = all
 panel_position = bottom center
-panel_size = 88% 28
+panel_size = 90% 28
 panel_margin = 0 0
 panel_padding = 7 0
 font_shadow = 0
index fc4d61ec09d5de189b987085a8acc479e279d5cf..da011bf9d7f30b17d95b4179f45af16dc0021733 100644 (file)
--- a/tintrc02
+++ b/tintrc02
@@ -27,13 +27,15 @@ panel_monitor = all
 panel_position = bottom center
 panel_size = 92% 30
 panel_margin = 0 0
-panel_padding = 7 3
+panel_padding = 7 3 7
 font_shadow = 0
 panel_background_id = 1
 
 #---------------------------------------------
 # TASKBAR
 #---------------------------------------------
+#taskbar_mode = single_desktop
+#taskbar_mode = single_monitor
 taskbar_mode = multi_desktop
 taskbar_padding = 0 0 0
 taskbar_background_id = 2
@@ -52,6 +54,12 @@ task_active_font_color = #ffffff 100
 task_background_id = 0
 task_active_background_id = 3
 
+#---------------------------------------------
+# SYSTRAYBAR
+#---------------------------------------------
+systray_padding = 4 2 2
+systray_background_id = 2
+
 #---------------------------------------------
 # CLOCK
 #---------------------------------------------
This page took 0.069654 seconds and 4 git commands to generate.