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

Tablet Input Broken on Wayland #44

Closed
andersonjwan opened this issue Jul 31, 2020 · 6 comments · Fixed by #57
Closed

Tablet Input Broken on Wayland #44

andersonjwan opened this issue Jul 31, 2020 · 6 comments · Fixed by #57
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@andersonjwan
Copy link

Hello, so I have just been recently using Notekit; however, I have ran across a bug where the input system does not properly draw from the tablet when using Wayland. I tested on Xorg, and the input works perfectly, but I am wondering why Wayland seems to have an issue.

It seems that a stroke object is created, but the actually drawing does not work with the input from the tablet leaving a blank object. Using a mouse input and draw tool seems to work, however.

Let me know if you need any further details to look into and/or resolve the issue. Thanks!

@blackhole89
Copy link
Owner

blackhole89 commented Aug 18, 2020

Unfortunately, I don't have access to any Wayland-based system to test it on myself. I think it's most likely that there is some issue with the pressure detection. Does the drawing that is created when painting with the tablet reflect the size of the painting correctly? (i.e. is it an empty box corresponding in size to what you drew?) Also, when drawing with the tablet, is there any output to stdout (you may have to run the binary in a terminal if you don't already) of the form old: <number>, new: <number>?

@andersonjwan
Copy link
Author

andersonjwan commented Aug 24, 2020

Yes, there seems to be a bounding box around the "blank" drawing. There is also output on the terminal, so it's being recognized, just the drawing itself isn't shown. I have attached a screenshot below to better help debug it.

screenshot_002

== This is notekit, built at Mon Apr 27 08:48:48 2020. ==
Detected paths:
Config: /home/andersonjwan/.config/notekit
Active notes path: /home/andersonjwan/.local/share/notekit
Default notes path: /home/andersonjwan/.local/share/notekit
Resource path: /usr/share//notekit

color1
autosave
old: 11, new: 6
old: 12, new: 6
old: 11, new: 5
old: 6, new: 4
old: 8, new: 3
old: 3, new: 3
old: 5, new: 4
old: 16, new: 11
old: 7, new: 4
old: 7, new: 3
autosave

The output above is recorded from the pen's input on the tablet.

@sp1ritCS
Copy link
Contributor

sp1ritCS commented Oct 3, 2020

Same issue on wayland

this is what is saved in the file:
https://bin.privacytools.io/?a4d150caab932be1#Ug6HCp6xjghdiLF/Ah4dUsJBNjhHS3gE5/ENCQ4lgBM=

@blackhole89
Copy link
Owner

Thanks for the file. As I suspected, the pressure for all the strokes in the wayland drawing is recorded as 0.

I've tried to reproduce this, but Weston for me straight up does not recognise my wacom digitiser, and I had no luck installing any other Wayland compositor because of dependency hell in my Frankendebian setup. What sort of system did you produce the file linked above in?

(I can try to hack in some kind of workaround for systems where the device reports having a "pressure" axis but always reads 0, but the best thing I could do would be pinning it to always have constant pressure, and it would not be a particularly good solution either way.)

@blackhole89 blackhole89 added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Nov 13, 2020
@blackhole89
Copy link
Owner

blackhole89 commented Nov 13, 2020

If anyone with a Wayland setup with digitiser support wants to take a stab at this, the relevant logic is pretty compact (found in CNotebook::ReadPressure in notebook.cpp). The key is the part that reads

    gdk_device_get_state(d,w,axes,NULL); 
    if(gdk_device_get_axis(d,axes,GDK_AXIS_PRESSURE,&r))
        return r;
    else return 1.0;

The expected behaviour would be that this returns false whenever GDK_AXIS_PRESSURE is not available (see documentation), but in all likelihood that's not happening here.

@sp1ritCS
Copy link
Contributor

What sort of system did you produce the file linked above in?

openSUSE Tumbleweed, GNOME

The expected behaviour would be that this returns false whenever GDK_AXIS_PRESSURE is not available (see documentation), but in all likelihood that's not happening here.

Well, It should be available (also returns true), but it writes 0.0 to r

If anyone with a Wayland setup with digitiser support wants to take a stab at this

I've tried, but I'm not a C Dev, so I had no Idea what I was doing; I found this function on the GdkDevice Docs

gdk_device_get_axis_value(d, axes, gdk_atom_intern_static_string ("Abs Pressure"), &r) -> bool

But this time it returns false (dunno if it does this on X as well)


I don't know if it is possible for you to setup qemu/kvm/libvirt on your "Frankendebian setup" but if you do, you could pass through the usb of the tablet and run wayland in there.

If I can help you with anything let me know.

blackhole89 added a commit that referenced this issue Nov 14, 2020
Fix pressure being read as 0 on Wayland (probably fixes #44)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants