/* FIXME: make sure to get XID in main thread */
gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (message->src),
- GDK_WINDOW_XWINDOW (ui_drawing->window));
+ GDK_WINDOW_XWINDOW (gtk_widget_get_window (ui_drawing)));
gst_message_unref (message);
return GST_BUS_DROP;
on_drawingareaView_realize (GtkWidget * widget, gpointer data)
{
#if GTK_CHECK_VERSION (2, 18, 0)
- gdk_window_ensure_native (widget->window);
+ gdk_window_ensure_native (gtk_widget_get_window (widget));
#endif
}
on_drawingareaView_configure_event (GtkWidget * widget,
GdkEventConfigure * event, gpointer data)
{
- gdk_window_move_resize (widget->window,
- widget->allocation.x, widget->allocation.y,
- widget->allocation.width, widget->allocation.height);
+ GtkAllocation a;
+
+ gtk_widget_get_allocation (widget, &a);
+ gdk_window_move_resize (gtk_widget_get_window (widget),
+ a.x, a.y, a.width, a.height);
gdk_display_sync (gtk_widget_get_display (widget));
return TRUE;
on_drawingMain_expose_event (GtkWidget * widget, GdkEventExpose * event,
gpointer data)
{
- GtkAllocation a = widget->allocation;
+ GtkAllocation a;
gint w, h, x, y;
+ gtk_widget_get_allocation (widget, &a);
+
if (draw_pixbuf == NULL)
return FALSE;
if (y < 0)
y = 0;
- gdk_draw_pixbuf (GDK_DRAWABLE (widget->window), widget->style->black_gc,
+ gdk_draw_pixbuf (GDK_DRAWABLE (gtk_widget_get_window (widget)),
+ gtk_widget_get_style (widget)->black_gc,
draw_pixbuf, 0, 0, x, y, w, h, GDK_RGB_DITHER_NONE, 0, 0);
return TRUE; /* handled expose event */
break;
case GST_MESSAGE_ELEMENT: {
const GValue *val;
+ GtkAllocation a;
/* only interested in element messages from our gdkpixbufsink */
if (message->src != GST_OBJECT_CAST (gst_video_sink))
g_print ("Got image pixbuf: %dx%d\n", gdk_pixbuf_get_width (last_pixbuf),
gdk_pixbuf_get_height (last_pixbuf));
- update_draw_pixbuf (GTK_WIDGET (ui_drawing)->allocation.width,
- GTK_WIDGET (ui_drawing)->allocation.height);
+ gtk_widget_get_allocation (GTK_WIDGET (ui_drawing), &a);
+ update_draw_pixbuf (a.width, a.height);
gtk_widget_queue_draw (ui_drawing);
break;