Moon-0xff/gnome-mpris-label

Mouse can't use the volume controls

Closed this issue · 21 comments

in the menu, I can't configure an action for when I scroll. the default is to change the volume, buut it doesn't work and I can't configure any action for it.

Batwam commented

Hi, these options are currently disabled as the other actions wouldn't be something you'd want to use scroll for since scroll sends multiple requests so selecting something like "next song" would skip 5-10 songs at a time.
https://github.com/Moon-0xff/gnome-mpris-label/blob/main/prefs.js#L208

(@Moon-0xff it might be better to simply hide them to avoid confusing users?)

What you can do is change the "type" of volume you change though between system and app. Default is application. The application mode could fail if this isn't implemented properly in the app you use.
image
You mention that this isn't working for you:

  • which app are you using?
  • does the global mode work?
  • are you using a mouse or trackpad?

The issue appears both in global mode and in app mode. Also, i can change the volume if i configure another button to do so, just not the scroll wheel. I only get the issue when i'm using a mouse.

Batwam commented

Ok, seems like a mouse issue with the event not being recognised then.

In relation to the greyed out drop downs, I just noticed that @Moon-0xff is already working on it in #50.

To troubleshoot the mouse issue, could generate a log from extensions.js to provide the number associated with the scroll for your mouse? To start off, we would need to know if _onClick(event) or _onScroll(event) are triggered. If it goes into onScroll, try to figure out at what point it's exiting by including logs are various locations within the function.

Include a log(...) statement (there are examples commented out in the code I believe) and run journalctl --follow to capture them. https://gjs.guide/extensions/development/debugging.html#restarting-gnome-shell

@Batwam already answered, as an addition you could check out my comments on #49

Regarding the problems with the scroll it looks like a detection issue (as @Batwam pointed out).

Can you change the volume by scrolling on the volume icon?
If not then this might be a shell issue.

If you mean the volume icon in the gnome status bar, yes. I can scroll over the icon and the volume will change. I am running ununto 22.04 with wayland if it can be helpful

As far as i can tell, the problem is that the extension doesn't register scroll actions with the mouse (the trackpad works fine)

Yes, that means the problem is our detection code, adding the line:

log(delta)

just below the line:

delta = Math.clamp(-1,delta,1);

and checking the output with journalctl --follow might be enough information to work out what's wrong with the extension.

extension.js, line 154 (current main).
You need to reinstall the files with ./install.sh if you aren't editing the files directly, and reload the shell (on wayland you need to log out to reload the shell).

Batwam commented

Any update on this?

sorry, I didn't have time to try

I will add that if the above log doesn't produce any output it might be that your device doesn't generate a Clutter.ScrollDirection.SMOOTH event.

Pointer devices can create three types of "direction" events.
We ignore the other two because they were problematic and (possibly) redundant.

Batwam commented

@alexou2 could you please advise? If would be great to understand at what step the code fails to recognise the mouse action.

it woks when using xorg. I'll try using wayland

I can't get any log from the extension I tried lg and journalctl --follow and couldn't get the logs (even with the trackpad, which does change the volume)

Batwam commented

if you include log('Hello World'); within the _refresh() loop do you see it?

I can't see the log. when if _refresh() supposed to be triggered?

I can't see the log. when if _refresh() supposed to be triggered?

Every 300 milliseconds by default.

Can you show me a screenshot of what is the log supposed to look like? I might be doing something wrong

Can you show me a screenshot of what is the log supposed to look like?

I don't know how's that of any use.

I might be doing something wrong

Perhaps you didn't run the installation script: sh install.sh
you also need to reload the shell after re-installing the extension (details above)

I am modifying the extenson files directly and then log out

I upgraded my install to ubuntu 23.04 to fix other problems and now it works