Don't make desktop switching interactive when no mods used. (Fix bug #5203)
[mikachu/openbox.git] / openbox / actions / cyclewindows.c
index bbcb658..a64d225 100644 (file)
@@ -75,6 +75,8 @@ static gpointer setup_func(xmlNodePtr node,
     if ((n = obt_xml_find_node(node, "dialog"))) {
         if (obt_xml_node_contains(n, "none"))
             o->dialog_mode = OB_FOCUS_CYCLE_POPUP_MODE_NONE;
+        else if (obt_xml_node_contains(n, "no"))
+            o->dialog_mode = OB_FOCUS_CYCLE_POPUP_MODE_NONE;
         else if (obt_xml_node_contains(n, "icons"))
             o->dialog_mode = OB_FOCUS_CYCLE_POPUP_MODE_ICONS;
     }
@@ -179,8 +181,9 @@ static gboolean i_input_func(guint initial_state,
                              gboolean *used)
 {
     Options *o = options;
-    guint mods;
+    guint mods, initial_mods;
 
+    initial_mods = obt_keyboard_only_modmasks(initial_state);
     mods = obt_keyboard_only_modmasks(e->xkey.state);
     if (e->type == KeyRelease) {
         /* remove from the state the mask of the modifier key being
@@ -199,14 +202,14 @@ static gboolean i_input_func(guint initial_state,
         }
 
         /* There were no modifiers and they pressed enter */
-        else if ((sym == XK_Return || sym == XK_KP_Enter) && !initial_state) {
+        else if ((sym == XK_Return || sym == XK_KP_Enter) && !initial_mods) {
             o->cancel = FALSE;
             o->state = e->xkey.state;
             return FALSE;
         }
     }
     /* They released the modifiers */
-    else if (e->type == KeyRelease && initial_state && !(mods & initial_state))
+    else if (e->type == KeyRelease && initial_mods && !(mods & initial_mods))
     {
         o->cancel = FALSE;
         o->state = e->xkey.state;