GtkSocket ...



Hi all,

	This bug was recently fixed in Bonobo Plug/Socket, it
caused fatal BadMatch errors; be good to fix Gtk too. Problem
solved by Peter Williams and Ettore Perazolli.

This will fix the intermitent BadMatch bug that crops up every so
often. The problem was that we were trying to set the focus to the
parent window, which was not guaranteed to be mapped and viewable.

The first few lines of our focus_out_event are now something like
this:

{
	GtkWidget *toplevel;
	BonoboSocket *socket;
	XWindowAttributes attr;

	g_return_val_if_fail (BONOBO_IS_SOCKET (widget), FALSE);
	socket = BONOBO_SOCKET (widget);

	toplevel = gtk_widget_get_ancestor (widget,
gtk_window_get_type());
	XGetWindowAttributes (GDK_DISPLAY (), GDK_WINDOW_XWINDOW
(toplevel->window), &attr);

	/* FIXME: can we just check the return value of 
	 * XGetWindowAttributes? */
	if (toplevel && attr.map_state == IsViewable)

	HTH,

		Michael.

-- 
 mmeeks@gnu.org  <><, Pseudo Engineer, itinerant idiot





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