[Fwd: gtkplug commit]






I´ve observed the following problem with gtk_plug/sockets:

void
gtk_plug_construct (GtkPlug *plug, guint32 socket_id)
{
  plug->socket_window = gdk_window_lookup (socket_id);
  plug->same_app = TRUE;

  if (plug->socket_window == NULL)
    {
      plug->socket_window = gdk_window_foreign_new (socket_id);
      plug->same_app = FALSE;
    }
}

if gdk_window_lookup return something != NULL we use the existing window

(without increasing the reference count!). But gtk_plug_unrealize
always  unrefs the window wich causes the window to be destroyed.

This is why bobobo doesn´t work.

A quick fix would be to "gdk_window_ref" the window:

gtk_plug_construct (GtkPlug *plug, guint32 socket_id)
{
  plug->socket_window = gdk_window_lookup (socket_id);
  plug->same_app = TRUE;

  if (plug->socket_window == NULL)
    {
      plug->socket_window = gdk_window_foreign_new (socket_id);
      plug->same_app = FALSE;
    }
  else gdk_window_ref (plug->socket_window);   /* reference the window
*/
}

I´m sure this change will not break any code.

Owen Taylor wrote:

> (I have at least one reservation about it the patch... there
> are other ways that a plug/socket doesn't work in the same
> application, so this may just be papering over deeper
> problems.)

in the same application? The problem occurs also when plug and socket
are in different applications (see bonobo). I think the delete event
gets lost?






-- 
        FAQ: Frequently-Asked Questions at http://www.gnome.org/gnomefaq
         To unsubscribe: mail gnome-components-list-request@gnome.org with 
                       "unsubscribe" as the Subject.






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