SubstruvtorNotify and DestroyEvent




I need to get SubstructureNotify events from the root window.
What i did was:

  root_widget = gtk_window_new(GTK_WINDOW_POPUP);
  fprintf(stderr,"root_widget is at %p\n", root_widget);
  gtk_widget_realize(root_widget);
  fprintf(stderr,"root_widget realized\n");
  gdk_window_set_user_data(GDK_ROOT_PARENT(), root_widget);
  gdk_window_ref(GDK_ROOT_PARENT());
  gdk_xid_table_insert(&(GDK_WINDOW_XWINDOW(GDK_ROOT_PARENT())), 
		       GDK_ROOT_PARENT());

and then

  gtk_signal_connect(GTK_OBJECT(root_widget), "event",
		     GTK_SIGNAL_FUNC(substruct_notify), 0);
  fprintf(stderr,"root_widget signal connected\n");
  /* i'm not sure if this is really necessary */
  XSelectInput(GDK_DISPLAY(), GDK_WINDOW_XWINDOW(GDK_ROOT_PARENT()), 
	       SubstructureNotifyMask);

with this setup, i observ DestroyNotify events on the root window. A
closer look into the XDestroyWindowEvent and the XAnyEvent part of the
raw X event showed me, that the gdk_translate_event function takes the 
XanyEvent.window part as the target window, which is the root
window. But the destroyed window is not the root window. It's stored
in the XDestroyWindowEvent.window data. Is this on purpose and do i
miss something? If this is so, how do i call a signal function on a
ClientMessage event, which is sent with an X event mask of
SubStructureNotifyMask?

--
Michael Lausch/g.a.m.s. edv dienstleistungen gmbh
See my web page <http://www.lausch.at/> or query PGP key server for PGP key.
"Reality is that which, when you stop believing in it, doesn't go away".
                -- Philip K. Dick



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]