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

Check if subscribe event type is supported in AnyEvent::I3 #5988

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

waterkip
Copy link
Contributor

@waterkip waterkip commented Apr 8, 2024

Add simple `if exists' construct in the subscribe function. This prevents a somewhat cryptic warnings such as these:

Use of uninitialized value $type in hash element at /usr/share/perl5/AnyEvent/I3.pm line 309.

We still warn the user, but it is much clearer as to what the cause is.

It now shows something like this:

Could not subscribe to event type 'foo'. Supported events are _error barconfig_update binding mode output shutdown tick window workspace

Add simple `if exists' construct in the subscribe function. This
prevents a somewhat cryptic warnings such as these:

Use of uninitialized value $type in hash element at /usr/share/perl5/AnyEvent/I3.pm line 309.

We still warn the user, but it is much clearer as to what the cause is.

Signed-off-by: Wesley Schwengle <wesleys@opperschaap.net>
@spwhitton
Copy link

Thanks, this prevents one having to dive into the code to know why you can't, e.g., subscribe to ticks on the version of this lib in Debian.

@waterkip
Copy link
Contributor Author

waterkip commented Apr 8, 2024

Thanks, this prevents one having to dive into the code to know why you can't, e.g., subscribe to ticks on the version of this lib in Debian.

That was actually the reason why I added this :)

@spwhitton
Copy link

Thanks, this prevents one having to dive into the code to know why you can't, e.g., subscribe to ticks on the version of this lib in Debian.

That was actually the reason why I added this :)

Quite the coincidence that two of us were trying to do this today :)

@waterkip
Copy link
Contributor Author

waterkip commented Apr 8, 2024

Thanks, this prevents one having to dive into the code to know why you can't, e.g., subscribe to ticks on the version of this lib in Debian.

That was actually the reason why I added this :)

Quite the coincidence that two of us were trying to do this today :)

Indeed. I also filed a bug report at Debian btw, see bts 1068616.

@spwhitton
Copy link

Thanks, this prevents one having to dive into the code to know why you can't, e.g., subscribe to ticks on the version of this lib in Debian.

That was actually the reason why I added this :)

Quite the coincidence that two of us were trying to do this today :)

Indeed. I also filed a bug report at Debian btw, see bts 1068616.

FTFY

@stapelberg stapelberg merged commit d91597b into i3:next Apr 9, 2024
3 checks passed
@waterkip waterkip deleted the eventtypes branch April 11, 2024 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants