all repos — tint2 @ a62548bf29ed1a56309041395925976530808690

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

detect pid of process owning the systray

git-svn-id: http://tint2.googlecode.com/svn/trunk@167 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
lorthiois@bbsoft.fr lorthiois@bbsoft.fr@121b4492-b84c-0410-8b4c-0d4edfb3f3cc
commit

a62548bf29ed1a56309041395925976530808690

parent

69ad0897d1c39b4e563e15b6ff4d55e647b2fca8

2 files changed, 26 insertions(+), 2 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,3 +1,6 @@

+2009-08-30 +- detect pid of process owning the systray + 2009-08-30 - added taskbar_active_background_id to change current desktop background. warning : this feature have a price on cpu (tint2 redraw all task) when you switch desktop.
M src/systray/systraybar.csrc/systray/systraybar.c

@@ -171,9 +171,30 @@ // systray protocol

int init_net() { + Window win = XGetSelectionOwner(server.dsp, server.atom._NET_SYSTEM_TRAY_SCREEN); + // freedesktop systray specification - if (XGetSelectionOwner(server.dsp, server.atom._NET_SYSTEM_TRAY_SCREEN) != None) { - fprintf(stderr, "tint2 : another systray is running\n"); + if (win != None) { + // search pid + Atom _NET_WM_PID, actual_type; + int actual_format; + unsigned long nitems; + unsigned long bytes_after; + unsigned char *prop; + int pid; + + _NET_WM_PID = XInternAtom(server.dsp, "_NET_WM_PID", True); + //atom_name = XGetAtomName (dpy,atom); + + int ret = XGetWindowProperty(server.dsp, win, _NET_WM_PID, 0, 1024, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, &prop); + + fprintf(stderr, "tint2 : another systray is running"); + if (ret == 0) { + pid = prop[1] * 256; + pid += prop[0]; + fprintf(stderr, " pid=%d", pid); + } + fprintf(stderr, "\n"); return 0; }