--- gdkscreen-x11.c.0	2013-04-16 08:01:51.000000000 -0400
+++ gdkscreen-x11.c	2013-06-23 14:54:40.917492490 -0400
@@ -1470,6 +1470,7 @@ gdk_x11_screen_supports_net_wm_hint (Gdk
   GdkX11Screen *x11_screen;
   NetWmSupportedAtoms *supported_atoms;
   GdkDisplay *display;
+  Atom atom;
 
   g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
 
@@ -1521,13 +1522,12 @@ gdk_x11_screen_supports_net_wm_hint (Gdk
   if (supported_atoms->atoms == NULL)
     return FALSE;
 
-  i = 0;
-  while (i < supported_atoms->n_atoms)
+  atom = gdk_x11_atom_to_xatom_for_display (display, property);
+
+  for (i = 0; i < supported_atoms->n_atoms; i++)
     {
-      if (supported_atoms->atoms[i] == gdk_x11_atom_to_xatom_for_display (display, property))
+      if (supported_atoms->atoms[i] == atom)
         return TRUE;
-
-      ++i;
     }
 
   return FALSE;
