GNOME Bugzilla – Bug 637895
gdk_pointer_grab() deprecated comment is not helpful enough.
Last modified: 2018-04-14 23:58:07 UTC
gdk_pointer_grab() is now deprecated: http://library.gnome.org/devel/gdk/unstable/gdk3-General.html#gdk-pointer-grab But the comment just says that we should use gdk_device_grab() instead, without suggesting how we would get the GdkDevice* needed to call that. I looked at the demo for a hint, but it hasn't been ported yet: http://git.gnome.org/browse/gtk+/tree/demos/gtk-demo/changedisplay.c#n131 (Demos and tests really should be built with deprecations disabled, I think).
CCing Javier Jardon, who added the deprecation comment, according to git blame.
(In reply to comment #0) > gdk_pointer_grab() is now deprecated: > > http://library.gnome.org/devel/gdk/unstable/gdk3-General.html#gdk-pointer-grab > But the comment just says that we should use gdk_device_grab() instead, without > suggesting how we would get the GdkDevice* needed to call that. Fixed in commit 30cdab13fe62884457b7c1c35142386e453adfd0 > I looked at the demo for a hint, but it hasn't been ported yet: > http://git.gnome.org/browse/gtk+/tree/demos/gtk-demo/changedisplay.c#n131 Indeed, seems that gdk_pointer_* and gdk_keyboard_* were not properly deprecated and are still used in GTK+ code. Filled bug #637951
(In reply to comment #2) > (In reply to comment #0) > > gdk_pointer_grab() is now deprecated: > > > > http://library.gnome.org/devel/gdk/unstable/gdk3-General.html#gdk-pointer-grab > > But the comment just says that we should use gdk_device_grab() instead, without > > suggesting how we would get the GdkDevice* needed to call that. > > Fixed in commit 30cdab13fe62884457b7c1c35142386e453adfd0 Thanks. That was http://git.gnome.org/browse/gtk+/commit/?id=30cdab13fe62884457b7c1c35142386e453adfd0
Can we also have a more helpful deprecation hint about the related gdk_keyboard_grab() function? http://developer.gnome.org/gdk3/unstable/gdk3-General.html#gdk-keyboard-grab and maybe some more discussion about keyboard grabs in gdk_device_grab()? It looks like this should involve gdk_device_get_associated_device(). (I probably shouldn't just reopen this bug, but it seems convenient.)
gdk_device_grab() has parameters that gdk_pointer_grab() doesn't, such as grab_ownership. Shouldn't the deprecation comment suggest what values to use to get the same behaviour as before? Can we also have a more helpful deprecation hint about the related gdk_keyboard_grab() function? http://developer.gnome.org/gdk3/unstable/gdk3-General.html#gdk-keyboard-grab and maybe some more discussion about keyboard grabs in the gdk_device_grab() documentation? It looks like this should involve gdk_device_get_associated_device().
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla. If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab: https://gitlab.gnome.org/GNOME/gtk/issues/new