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

Touch input does not work under Wayland #83

Open
glaubersm opened this issue Sep 2, 2017 · 3 comments
Open

Touch input does not work under Wayland #83

glaubersm opened this issue Sep 2, 2017 · 3 comments
Labels

Comments

@glaubersm
Copy link

Hi
My laptop has a touch screen, nothing happens when I touch some icon shown by topicons plus extension. My extension was installed via Gnome extensions website.
I use Gnome Shell 3.24.3 under Wayland on Arch linux.

@phocean phocean added the bug label Sep 5, 2017
@phocean
Copy link
Owner

phocean commented Sep 5, 2017

Hi,
Thanks for the report.
I do not own a machine with touch input, so I am in trouble for testing it. But I will see what we can do.

@frnco
Copy link

frnco commented Feb 26, 2019

Hi
My laptop has a touch screen, nothing happens when I touch some icon shown by topicons plus extension. My extension was installed via Gnome extensions website.
I use Gnome Shell 3.24.3 under Wayland on Arch linux.

Some additions:

  1. Same is true for every tray extension out there;
  2. Right-click actually works on two very small areas, on the top and bottom of the icon;
  3. If you increase the Icon Size the clickable area apparently gets pushed off the screen;
  4. Conversely, if you decrease Icon Size, the clickable area gets bigger.

Based on what I've tried, I'd guess there is a clickable "area" that is being covered by the icon, plus clicking on the icon has no effect.

@phocean I can send a PR with a fix if you give me some info (1 - Which tests I should include, 1 - How to test/use it on my machine as I work on it, and 3 - some pointers to the main files containing code that deals with clicks and with rendering the icon).

edit: Just found a quick, easy and kinda hack-ish fix:

iconContainer.connect('button-release-event', function(actor, event) {
    icon.click(event);
});

// Hack-ish fix to make icon clickable
icon.connect('button-release-event', function(actor, event) {
    icon.click(event);
});

// hack-ish fix for touch events
iconContainer.connect('touch-event', function(actor, event) {
    icon.click(event);
});
icon.connect('touch-event', function(actor, event) {
    icon.click(event);
});

Refactoring would be better, but I decided this is good enough for me:

[iconContainer, icon].forEach(function(clickableElement){
    ['button-release-event', 'touch-event'].forEach(function(eventName){
        clickableElement.connect(eventName, function(actor, event) {
            icon.click(event);
        });
    });
});

@phocean
Copy link
Owner

phocean commented Apr 14, 2020

@frnco Thank you for the proposals, and sorry for the delay in my response.

It seems very interesting, but I still do not have any device to test it. Ideally, I would like that a few people review it and confirm it works on touch screens.

For the rest, I would just make sure that it still works as expected on standard configurations.

So yes, if it's still possible, I would love a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants