[gcompris/gcomprixogoo] Fixes to compile with GTK 2.19
- From: Bruno Coudoin <bcoudoin src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gcompris/gcomprixogoo] Fixes to compile with GTK 2.19
- Date: Mon, 18 Jan 2010 20:05:38 +0000 (UTC)
commit a8dd1667b2e90537af3de31b4826add8065df879
Author: Bruno Coudoin <bruno coudoin free fr>
Date: Mon Jan 18 21:03:09 2010 +0100
Fixes to compile with GTK 2.19
This patch comes from Johan Cwiklinski
https://bugzilla.gnome.org/show_bug.cgi?id=607215
src/goocanvas/src/goocanvas.c | 8 ++++++++
src/goocanvas/src/goocanvasatk.c | 8 ++++++++
2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/goocanvas/src/goocanvas.c b/src/goocanvas/src/goocanvas.c
index f59bbdf..971c42a 100644
--- a/src/goocanvas/src/goocanvas.c
+++ b/src/goocanvas/src/goocanvas.c
@@ -3314,7 +3314,11 @@ goo_canvas_grab_focus (GooCanvas *canvas,
g_return_if_fail (GOO_IS_CANVAS (canvas));
g_return_if_fail (GOO_IS_CANVAS_ITEM (item));
+#if GTK_CHECK_VERSION(2, 18, 0)
+ g_return_if_fail (gtk_widget_get_can_focus (GTK_WIDGET (canvas)));
+#else
g_return_if_fail (GTK_WIDGET_CAN_FOCUS (canvas));
+#endif
if (canvas->focused_item) {
event.type = GDK_FOCUS_CHANGE;
@@ -4145,7 +4149,11 @@ goo_canvas_focus (GtkWidget *widget,
canvas = GOO_CANVAS (widget);
/* If keyboard navigation has been turned off for the canvas, return FALSE.*/
+#if GTK_CHECK_VERSION(2, 18, 0)
+ if (!gtk_widget_get_can_focus (GTK_WIDGET (canvas)))
+#else
if (!GTK_WIDGET_CAN_FOCUS (canvas))
+#endif
return FALSE;
/* If a child widget has the focus, try moving the focus within that. */
diff --git a/src/goocanvas/src/goocanvasatk.c b/src/goocanvas/src/goocanvasatk.c
index 5c8c774..31588a0 100644
--- a/src/goocanvas/src/goocanvasatk.c
+++ b/src/goocanvas/src/goocanvasatk.c
@@ -222,7 +222,11 @@ goo_canvas_item_accessible_grab_focus (AtkComponent *component)
goo_canvas_grab_focus (canvas, item);
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (canvas));
+#if GTK_CHECK_VERSION(2, 18, 0)
+ if(gtk_widget_is_toplevel(toplevel))
+#else
if (GTK_WIDGET_TOPLEVEL (toplevel))
+#endif
gtk_window_present (GTK_WINDOW (toplevel));
return TRUE;
@@ -414,7 +418,11 @@ goo_canvas_item_accessible_ref_state_set (AtkObject *accessible)
g_object_get (item, "can-focus", &can_focus, NULL);
+#if GTK_CHECK_VERSION(2, 18, 0)
+ if (gtk_widget_get_can_focus (GTK_WIDGET (canvas)) && can_focus)
+#else
if (GTK_WIDGET_CAN_FOCUS (GTK_WIDGET (canvas)) && can_focus)
+#endif
{
atk_state_set_add_state (state_set, ATK_STATE_FOCUSABLE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]