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 747880 - Tablet calibration utility freezes on exit
Tablet calibration utility freezes on exit
Status: RESOLVED OBSOLETE
Product: clutter-gtk
Classification: Platform
Component: GtkClutterEmbed
unspecified
Other Linux
: Normal normal
: ---
Assigned To: clutter-gtk maintainer(s)
clutter-gtk maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-04-15 00:37 UTC by Jason Gerecke
Modified: 2021-06-10 11:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdk: Use the GdkDevice id for our input devices if available (1.68 KB, patch)
2015-06-02 16:48 UTC, Rui Matos
needs-work Details | Review

Description Jason Gerecke 2015-04-15 00:37:45 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]):

  • #0 syscall
    from /usr/lib/libc.so.6
  • #1 g_mutex_lock_slowpath
    at gthread-posix.c line 1313
  • #2 g_mutex_lock
    at gthread-posix.c line 1337
  • #3 clutter_threads_impl_lock
    at clutter-main.c line 173
  • #4 _clutter_threads_acquire_lock
    at clutter-main.c line 1129
  • #5 clutter_gdk_handle_event
    at gdk/clutter-event-gdk.c line 106
  • #6 gtk_clutter_embed_event
    at ./gtk-clutter-embed.c line 958
  • #7 _gtk_marshal_BOOLEAN__BOXEDv
    at gtkmarshalers.c line 130
  • #8 g_type_class_meta_marshalv
    at gclosure.c line 1021
  • #9 _g_closure_invoke_va
    at gclosure.c line 864
  • #10 g_signal_emit_valist
    at gsignal.c line 3214
  • #11 g_signal_emit
    at gsignal.c line 3361
  • #12 gtk_widget_event_internal
    at gtkwidget.c line 7683
  • #13 gtk_widget_event
    at gtkwidget.c line 7380
  • #14 gtk_widget_send_focus_change
    at gtkwidget.c line 16160
  • #15 do_focus_change
    at gtkwindow.c line 7935
  • #16 gtk_window_real_set_focus
    at gtkwindow.c line 8221
  • #17 g_cclosure_marshal_VOID__OBJECTv
    at gmarshal.c line 2102
  • #18 g_type_class_meta_marshalv
    at gclosure.c line 1021
  • #19 _g_closure_invoke_va
    at gclosure.c line 864
  • #20 g_signal_emit_valist
    at gsignal.c line 3214
  • #21 g_signal_emit
    at gsignal.c line 3361
  • #22 _gtk_window_internal_set_focus
    at gtkwindow.c line 2499
  • #23 gtk_window_set_focus
    at gtkwindow.c line 2482
  • #24 gtk_window_dispose
    at gtkwindow.c line 3017
  • #25 g_object_run_dispose
    at gobject.c line 1076
  • #26 gtk_widget_destroy
    at gtkwidget.c line 4794
  • #27 calib_area_free
    at calibrator-gui.c line 812
  • #28 finish_calibration
    at cc-wacom-page.c line 203
  • #29 on_delete_event
    at calibrator-gui.c line 167
  • #30 on_key_release_event
    at calibrator-gui.c line 386
  • #31 _clutter_marshal_BOOLEAN__BOXED
    at clutter-marshal.c line 85
  • #32 g_closure_invoke
    at gclosure.c line 801
  • #33 signal_emit_unlocked_R
    at gsignal.c line 3549
  • #34 g_signal_emit_valist
    at gsignal.c line 3315
  • #35 g_signal_emit
    at gsignal.c line 3361
  • #36 clutter_actor_event
    at clutter-actor.c line 13783
  • #37 _clutter_actor_handle_event
    at clutter-actor.c line 20422
  • #38 emit_event_chain
    at clutter-main.c line 2006
  • #39 emit_keyboard_event
    at clutter-main.c line 2086
  • #40 _clutter_process_event_details
    at clutter-main.c line 2186
  • #41 _clutter_process_event
    at clutter-main.c line 2537
  • #42 _clutter_stage_process_queued_events
    at clutter-stage.c line 1031
  • #43 master_clock_process_stage_events
    at gdk/clutter-master-clock-gdk.c line 146
  • #44 clutter_master_clock_gdk_update
    at gdk/clutter-master-clock-gdk.c line 268
  • #45 g_cclosure_marshal_VOID__VOIDv
    at gmarshal.c line 905
  • #46 _g_closure_invoke_va
    at gclosure.c line 864
  • #47 g_signal_emit_valist
    at gsignal.c line 3214
  • #48 g_signal_emit_by_name
    at gsignal.c line 3401
  • #49 gdk_frame_clock_paint_idle
    at gdkframeclockidle.c line 380
  • #50 gdk_threads_dispatch
    at gdk.c line 717
  • #51 g_timeout_dispatch
    at gmain.c line 4545
  • #52 g_main_dispatch
    at gmain.c line 3122
  • #53 g_main_context_dispatch
    at gmain.c line 3737
  • #54 g_main_context_iterate
    at gmain.c line 3808
  • #55 g_main_context_iteration
    at gmain.c line 3869
  • #56 g_application_run
    at gapplication.c line 2308
  • #57 main
    at main.c line 49

Comment 1 Jason Gerecke 2015-04-15 01:02:21 UTC
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...
Comment 2 Jason Gerecke 2015-04-15 21:19:54 UTC
Also interesting to note: Having "CLUTTER_BACKEND=x11" set in the environment prior to running gnome-control-center appears to make this problem disappear.
Comment 3 Rui Matos 2015-06-02 16:48:27 UTC
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?
Comment 4 Bastien Nocera 2015-06-03 11:50:16 UTC
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.
Comment 5 Bastien Nocera 2015-06-03 11:50:56 UTC
Reassigning to clutter, as the patch is against that.
Comment 6 Emmanuele Bassi (:ebassi) 2015-06-03 11:59:56 UTC
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.
Comment 7 Emmanuele Bassi (:ebassi) 2015-06-03 12:01:33 UTC
I already have a patch for this in bug 747951.
Comment 8 Emmanuele Bassi (:ebassi) 2015-06-03 12:03:51 UTC
Actually, the whole bug looks like a dupe of 747951.

*** This bug has been marked as a duplicate of bug 747951 ***
Comment 9 Bastien Nocera 2015-06-03 12:17:42 UTC
I think that the patch might be in the wrong bug... Reopening, and reassigning to gnome-control-center. Sorry about that.
Comment 10 Carlos Garnacho 2015-06-03 14:00:16 UTC
(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.
Comment 11 Emmanuele Bassi (:ebassi) 2015-06-03 14:01:06 UTC
I pushed the patch in bug 747951 which does the right thing.
Comment 12 Jason Gerecke 2015-06-16 19:05:15 UTC
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?
Comment 13 Carlos Garnacho 2015-10-19 18:30:12 UTC
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.
Comment 14 André Klapper 2021-06-10 11:18:07 UTC
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.