After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 782040 - Wacom pen calibration application responds to mouse input
Wacom pen calibration application responds to mouse input
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Wacom
3.24.x
Other Linux
: Normal normal
: ---
Assigned To: Carlos Garnacho
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-05-01 23:36 UTC by Jason Gerecke
Modified: 2017-06-30 19:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wacom: Make calibrator use GDK for button events (5.62 KB, patch)
2017-06-16 17:52 UTC, Carlos Garnacho
committed Details | Review
wacom: Map the GsdDevice to a GdkDevice when spawning the calibrator (2.14 KB, patch)
2017-06-16 17:52 UTC, Carlos Garnacho
none Details | Review
GTK: x11: Assign GDK_SOURCE_TABLET_PAD when necessary (1.12 KB, patch)
2017-06-27 22:16 UTC, Jason Gerecke
committed Details | Review
wacom: Map the GsdDevice to a GdkDevice when spawning the calibrator (2.76 KB, patch)
2017-06-29 22:48 UTC, Carlos Garnacho
committed Details | Review

Description Jason Gerecke 2017-05-01 23:36:15 UTC
When performing a pen calibration under Wayland, the utility appears to respond to normal mouse clicks instead of /only/ pen taps. This doesn't cause too much of an issue since the clicks will often trigger the "mis-click" detection, but its still not desirable.

System Info
--------------
Arch Linux
gnome-control-center 3.24.1-1
gnome-settings-daemon 3.24.1+7+g42f75ed4-1
mutter 3.24.1+1+geb394f19d-1
xf86-input-wacom 0.34.2-1
xorg-server 1.19.3-2

Wayland session
Comment 1 Carlos Garnacho 2017-06-16 17:52:03 UTC
Created attachment 353911 [details] [review]
wacom: Make calibrator use GDK for button events

This way we can cut down the last step in the mapping across
GUdevDevice->GsdDevice->GdkDevice->ClutterInputDevice.
Comment 2 Carlos Garnacho 2017-06-16 17:52:09 UTC
Created attachment 353912 [details] [review]
wacom: Map the GsdDevice to a GdkDevice when spawning the calibrator

This makes the calibrator only reactive to the tablet being calibrated
again.
Comment 3 Jason Gerecke 2017-06-16 22:34:50 UTC
The code looks reasonable enough* but doesn't seem to be working for some reason. The calibration UI still responds to clicks from all of my input devices. I'll have to poke around and see if I can figure out what's going next week unfortunately...

Nitpick: Is there any way to match more specifically than by VID:PID? It should be fine, if a little imprecise. The chances of someone have two same-model display tablets connected should be pretty low, and on top of that GNOME would have to have incorrect display mapping to cause the calibration window to appear on the wrong head.
Comment 4 Carlos Garnacho 2017-06-16 23:20:23 UTC
(In reply to Jason Gerecke from comment #3)
> The code looks reasonable enough* but doesn't seem to be working for some
> reason. The calibration UI still responds to clicks from all of my input
> devices. I'll have to poke around and see if I can figure out what's going
> next week unfortunately...

Right... wayland needed https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=9e740bd4355ac57b97fd6698fa5da27cf2be89ab additionally.

> 
> Nitpick: Is there any way to match more specifically than by VID:PID? It
> should be fine, if a little imprecise. The chances of someone have two
> same-model display tablets connected should be pretty low, and on top of
> that GNOME would have to have incorrect display mapping to cause the
> calibration window to appear on the wrong head.

True, we could use the /dev/input path, unfortunately that's down to backend-specific GDK calls, probably better would be to do the lookup in GsdDeviceManager x11/wayland dependent paths.
Comment 5 Jason Gerecke 2017-06-19 18:28:45 UTC
(In reply to Carlos Garnacho from comment #4)
> (In reply to Jason Gerecke from comment #3)
> > The code looks reasonable enough* but doesn't seem to be working for some
> > reason. The calibration UI still responds to clicks from all of my input
> > devices. I'll have to poke around and see if I can figure out what's going
> > next week unfortunately...
> 
> Right... wayland needed
> https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-
> 22&id=9e740bd4355ac57b97fd6698fa5da27cf2be89ab additionally.
> 
Thanks for the tip -- that seems to do the trick. Calibration now only responds to input from the tablet being calibrated.
Comment 6 Jason Gerecke 2017-06-20 19:42:37 UTC
Actually, I've just ran into an issue with this patch. Looks like its possible under an X11 session for the "pad" device to be returned by `cc_wacom_page_get_gdk_device`. This prevents the pen from being used for calibration since its a different device. I'd normally say that the pad shouldn't be classified as a GDK_SOURCE_PEN device, but I wonder if any software relies on it being one...
Comment 7 Jason Gerecke 2017-06-27 22:16:31 UTC
Created attachment 354589 [details] [review]
GTK: x11: Assign GDK_SOURCE_TABLET_PAD when necessary

Just realized Wayland already sets pad devices as GDK_SOURCE_TABLET_PAD, so we might as well be consistent and do the same thing under X. Doing so should fix the calibration issue I ran into earlier.
Comment 8 Carlos Garnacho 2017-06-29 22:48:39 UTC
Created attachment 354713 [details] [review]
wacom: Map the GsdDevice to a GdkDevice when spawning the calibrator

This makes the calibrator only reactive to the tablet being calibrated
again.
Comment 9 Carlos Garnacho 2017-06-29 22:55:23 UTC
Comment on attachment 354589 [details] [review]
GTK: x11: Assign GDK_SOURCE_TABLET_PAD when necessary

Better GDK_SOURCE_TABLET_PAD than GDK_SOURCE_MOUSE :). It's pretty clear that GTK ever had involvement with pads, thanks to g-s-d passive grabs.
Comment 10 Jason Gerecke 2017-06-30 18:23:45 UTC
Comment on attachment 354713 [details] [review]
wacom: Map the GsdDevice to a GdkDevice when spawning the calibrator

>+
>+		if (g_strcmp0 (device_node, gsd_device_get_device_file (gsd_device)))
>+			gdk_device = l->data;
>+
>+		g_free (device_node);
>+	}

Missing an `== 0` at the end of your string comparison, but otherwise looks good.
Comment 11 Carlos Garnacho 2017-06-30 19:13:48 UTC
(In reply to Jason Gerecke from comment #10)
> Comment on attachment 354713 [details] [review] [review]
> wacom: Map the GsdDevice to a GdkDevice when spawning the calibrator
> 
> >+
> >+		if (g_strcmp0 (device_node, gsd_device_get_device_file (gsd_device)))
> >+			gdk_device = l->data;
> >+
> >+		g_free (device_node);
> >+	}
> 
> Missing an `== 0` at the end of your string comparison, but otherwise looks
> good.

Yeah, g_strcmp vs g_str_equal thinko... I noticed after sending and had it fixed locally. Thanks for the keen eye :).
Comment 12 Carlos Garnacho 2017-06-30 19:29:21 UTC
Attachment 353911 [details] pushed as b26d6ac - wacom: Make calibrator use GDK for button events
Attachment 354713 [details] pushed as 42489e2 - wacom: Map the GsdDevice to a GdkDevice when spawning the calibrator