Skip to content

Commit

Permalink
conditional: Screen+Desk is not mutually-exclusive
Browse files Browse the repository at this point in the history
When a conditional has both screen and desk in, such as:

    All (Screen HDMI-1, Desk 0) Echo "$[w.name]"

the previous logiv was to treat those options as mutually exclusive --
hence, one or the other would match, but never both.

This commit fixes this by checking for both conditions if they're
present, otherwise defaulting to treating them separately if only one of
them appears.

Fixes #741
  • Loading branch information
ThomasAdam committed Aug 31, 2023
1 parent 2eb6692 commit b454ca0
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions fvwm/conditional.c
Original file line number Diff line number Diff line change
Expand Up @@ -1122,17 +1122,26 @@ Bool MatchesConditionMask(FvwmWindow *fw, WindowConditionMask *mask)
return False;
}
}

if (mask->my_flags.do_check_cond_desk &&
mask->my_flags.do_check_screen) {
if (fw->Desk == mask->desk) {
/*Check the screen. */
if (mask->my_flags.do_not_check_screen) {
/* Negation of (!screen n) specified. */
return (fw->m != mask->screen);
} else
return (fw->m == mask->screen);
}
return False;
}

if (mask->my_flags.do_check_cond_desk)
{
if (fw->Desk == mask->desk)
return True;
else
return False;

if (fw->Desk != mask->desk)
return True;
else
return False;
}
if (mask->my_flags.do_check_screen)
{
Expand Down

0 comments on commit b454ca0

Please sign in to comment.