[totem] Fix GdkDrawable removal in GTK+ 3.x
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] Fix GdkDrawable removal in GTK+ 3.x
- Date: Mon, 4 Oct 2010 22:54:34 +0000 (UTC)
commit a1ffeedb24d694d2c7900c182b60059f87e20af5
Author: Bastien Nocera <hadess hadess net>
Date: Mon Oct 4 13:18:10 2010 +0100
Fix GdkDrawable removal in GTK+ 3.x
src/backend/bacon-video-widget-gst-0.10.c | 8 ++++----
src/backend/video-utils.c | 16 +++++++++-------
src/backend/video-utils.h | 9 ++++++---
3 files changed, 19 insertions(+), 14 deletions(-)
---
diff --git a/src/backend/bacon-video-widget-gst-0.10.c b/src/backend/bacon-video-widget-gst-0.10.c
index bb19c13..b3accec 100644
--- a/src/backend/bacon-video-widget-gst-0.10.c
+++ b/src/backend/bacon-video-widget-gst-0.10.c
@@ -5279,16 +5279,16 @@ bacon_video_widget_set_scale_ratio (BaconVideoWidget * bvw, gfloat ratio)
}
if (ratio == 0.0) {
- if (totem_ratio_fits_screen (bvw->priv->video_window, w, h, 2.0))
+ if (totem_ratio_fits_screen (GTK_WIDGET (bvw), w, h, 2.0))
ratio = 2.0;
- else if (totem_ratio_fits_screen (bvw->priv->video_window, w, h, 1.0))
+ else if (totem_ratio_fits_screen (GTK_WIDGET (bvw), w, h, 1.0))
ratio = 1.0;
- else if (totem_ratio_fits_screen (bvw->priv->video_window, w, h, 0.5))
+ else if (totem_ratio_fits_screen (GTK_WIDGET (bvw), w, h, 0.5))
ratio = 0.5;
else
return;
} else {
- if (!totem_ratio_fits_screen (bvw->priv->video_window, w, h, ratio)) {
+ if (!totem_ratio_fits_screen (GTK_WIDGET (bvw), w, h, ratio)) {
GST_DEBUG ("movie doesn't fit on screen @ %.1fx (%dx%d)", w, h, ratio);
return;
}
diff --git a/src/backend/video-utils.c b/src/backend/video-utils.c
index 65130ec..e235ab7 100644
--- a/src/backend/video-utils.c
+++ b/src/backend/video-utils.c
@@ -210,28 +210,30 @@ totem_widget_set_preferred_size (GtkWidget *widget, gint width,
}
gboolean
-totem_ratio_fits_screen (GdkWindow *video_window, int video_width,
+totem_ratio_fits_screen (GtkWidget *video_widget, int video_width,
int video_height, gfloat ratio)
{
GdkRectangle fullscreen_rect;
int new_w, new_h;
GdkScreen *screen;
+ GdkWindow *window;
if (video_width <= 0 || video_height <= 0)
return TRUE;
+ window = gtk_widget_get_window (video_widget);
+ g_return_val_if_fail (window != NULL, FALSE);
+
new_w = video_width * ratio;
new_h = video_height * ratio;
- screen = gdk_drawable_get_screen (GDK_DRAWABLE (video_window));
+ screen = gtk_widget_get_screen (video_widget);
gdk_screen_get_monitor_geometry (screen,
- gdk_screen_get_monitor_at_window
- (screen, video_window),
- &fullscreen_rect);
+ gdk_screen_get_monitor_at_window (screen, window),
+ &fullscreen_rect);
if (new_w > (fullscreen_rect.width - 128) ||
- new_h > (fullscreen_rect.height - 128))
- {
+ new_h > (fullscreen_rect.height - 128)) {
return FALSE;
}
diff --git a/src/backend/video-utils.h b/src/backend/video-utils.h
index 68cd402..d1f1f6a 100644
--- a/src/backend/video-utils.h
+++ b/src/backend/video-utils.h
@@ -13,8 +13,11 @@ char *totem_time_to_string (gint64 msecs);
gint64 totem_string_to_time (const char *time_string);
char *totem_time_to_string_text (gint64 msecs);
-void totem_widget_set_preferred_size (GtkWidget *widget, gint width,
+void totem_widget_set_preferred_size (GtkWidget *widget,
+ gint width,
gint height);
-gboolean totem_ratio_fits_screen (GdkWindow *window, int video_width,
- int video_height, gfloat ratio);
+gboolean totem_ratio_fits_screen (GtkWidget *widget,
+ int video_width,
+ int video_height,
+ gfloat ratio);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]