diff --git a/src/filemanager/chmod.c b/src/filemanager/chmod.c index c2e435cbe..a51b47ebc 100644 --- a/src/filemanager/chmod.c +++ b/src/filemanager/chmod.c @@ -232,12 +232,26 @@ chmod_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *da /* handle checkboxes */ if (id >= 0) { - c_stat ^= check_perm[id].mode; - g_snprintf (buffer, sizeof (buffer), "%o", (unsigned int) c_stat); - label_set_text (statl, buffer); - chmod_toggle_select (h, id); - mode_change = TRUE; - return MSG_HANDLED; + gboolean sender_is_checkbox = FALSE; + unsigned int i; + + /* whether action was sent by checkbox? */ + for (i = 0; i < check_perm_num; i++) + if (sender == (Widget *) check_perm[i].check) + { + sender_is_checkbox = TRUE; + break; + } + + if (sender_is_checkbox) + { + c_stat ^= check_perm[id].mode; + g_snprintf (buffer, sizeof (buffer), "%o", (unsigned int) c_stat); + label_set_text (statl, buffer); + chmod_toggle_select (h, id); + mode_change = TRUE; + return MSG_HANDLED; + } } return MSG_NOT_HANDLED;