[libgda] Fix compilation if GTK+ < 2.18



commit 9265bc8f3272f57282f3f40cc6807ae1b24d27b2
Author: Vivien Malerba <malerba gnome-db org>
Date:   Wed Sep 1 17:54:30 2010 +0200

    Fix compilation if GTK+ < 2.18

 tools/browser/browser-window.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/tools/browser/browser-window.c b/tools/browser/browser-window.c
index 9a1b728..385f7d8 100644
--- a/tools/browser/browser-window.c
+++ b/tools/browser/browser-window.c
@@ -551,7 +551,16 @@ browser_window_new (BrowserConnection *bcnc, BrowserPerspectiveFactory *factory)
 
         gtk_widget_show (GTK_WIDGET (bwin));
 
+#if GTK_CHECK_VERSION(2,18,0)
 	gtk_widget_set_can_focus ((GtkWidget* )pers->perspective_widget, TRUE);
+#else
+	GtkWidget *fwid = (GtkWidget* )pers->perspective_widget;
+	if (! GTK_WIDGET_CAN_FOCUS (fwid)) {
+		GTK_WIDGET_SET_FLAGS (fwid, GTK_CAN_FOCUS);
+		gtk_widget_queue_resize (fwid);
+		g_object_notify (G_OBJECT (fwid), "can-focus");
+	}
+#endif
 	gtk_widget_grab_focus ((GtkWidget* )pers->perspective_widget);
 
 	return bwin;



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