hi,
I want to wait for the notification area window. the code below is from eggtrayion.c
If I start the program within Gnome everything works fine, but if i start the program in .xinitrc
... wait_for_manager & gnome-session ...
nothing happens (ok the program waits...), even if i remove the system tray and add it again..
I dont know why, hope somebody can help ! thanx Jochen
Code:
#include <stdio.h> #include <gtk/gtk.h> #include <gdk/gdkx.h> #include <gdk/gdk.h>
Atom manager_atom; Atom selection_atom;
static GdkFilterReturn
root_filter_manager_window (GdkXEvent *xevent, GdkEvent *event, gpointer user_data)
{
XEvent *xev = (XEvent *)xevent;
if (xev->xany.type == ClientMessage && xev->xclient.message_type == manager_atom &&
xev->xclient.data.l[1] == selection_atom) {
printf ("manager: here i am\n"); gtk_main_quit (); }
return GDK_FILTER_CONTINUE; }
int main (int argc, char *argv[]) {
gtk_init (&argc, &argv);
char temp[50]; Screen *screen = XDefaultScreenOfDisplay(GDK_DISPLAY());
sprintf(temp, "_NET_SYSTEM_TRAY_S%i", XScreenNumberOfScreen(screen)); selection_atom = XInternAtom(GDK_DISPLAY(), temp, True); manager_atom = XInternAtom (GDK_DISPLAY(), "MANAGER", False);
gdk_window_add_filter(gdk_window_lookup (GDK_ROOT_WINDOW()), root_filter_manager_window, (gpointer) NULL);
printf ("waiting...\n"); gtk_main ();
/* ..code.. */
gtk_main();
return 0; }
--
::: http://pasteit.sourceforge.net ::: ::: http://www.jochen-baier.de/wmpopup ::: _______________________________________________ gtk-list@xxxxxxxxx http://mail.gnome.org/mailman/listinfo/gtk-list