MenuShell: Sanitise take_focus bool via public API
authorDaniel Boles <dboles.src@gmail.com>
Tue, 17 Apr 2018 18:48:43 +0000 (19:48 +0100)
committerDaniel Boles <dboles.src@gmail.com>
Tue, 17 Apr 2018 19:40:21 +0000 (20:40 +0100)
We store in priv then compare it later, so better make sure it’s 0 or 1.

gtk/gtkmenushell.c

index a69bc0ada8d868f79641795c98c5bddbb3426590..494aff5402d8819dc70545aae24fb0836f9096f6 100644 (file)
@@ -1692,6 +1692,7 @@ gtk_menu_shell_set_take_focus (GtkMenuShell *menu_shell,
 
   priv = menu_shell->priv;
 
+  take_focus = !!take_focus;
   if (priv->take_focus != take_focus)
     {
       priv->take_focus = take_focus;