Issue 3284: wlr/taskbar: deal with "sh: line 1: activate not found" #3420
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to issue #3284. Not closing from here, as there might be further problems.
Since PR #1977, both AModule and wlr/taskbar are handling on-click, on-click-right, on-click-middle. Since wlr/taskbar has internal actions "activate", "close", ... etc, wlr/taskbar performs those, and AModule tries to execute them as a command, this leads to messages like:
sh: line 1: activate: command not found
. (Interestingly, it seems to always happen for right click and middle click, I could never reproduce the message for left click and have not understood why this is the case.) If the action as such works against the compositor, it is still performed. But the error message might suggest an actual error situation, so it is somewhat confusing.This PR addresses this in a minimally invasive fashion (I think anyway) by overriding
doAction
to do nothing. The challenge here was that AModule provides action handling for the whole module, but wlr/taskbar needs the event handling on the individual buttons so we can't really get rid of the existing event handling within wlr/taskbar easily. I feel that in the long run, there could be a Buttons mode for AModule, or an AButtonsModule extending AModule which could deal with this challenge. But that kind of change was a bit too big for my liking though, I don't even know if we have any other modules with individual buttons that would benefit from such a generic implementation. And I'm not that great a C++ coder. :pThe actions now have to be given within an action object, like this:
Otherwise AModule would not call wlr/taskbar's overridden
doAction
. Existing configs still work in the same broken way, but will cause warning messages.