Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conditions: Desk does not take a string #741

Closed
ThomasAdam opened this issue Nov 1, 2022 · 2 comments · Fixed by #895
Closed

conditions: Desk does not take a string #741

ThomasAdam opened this issue Nov 1, 2022 · 2 comments · Fixed by #895
Labels
relates:functions Issues is in function code skip:changelog Issue/PR should skip CHANGELOG type:bug Something's broken!

Comments

@ThomasAdam
Copy link
Member

The Desk conditional parameter does not take a string as its argument and only assumes an int. Hence, it is not possible to stipulate the following:

None (Desk $[monitor.$[monitor.current].desk]) Echo yep

This should be changed to allow for a string, expanding it via expand_vars() and assigning the result as an int to the relevant bitfield mask in the condition structure that Desk is using.

@ThomasAdam ThomasAdam added type:bug Something's broken! relates:functions Issues is in function code labels Nov 1, 2022
@ThomasAdam ThomasAdam added this to the 1.0.6 milestone Nov 1, 2022
ThomasAdam added a commit that referenced this issue Nov 4, 2022
When passing in a desk condition, such as:

    Next (Desk $[monitor.[$monitor.primary].desk]) Echo hello

This would not have worked priviously as the string was being taken
literally as an integer.

Instead, expand the string first.

Fixes #741
ThomasAdam added a commit that referenced this issue Nov 15, 2022
When passing in a desk condition, such as:

    Next (Desk $[monitor.[$monitor.primary].desk]) Echo hello

This would not have worked priviously as the string was being taken
literally as an integer.

Instead, expand the string first.

Fixes #741
@ThomasAdam ThomasAdam removed this from the 1.0.6 milestone Jan 14, 2023
@ThomasAdam ThomasAdam added the skip:changelog Issue/PR should skip CHANGELOG label Aug 30, 2023
@ThomasAdam
Copy link
Member Author

Seems to work fine for me. The resultant .desk lookup is expanded as an int anyway.

@ThomasAdam ThomasAdam closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2023
@ThomasAdam ThomasAdam removed the skip:changelog Issue/PR should skip CHANGELOG label Aug 31, 2023
ThomasAdam added a commit that referenced this issue Aug 31, 2023
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
@ThomasAdam ThomasAdam added the skip:changelog Issue/PR should skip CHANGELOG label Aug 31, 2023
@ThomasAdam
Copy link
Member Author

Will fix this via #895 instead.

@somiaj -- #895 also fixes the double if statement logic you identified.

ThomasAdam added a commit that referenced this issue Aug 31, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relates:functions Issues is in function code skip:changelog Issue/PR should skip CHANGELOG type:bug Something's broken!
Projects
Status: Done
1 participant