GNOME Bugzilla – Bug 747880
Tablet calibration utility freezes on exit
Last modified: 2021-06-10 11:18:07 UTC
When the tablet calibration utility tries to exit (e.g. by pressing Escape or waiting for the timeout to expire), the UI freezes with the calibration window left open. The 'test-calibrator' tool works properly, though exhibits the same behavior if its call to 'calib_area_free' occurs prior to 'gtk_main_quit'. Backtrace (pressed Escape to exit [frame #30]):
+ Trace 234972
I just noticed that the freeze does *NOT* seem to occur if you use ALT+TAB or click on another window (on another monitor) to change focus. I find this especially interesting considering that 'gtk_window_set_focus' appears in the stack trace above...
Also interesting to note: Having "CLUTTER_BACKEND=x11" set in the environment prior to running gnome-control-center appears to make this problem disappear.
Created attachment 304449 [details] [review] gdk: Use the GdkDevice id for our input devices if available On X11, some apps assume that the ClutterDevice id matches the underlying XInput device id. We can keep that working on the GDK backend by getting the device-id property from the GdkDevice if it exists. -- Does this clutter patch help?
Review of attachment 304449 [details] [review]: ::: clutter/gdk/clutter-input-device-gdk.c @@ +153,2 @@ name = gdk_device_get_name (device); + g_object_get (device, "device-id", &device_id, NULL); That's gonna throw an error when the GDK backend is Wayland. if (g_object_class_find_property (G_OBJECT_CLASS (device), "device-id")) would probably fix that.
Reassigning to clutter, as the patch is against that.
Review of attachment 304449 [details] [review]: ::: clutter/gdk/clutter-input-device-gdk.c @@ +153,2 @@ name = gdk_device_get_name (device); + g_object_get (device, "device-id", &device_id, NULL); "device-id" is a XInput2-only property, so you cannot use it unconditionally.
I already have a patch for this in bug 747951.
Actually, the whole bug looks like a dupe of 747951. *** This bug has been marked as a duplicate of bug 747951 ***
I think that the patch might be in the wrong bug... Reopening, and reassigning to gnome-control-center. Sorry about that.
(In reply to Emmanuele Bassi (:ebassi) from comment #6) > Review of attachment 304449 [details] [review] [review]: > > ::: clutter/gdk/clutter-input-device-gdk.c > @@ +153,2 @@ > name = gdk_device_get_name (device); > + g_object_get (device, "device-id", &device_id, NULL); > > "device-id" is a XInput2-only property, so you cannot use it unconditionally. We even have gdk_x11_device_get_id() these days :), although might not help much about non-conditional code here.
I pushed the patch in bug 747951 which does the right thing.
This bug persists even with bug 747951 fixed, so it's definitely not a dupe. The calibration screen does exit properly when all targets have been clicked, but it still freezes in the "abort" scenarios originally listed (i.e., timeout or escape key). It looks like Emmanuele's fix for 747951 does the same thing that attachment 304449 [details] [review] tries to accomplish, so perhaps the issue lies elsewhere?
I see what goes on here: - clutter_master_clock_gdk_update() is called, it acquires the clutter lock and goes on to processing pending events on the stage (the Esc key CLUTTER_KEY_RELEASE event at that moment) - This triggers destruction of the calibration area, the stage, and the toplevel GtkWindow - Along GtkWindow destruction, the focus is set to NULL, which triggers gtk_widget_send_focus_change() to be sent - That function makes the widget process immediately the event through gtk_widget_event(), which gets processed by gtk_clutter_embed_event(), and clutter_gtk_handle_event() ultimately. - That last function tries to acquire the lock again, which was already taken by clutter_master_clock_gdk_update() in the first step. I'm not sure what's the best approach tbh, I guess we might hold off the gtk_widget_send_focus_change() if the window is being destroyed anyway, but every focus change might potentially trigger this. Moving to clutter-gtk for further discussion.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version of clutter-gtk, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a ticket at https://gitlab.gnome.org/GNOME/clutter-gtk/-/issues/ Thank you for your understanding and your help.