[ui/gtk,08/13] Conditionalize use of gtk_widget_size_request

Submitted by Daniel P. Berrange on Feb. 25, 2013, 3:20 p.m.

Details

Message ID 1361805646-6425-9-git-send-email-berrange@redhat.com
State New
Headers show

Commit Message

Daniel P. Berrange Feb. 25, 2013, 3:20 p.m.
From: "Daniel P. Berrange" <berrange@redhat.com>

The gtk_widget_size_request method has been replaced by
the gtk_widget_get_preferred_size method in GTK3. Conditionally
call the new method in GTK3

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 ui/gtk.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/ui/gtk.c b/ui/gtk.c
index 93c3b43..c89c7c4 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -305,7 +305,11 @@  static void gd_resize(DisplayState *ds)
         gtk_widget_set_size_request(s->drawing_area,
                                     ds_get_width(ds) * s->scale_x,
                                     ds_get_height(ds) * s->scale_y);
+#if GTK_CHECK_VERSION(3, 0, 0)
+        gtk_widget_get_preferred_size(s->vbox, NULL, &req);
+#else
         gtk_widget_size_request(s->vbox, &req);
+#endif
 
         gtk_window_resize(GTK_WINDOW(s->window),
                           req.width * sx, req.height * sy);