diff --git a/aisleriot/board-noclutter.c b/aisleriot/board-noclutter.c
index 2c95832..0662078 100644
--- a/aisleriot/board-noclutter.c
+++ b/aisleriot/board-noclutter.c
@@ -619,7 +619,7 @@ set_focus (AisleriotBoard *board,
 
   if (priv->focus_slot != NULL) {
     if (priv->show_focus &&
-        GTK_WIDGET_HAS_FOCUS (widget)) {
+        gtk_widget_has_focus (widget)) {
       gdk_window_invalidate_rect (window, &priv->focus_rect, FALSE);
     
       priv->show_focus = FALSE;
@@ -638,7 +638,7 @@ set_focus (AisleriotBoard *board,
   priv->focus_card_id = card_id;
 
   if (show_focus &&
-      GTK_WIDGET_HAS_FOCUS (widget)) {
+      gtk_widget_has_focus (widget)) {
     get_focus_rect (board, &priv->focus_rect);
     gdk_window_invalidate_rect (window, &priv->focus_rect, FALSE);
   }
@@ -2196,7 +2196,7 @@ aisleriot_board_activate (AisleriotBoard *board)
   int selection_start_card_id = priv->selection_start_card_id;
   guint state = 0;
 
-  if (!GTK_WIDGET_HAS_FOCUS (widget))
+  if (!gtk_widget_has_focus (widget))
     return;
 
   if (!focus_slot) {
@@ -2274,7 +2274,7 @@ aisleriot_board_move_cursor (AisleriotBoard *board,
   guint state;
   gboolean is_control, is_shift, moved = FALSE;
 
-  if (!GTK_WIDGET_HAS_FOCUS (widget))
+  if (!gtk_widget_has_focus (widget))
     return FALSE;
 
   g_return_val_if_fail (step == GTK_MOVEMENT_LOGICAL_POSITIONS ||
@@ -3283,7 +3283,7 @@ draw_focus:
 #ifdef ENABLE_KEYNAV
   if (G_UNLIKELY (priv->show_focus &&
                   priv->focus_slot != NULL &&
-                  GTK_WIDGET_HAS_FOCUS (widget))) {
+                  gtk_widget_has_focus (widget))) {
     GdkRectangle focus_rect;
 
     /* Check whether this needs to be drawn */
diff --git a/blackjack/src/dialog.cpp b/blackjack/src/dialog.cpp
index 4cc3d4b..53a04f2 100644
--- a/blackjack/src/dialog.cpp
+++ b/blackjack/src/dialog.cpp
@@ -424,7 +424,7 @@ show_preferences_dialog (void)
                                   G_CALLBACK (gtk_widget_hide), NULL);
         }
         
-        if (pref_dialog && !GTK_WIDGET_VISIBLE (pref_dialog)) {
+        if (pref_dialog && !gtk_widget_get_visible (pref_dialog)) {
                 // Set card style?
 
                 gtk_widget_show_all (pref_dialog);
diff --git a/gnomine/minefield.c b/gnomine/minefield.c
index 6d554d6..49777ea 100644
--- a/gnomine/minefield.c
+++ b/gnomine/minefield.c
@@ -1272,7 +1272,7 @@ gtk_minefield_set_size (GtkMineField * mfield, guint xsize, guint ysize)
   mfield->xsize = xsize;
   mfield->ysize = ysize;
 
-  if (GTK_WIDGET_VISIBLE (mfield)) {
+  if (gtk_widget_get_visible (mfield)) {
     gtk_widget_queue_resize (GTK_WIDGET (mfield));
   }
 }
diff --git a/libgames-support/games-gridframe.c b/libgames-support/games-gridframe.c
index 90db76e..3e4363f 100644
--- a/libgames-support/games-gridframe.c
+++ b/libgames-support/games-gridframe.c
@@ -160,7 +160,7 @@ games_grid_frame_size_request (GtkWidget * widget,
   requisition->width = 1;
   requisition->height = 1;
 
-  if (child && GTK_WIDGET_VISIBLE (child)) {
+  if (child && gtk_widget_get_visible (child)) {
     gtk_widget_size_request (child, requisition);
   }
 }
@@ -198,7 +198,7 @@ games_grid_frame_size_allocate (GtkWidget * widget,
        child_allocation.height != frame->old_allocation.height))
     gdk_window_invalidate_rect (gtk_widget_get_window (widget), allocation, FALSE);
 
-  if (child && GTK_WIDGET_VISIBLE (child))
+  if (child && gtk_widget_get_visible (child))
     gtk_widget_size_allocate (child, &child_allocation);
 
   frame->old_allocation = child_allocation;
diff --git a/libgames-support/games-gtk-compat.h b/libgames-support/games-gtk-compat.h
index 5c4a27e..3d49b3e 100644
--- a/libgames-support/games-gtk-compat.h
+++ b/libgames-support/games-gtk-compat.h
@@ -33,10 +33,12 @@ G_BEGIN_DECLS
 
 #if !GTK_CHECK_VERSION (2, 17, 7)
 #define gtk_widget_get_allocation(widget, alloc) (*(alloc)=(widget)->allocation)
+#define gtk_widget_get_visible(widget) ((GTK_WIDGET_FLAGS (widget) & GTK_VISIBLE) != 0)
 #endif /* GTK < 2.17.7 */
 
 #if !GTK_CHECK_VERSION (2, 17, 5)
 #define gtk_widget_get_state(widget) ((widget)->state)
+#define gtk_widget_has_focus(widget) (GTK_WIDGET_HAS_FOCUS (widget))
 #endif /* GTK < 2.17.5 */
 
 #if !GTK_CHECK_VERSION (2, 13, 4)
