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 781907 - xrandr: Move GsdDeviceMapper handling to wacom plugin
xrandr: Move GsdDeviceMapper handling to wacom plugin
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: wacom
unspecified
Other All
: Normal normal
: ---
Assigned To: Carlos Garnacho
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2017-04-28 16:19 UTC by Rui Matos
Modified: 2017-07-18 20:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
power: Remove gsd-device-mapper.h include (753 bytes, patch)
2017-04-28 16:19 UTC, Rui Matos
committed Details | Review
xrandr: Move GsdDeviceMapper handling to wacom plugin (5.37 KB, patch)
2017-04-28 16:19 UTC, Rui Matos
none Details | Review
xrandr: Move GsdDeviceMapper handling to wacom plugin (5.16 KB, patch)
2017-05-03 13:22 UTC, Rui Matos
committed Details | Review

Description Rui Matos 2017-04-28 16:19:14 UTC
I'll be moving the xrandr plugin functionality to mutter soon. Before,
here's a bit that can't be moved and should in fact be in wacom.
Comment 1 Rui Matos 2017-04-28 16:19:18 UTC
Created attachment 350667 [details] [review]
power: Remove gsd-device-mapper.h include

It's unused.
Comment 2 Rui Matos 2017-04-28 16:19:23 UTC
Created attachment 350668 [details] [review]
xrandr: Move GsdDeviceMapper handling to wacom plugin

GsdDeviceMapper's only remaining role is to map wacom
tablets/touchscreens to outputs which logically belongs in the wacom
plugin and is already being done there for some device types so let's
move the other device type that was being handled here to that plugin
too.
Comment 3 Bastien Nocera 2017-04-28 18:56:03 UTC
I think Carlos needs to look at this.
Comment 4 Bastien Nocera 2017-04-28 18:56:17 UTC
Review of attachment 350667 [details] [review]:

Sure.
Comment 5 Bastien Nocera 2017-04-28 19:00:21 UTC
Review of attachment 350668 [details] [review]:

::: plugins/wacom/gsd-wacom-manager.c
@@ +287,3 @@
+	if (((device_type & GSD_DEVICE_TYPE_TABLET) != 0 &&
+             (device_type & GSD_DEVICE_TYPE_TOUCHPAD) == 0)
+            ||

Great cleanup, and but this is really ugly. Splitting the condition in a separate function, or repeating the content of the conditional might be better.

if ((device_type & GSD_DEVICE_TYPE_TABLET) != 0 &&
   (device_type & GSD_DEVICE_TYPE_TOUCHPAD) == 0) {
   _add_input();
} else if (device_type & GSD_DEVICE_TYPE_TOUCHSCREEN) != 0) {
   _add_input();
}

would be more readable.
Comment 6 Rui Matos 2017-05-03 13:22:46 UTC
Created attachment 350978 [details] [review]
xrandr: Move GsdDeviceMapper handling to wacom plugin

--

reworked the conditional as suggested
Comment 7 Bastien Nocera 2017-05-06 10:01:01 UTC
Review of attachment 350978 [details] [review]:

That looks fine. Carlos?
Comment 8 Rui Matos 2017-07-18 19:45:55 UTC
I'm fairly sure this is correct. If it isn't we can easily revert.

Attachment 350667 [details] pushed as 107c36c - power: Remove gsd-device-mapper.h include
Attachment 350978 [details] pushed as 41f1564 - xrandr: Move GsdDeviceMapper handling to wacom plugin
Comment 9 Carlos Garnacho 2017-07-18 19:55:15 UTC
Uhm, sorry, missed this bug... Kinda late, but looks alright to me too, makes sense to make all mapping happen in a single place.
Comment 10 Rui Matos 2017-07-18 20:10:09 UTC
(In reply to Carlos Garnacho from comment #9)
> Uhm, sorry, missed this bug... Kinda late, but looks alright to me too,
> makes sense to make all mapping happen in a single place.

Thanks. In fact, since this code was now running in separate processes I think it wasn't even doing what it was supposed to do.
Comment 11 Carlos Garnacho 2017-07-18 20:47:26 UTC
Oh, as far as I could tell it still did. IIRC GsdDeviceMapper discriminates so it doesn't try to eg. assign the same output to two touchscreen devices, but tablet and touchscreen devices should be isolated sets anyway.

Still seems better to have this in a single place, touchscreen handling in xrandr module was just as alien :).