/*
* empathy-call-window-fullscreen.c - Source for EmpathyCallWindowFullscreen
- * Copyright (C) 2009 Collabora Ltd.
+ * Copyright (C) 2009-2011 Collabora Ltd.
*
* Some code is based on the Totem Movie Player, especially
* totem-fullscreen.c which has the following copyright:
gboolean show_cursor)
{
EmpathyCallWindowFullscreenPriv *priv = GET_PRIV (fs);
+ GdkWindow *window;
- if (priv->video_widget != NULL && !show_cursor)
- {
- gdk_window_set_cursor (priv->video_widget->window,
- gdk_cursor_new (GDK_BLANK_CURSOR));
- }
+ if (priv->video_widget == NULL)
+ return;
+
+ window = gtk_widget_get_window (priv->video_widget);
+
+ if (!show_cursor)
+ gdk_window_set_cursor (window, gdk_cursor_new (GDK_BLANK_CURSOR));
else
- gdk_window_set_cursor (priv->video_widget->window, NULL);
+ gdk_window_set_cursor (window, NULL);
}
static void
screen = gtk_window_get_screen (GTK_WINDOW (priv->parent_window));
gdk_screen_get_monitor_geometry (screen,
gdk_screen_get_monitor_at_window (screen,
- GTK_WIDGET (priv->parent_window)->window),
+ gtk_widget_get_window (GTK_WIDGET (priv->parent_window))),
&fullscreen_rect);
/* Getting the popup window sizes */
fs->is_fullscreen = set_fullscreen;
}
+static void
+video_widget_destroy_cb (GtkWidget *widget,
+ EmpathyCallWindowFullscreen *self)
+{
+ EmpathyCallWindowFullscreenPriv *priv = GET_PRIV (self);
+
+ priv->video_widget = NULL;
+}
+
void
empathy_call_window_fullscreen_set_video_widget (
EmpathyCallWindowFullscreen *fs,
{
EmpathyCallWindowFullscreenPriv *priv = GET_PRIV (fs);
priv->video_widget = video_widget;
+
+ tp_g_signal_connect_object (video_widget, "destroy",
+ G_CALLBACK (video_widget_destroy_cb), fs, 0);
}