Re: [gtk-vnc-devel] [PATCH] Gtk-VNC not packed



Richard W.M. Jones wrote:
Anthony Liguori wrote:
Richard W.M. Jones wrote:
Anthony Liguori wrote:
Richard W.M. Jones wrote:
I don't know if you necessarily want to classify this as a bug, but currently if you create a Gtk-VNC widget but don't pack it, then it will segfault when it tries to draw anything.

I'm not sure what "packed" is. Do we need to wait for realize or something? My concern with this patch is that the buffer disappears until the next resize so when things to get "packed" we don't start displaying like we should.

Sorry, I wasn't clear. This is when you create a Gtk-VNC widget but don't add it to any container, but then you do make it connect to a VNC server. The widget segfaults, because the return value from

  gdk_drawable_get_visual (GTK_WIDGET(obj)->window)

is NULL, and you get a segfault a couple of lines later when visual is dereferenced.

This shouldn't affect any code which does pack the widget in a container (visual != NULL).

Yes, but that's not my concern. My concern is if you connect a widget before packing it, and then wait a while before actually packing it. When you pack it, you need to make sure it's displaying stuff.

This is why I suggested listening for the realized signal. I think this is the thing that indicates that a visual is now valid.

If I understand you correctly, do you mean waiting for the realized signal before starting up the coroutine?

No. Your patch basically skips the on_resize() callback if visual != NULL. on_resize() fills out the local framebuffer and sets it so that gvnc renders to it and expose has something to draw.

You can keep the visual != NULL check, but you would need to add a realized signal handler that then does the equivalent work of on_resize(). Otherwise, if you add a gtk-vnc widget *after* on_resize() gets called, you'll get a blank screen until the server sends a resize event. By adding a signal handler, you fix that bug.

Regards,

Anthony Liguori

Rich.






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