Permalink
Browse files

commander: Fix compatibility macro for gtk_widget_set_can_focus()

  • Loading branch information...
b4n committed Aug 8, 2012
1 parent 455cfe4 commit 49f02b5d6ed13c55795548243e06d1baf8b675b1
Showing with 9 additions and 2 deletions.
  1. +9 −2 commander/src/commander-plugin.c
@@ -48,8 +48,15 @@ PLUGIN_SET_TRANSLATABLE_INFO (
#if ! GTK_CHECK_VERSION (2, 18, 0)
# define gtk_widget_get_visible(w) \
(GTK_WIDGET_VISIBLE (w))
-# define gtk_widget_set_can_focus(w) \
- (GTK_WIDGET_SET_FLAGS ((w), GTK_CAN_FOCUS))
+# define gtk_widget_set_can_focus(w, v) \
+ G_STMT_START { \
+ GtkWidget *widget = (w); \
+ if (v) { \
+ GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS); \
+ } else { \
+ GTK_WIDGET_UNSET_FLAGS (widget, GTK_CAN_FOCUS); \
+ } \
+ } G_STMT_END
#endif
#if ! GTK_CHECK_VERSION (2, 21, 8)

0 comments on commit 49f02b5

Please sign in to comment.