pcb

Comment 7 for bug 699309

Revision history for this message
Richard Barlow (richardpbarlow) wrote :

The problem seems to be caused by the 'get_coord' HID command being called multiple times. The GTK HID handles this command in the following way:

If the cursor is within the drawing area then return the current position of the cursor.

If it's not within the drawing area then call the 'run_get_location_loop' function in src/hid/gtk/gui-misc.c, which is the function that disables the majority of the UI (and also sets the cursor to GTK_HAND2).

The 'run_get_location_loop' function runs its own GMainLoop (i'm not an expert but that doesn't seem like a clever thing to be doing) and attaches its own custom handlers for the button_press_even and key_press_even signals. This function seems to work fine in the majority of situations. I.E I can't get "Info->Generate object report" to lock up the UI permanently no matter what I try. In the case of the Zoom command (that is invoked by scrolling), the function is called twice and presumably some sort of deadlock results.

I don't know the best solution to this problem; perhaps the code that handles the scroll wheel should also be disabled in the run_get_location_loop function? Even then I don't see this as being a robust solution as the way this bit of code works seems like it could have lots of corner cases that were never considered when it was written.