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 763859 - gdkdevice-wayland.c cleanups
gdkdevice-wayland.c cleanups
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-03-18 11:14 UTC by Carlos Garnacho
Modified: 2016-03-21 16:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: Remove GdkWaylandDeviceData pointer in GdkWaylandDevice (33.37 KB, patch)
2016-03-18 11:15 UTC, Carlos Garnacho
committed Details | Review
wayland: Remove GdkWaylandDeviceData typedef (59.82 KB, patch)
2016-03-18 11:15 UTC, Carlos Garnacho
none Details | Review
wayland: Rename internal functions with misleading naming (8.77 KB, patch)
2016-03-18 11:15 UTC, Carlos Garnacho
committed Details | Review
wayland: Replace all remaining uses of GdkWaylandDeviceData (59.18 KB, patch)
2016-03-18 13:19 UTC, Carlos Garnacho
committed Details | Review
wayland: Remove GdkWaylandDataDevice typedef (938 bytes, patch)
2016-03-18 13:19 UTC, Carlos Garnacho
committed Details | Review

Description Carlos Garnacho 2016-03-18 11:14:19 UTC
When GdkSeat was introduced, the older GdkWaylandDeviceData (that mostly represented a seat) was renamed to GdkWaylandSeat, but a typedef to GdkWaylandDeviceData was kept around, as the changes were too many, too unrelated, and would create many conflicts with patches/branches that were pending merging.

Now that the situation is more or less clear, I'm attaching some patches doing this cleanup. Further future refactoring might split this into gdkseat-wayland.[ch] and gdkdevice-wayland.[ch] so we don't manage all of GdkSeat+GdkDeviceManager+GdkDevice (+ parts of GdkDragContext) in a single C file, I'll refrain from this till wip/tablet-support is merged though.

The patches are basically a manual search and replace, sanity checks/review appreciated though.
Comment 1 Carlos Garnacho 2016-03-18 11:15:11 UTC
Created attachment 324247 [details] [review]
wayland: Remove GdkWaylandDeviceData pointer in GdkWaylandDevice

It's the same than gdk_device_get_seat() nowadays. Also, rename the
usages of GdkWaylandDeviceData to GdkWaylandSeat in the functions
affected by the removal.
Comment 2 Carlos Garnacho 2016-03-18 11:15:18 UTC
Created attachment 324248 [details] [review]
wayland: Remove GdkWaylandDeviceData typedef

And let GdkWaylandSeat be the only one. All the remaining places
using GdkWaylandDeviceData have been updated, and so are its variable
names.
Comment 3 Carlos Garnacho 2016-03-18 11:15:24 UTC
Created attachment 324249 [details] [review]
wayland: Rename internal functions with misleading naming

Now that GdkWaylandDeviceData is gone, the functions prefixed
"gdk_wayland_device_" and taking a GdkWaylandSeat as first
parameter feel out of place. Renaming those makes it more obvious
that it's seat functions.
Comment 4 Matthias Clasen 2016-03-18 12:19:40 UTC
Review of attachment 324247 [details] [review]:

Looks good to me. Do you want this on 3.20.x too, in addition to master ? Might make cherry picking easier
Comment 5 Matthias Clasen 2016-03-18 12:21:24 UTC
Review of attachment 324248 [details] [review]:

Does the gdkdevice-wayland.c belong into the previous patch ? Or maybe a separate one. In any case, it might be nice to have "Remove unused typedef" be a separate patch that does just that.
Comment 6 Matthias Clasen 2016-03-18 12:22:37 UTC
Review of attachment 324249 [details] [review]:

Sure, looks fine to me
Comment 7 Matthias Clasen 2016-03-18 12:22:45 UTC
Review of attachment 324249 [details] [review]:

Sure, looks fine to me
Comment 8 Carlos Garnacho 2016-03-18 13:05:04 UTC
(In reply to Matthias Clasen from comment #4)
> Review of attachment 324247 [details] [review] [review]:
> 
> Looks good to me. Do you want this on 3.20.x too, in addition to master ?
> Might make cherry picking easier

Yeah, I was thinking the same, might not help as much in the end if we go full blown into separating gdkseat-wayland.c after tablet support... but still better to have code match anyway.

(In reply to Matthias Clasen from comment #5)
> Review of attachment 324248 [details] [review] [review]:
> 
> Does the gdkdevice-wayland.c belong into the previous patch ? Or maybe a
> separate one. In any case, it might be nice to have "Remove unused typedef"
> be a separate patch that does just that.

Right, will at least separate the typedef.
Comment 9 Carlos Garnacho 2016-03-18 13:19:01 UTC
Created attachment 324268 [details] [review]
wayland: Replace all remaining uses of GdkWaylandDeviceData

And use GdkWaylandSeat in all of those. The variable names have also
been updated.
Comment 10 Carlos Garnacho 2016-03-18 13:19:24 UTC
Created attachment 324269 [details] [review]
wayland: Remove GdkWaylandDataDevice typedef

It's no longer used.
Comment 11 Matthias Clasen 2016-03-21 01:52:44 UTC
Review of attachment 324268 [details] [review]:

.
Comment 12 Matthias Clasen 2016-03-21 01:53:08 UTC
Review of attachment 324269 [details] [review]:

.
Comment 13 Carlos Garnacho 2016-03-21 16:26:19 UTC
Attachment 324247 [details] pushed as c9f9163 - wayland: Remove GdkWaylandDeviceData pointer in GdkWaylandDevice
Attachment 324249 [details] pushed as 219eedd - wayland: Rename internal functions with misleading naming
Attachment 324268 [details] pushed as 81f0d23 - wayland: Replace all remaining uses of GdkWaylandDeviceData
Attachment 324269 [details] pushed as 1597f31 - wayland: Remove GdkWaylandDataDevice typedef