Moon-0xff / gnome-mpris-label

A music related GNOME extension.
GNU General Public License v3.0
51 stars 10 forks source link

Mouse can't use the volume controls #51

Closed alexou2 closed 1 year ago

alexou2 commented 1 year ago

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 1 year ago

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:

alexou2 commented 1 year ago

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 1 year ago

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

Moon-0xff commented 1 year ago

@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.

alexou2 commented 1 year ago

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

alexou2 commented 1 year ago

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

Moon-0xff commented 1 year ago

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.

Moon-0xff commented 1 year ago

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 1 year ago

Any update on this?

alexou2 commented 1 year ago

sorry, I didn't have time to try

Moon-0xff commented 1 year ago

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 1 year ago

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

alexou2 commented 1 year ago

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

alexou2 commented 1 year ago

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 1 year ago

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

alexou2 commented 1 year ago

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

Moon-0xff commented 1 year ago

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

Every 300 milliseconds by default.

alexou2 commented 1 year ago

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

Moon-0xff commented 1 year ago

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)

alexou2 commented 1 year ago

I am modifying the extenson files directly and then log out

alexou2 commented 1 year ago

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