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 762891 - gdk: remove the display->list_devices vfunc
gdk: remove the display->list_devices vfunc
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-02-29 20:11 UTC by Paolo Borelli
Modified: 2016-02-29 20:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdk: remove the display->list_devices vfunc (20.61 KB, patch)
2016-02-29 20:11 UTC, Paolo Borelli
accepted-commit_now Details | Review

Description Paolo Borelli 2016-02-29 20:11:03 UTC
This function is implemented only for backward compat and
the code is the same on all backends (well, wayland was even simpler
but I guess that is just a bug/limitation).

I can only test on x11 and win32, but the patch is pretty mechanic.
Comment 1 Paolo Borelli 2016-02-29 20:11:13 UTC
Created attachment 322702 [details] [review]
gdk: remove the display->list_devices vfunc

gdk_display_list_devices is deprecated and all the backends
implement the same fallback by delegating to the device manager
and caching the list (caching it is needed since the method does
not transfer ownership of the container).
The compat code can be shared among all backends and we can
initialize the list lazily only in the case someone calls the
deprecated method.
Comment 2 Matthias Clasen 2016-02-29 20:29:08 UTC
Review of attachment 322702 [details] [review]:

::: gdk/gdkdisplay.c
@@ +1862,3 @@
+       * floating devices that are not keyboards.
+       */
+      list = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_FLOATING);

Can't you use GdkSeat here ?
Comment 3 Paolo Borelli 2016-02-29 20:31:10 UTC
I can look (In reply to Matthias Clasen from comment #2)
> Can't you use GdkSeat here ?

Probably yes, I am not familiar with the new seat stuff... I'd rather commit this with the same code that was there before and then convert to GdkSeat in a follow up patch
Comment 4 Matthias Clasen 2016-02-29 20:37:56 UTC
(In reply to Paolo Borelli from comment #3)
> I can look (In reply to Matthias Clasen from comment #2)
> > Can't you use GdkSeat here ?
> 
> Probably yes, I am not familiar with the new seat stuff... I'd rather commit
> this with the same code that was there before and then convert to GdkSeat in
> a follow up patch

Fine with me
Comment 5 Matthias Clasen 2016-02-29 20:38:11 UTC
Review of attachment 322702 [details] [review]:

.
Comment 6 Ignacio Casal Quinteiro (nacho) 2016-02-29 20:50:01 UTC
Review of attachment 322702 [details] [review]:

::: gdk/win32/gdkdisplay-win32.c
@@ +238,3 @@
+
+  display->device_manager = g_object_new (GDK_TYPE_DEVICE_MANAGER_WIN32,
+                                         "display", display,

wrong indent?
Comment 7 Paolo Borelli 2016-02-29 20:58:51 UTC
pushed (including nacho's nitpick) along with a follow up patch to port to GtkSeat