Why do i get DESTROY events on the root window?




What i'm doing is:

  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());
  gtk_signal_connect(GTK_OBJECT(root_widget), "event",
		     GTK_SIGNAL_FUNC(substruct_notify), 0);
  XSelectInput(GDK_DISPLAY(), GDK_WINDOW_XWINDOW(GDK_ROOT_PARENT()), 
	       SubstructureNotifyMask | KeyPressMask);


with
static void
substruct_notify(GtkWidget* rw, GdkEvent* ev)
{
  
  fprintf(stderr,"substruct_notify: rw = %p, ev = %p\n",
	  rw, ev);
  fprintf(stderr,"                   gdkeventtype = %d\n", ev->type);
  return ;
}

and the output is:
substruct_notify: rw = 0x809ee10, ev = 0x80a36b0
                   gdkeventtype = 13
substruct_notify: rw = 0x809ee10, ev = 0x80a36b0
                   gdkeventtype = 1

means that i get a destroy event.

I'm wondering why destroy events are sent to the root window?

the code ist shameless ripped out from raster's gnomepager_applet.c
file where he does the same, listening on property change
events. there it works. 

--
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]