[gnome-mag] Fix the build with GTK+ >= 2.19.5. Fixes bug #612818.



commit 5faf42be9d3a85b2a91fbf41e40a720750a84f32
Author: Andre Klapper <a9016009 gmx de>
Date:   Mon Mar 29 11:01:26 2010 +0200

    Fix the build with GTK+ >= 2.19.5. Fixes bug #612818.

 magnifier/magnifier.c                 |    8 ++++++++
 magnifier/x11/gmag-graphical-server.c |   13 ++++++++++++-
 2 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/magnifier/magnifier.c b/magnifier/magnifier.c
index c7fdfc8..bc11c72 100644
--- a/magnifier/magnifier.c
+++ b/magnifier/magnifier.c
@@ -893,11 +893,19 @@ magnifier_reset_struts_at_idle (gpointer data)
 	if (data)
 	{
 		Magnifier *magnifier = MAGNIFIER (data);
+#if GTK_CHECK_VERSION (2,19,5)
+		if (magnifier->priv &&
+		    gtk_widget_get_realized (magnifier->priv->w) &&
+		    gmag_gs_check_set_struts (magnifier)) {
+			return FALSE;
+		}
+#else
 		if (magnifier->priv &&
 		    GTK_WIDGET_REALIZED (magnifier->priv->w) && 
 		    gmag_gs_check_set_struts (magnifier)) {
 			return FALSE;
 		}
+#endif
 	}
 	return TRUE;
 }
diff --git a/magnifier/x11/gmag-graphical-server.c b/magnifier/x11/gmag-graphical-server.c
index d56b107..d5c617f 100644
--- a/magnifier/x11/gmag-graphical-server.c
+++ b/magnifier/x11/gmag-graphical-server.c
@@ -158,9 +158,15 @@ gmag_gs_check_set_struts (Magnifier *magnifier)
 		return TRUE;
 #endif
 
+#if GTK_CHECK_VERSION (2,19,5)
+	if (magnifier &&
+	    magnifier->priv && magnifier->priv->w && gtk_widget_get_realized (magnifier->priv->w) &&
+	    magnifier->priv->w->window) 
+#else
 	if (magnifier &&
 	    magnifier->priv && magnifier->priv->w && GTK_WIDGET_REALIZED (magnifier->priv->w) &&
 	    magnifier->priv->w->window) 
+#endif
 	{
 		Atom atom_strut = gdk_x11_get_xatom_by_name ("_NET_WM_STRUT");
 		Atom atom_strut_partial = gdk_x11_get_xatom_by_name ("_NET_WM_STRUT_PARTIAL");
@@ -248,8 +254,13 @@ gmag_gs_reset_overlay_at_idle (gpointer data)
 		return FALSE;
 	if (data) {
 		Magnifier *magnifier = MAGNIFIER (data);
+#if GTK_CHECK_VERSION (2,19,5)
 		if (magnifier->priv && magnifier->priv->w &&
-		    GTK_WIDGET_REALIZED (magnifier->priv->w)) 
+		    gtk_widget_get_realized (magnifier->priv->w))
+#else
+		if (magnifier->priv && magnifier->priv->w &&
+		    GTK_WIDGET_REALIZED (magnifier->priv->w))
+#endif
 			if (magnifier->priv->w->window) {
 #ifdef HAVE_OVERLAY
 				gint      x, y, over_w, over_h;



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