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

Issue 3284: deal with "sh: line 1: activate not found" #3420

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RobertMueller2
Copy link
Contributor

@RobertMueller2 RobertMueller2 commented Jul 7, 2024

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. :p

The actions now have to be given within an action object, like this:

    "wlr/taskbar": {
      "format": "{icon}",
      "icon-size": 24,
      "all-outputs": false,
//      "on-update": "echo \"$(date) XYZ\" >> ~/xyz.log"
      "actions" : {
          "on-click": "activate",
          "on-click-middle": "close",
          "on-click-right": "activate",
      }
    },

Otherwise AModule would not call wlr/taskbar's overridden doAction. Existing configs still work in the same broken way, but will cause warning messages.

@RobertMueller2 RobertMueller2 marked this pull request as draft July 8, 2024 05:42
@RobertMueller2
Copy link
Contributor Author

RobertMueller2 commented Jul 8, 2024

I changed this back to draft, I realised I might have interrupted drag+drop in case no actions are configured. This will require a small rework.

I might also add some trace logging for future troubleshooting of actions not having an effect against compositors.

Edit: all sorted now.

@RobertMueller2 RobertMueller2 marked this pull request as ready for review July 8, 2024 15:55
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

1 participant