GnuCash
Contact   Instructions
Bug 797967 - minor ui niggles - some dialogs don't respond to GDK_KEY_Escape
Summary: minor ui niggles - some dialogs don't respond to GDK_KEY_Escape
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: User Interface General (show other bugs)
Version: git-maint
Hardware: PC All
: Normal minor
Target Milestone: ---
Assignee: ui
QA Contact: ui
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-03 10:43 EDT by Christopher Lam
Modified: 2020-10-11 06:36 EDT (History)
4 users (show)

See Also:


Attachments

Description Christopher Lam 2020-10-03 10:43:15 EDT
I am a heavy keyboard use. These dialogs don't respond to ESC close signal (probably not comprehensive):

Tax Table
Bill Terms Editor
Price Editor
Security Editor
Manage Document Link

The last one (Manage Document Link) also dumps several lines:
<Gtk> gtk_widget_event: assertion 'WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
Comment 1 Bob 2020-10-04 05:10:34 EDT
I will have a look at this hopefully this week.
Comment 2 Bob 2020-10-04 07:16:29 EDT
Chris, had a quick look for the widget event errors above but I do not see them.
Tried adding, opening and removing link but could not reproduce.

What GTK+ version do you have and can you run from gdb and get a back trace?
Comment 3 Christopher Lam 2020-10-04 09:15:01 EDT
I don't know how to debug gtk errors gdb. I've reproduced the bug:
- open invoice editor for invoice without doclink
- Business > Manage Document Link
- this spews error as follows

If invoice has doclink, there's no error and dialog closes with <ESC>.
Comment 4 Christopher Lam 2020-10-04 10:41:55 EDT
$ dpkg -l libgtk-3-0
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name             Version          Architecture Description
+++-================-================-============-====================================
ii  libgtk-3-0:amd64 3.24.20-0ubuntu1 amd64        GTK graphical user interface library
Comment 5 Bob 2020-10-04 16:30:41 EDT
Chris, what I would do on my system would be...
Open a terminal,
type the following... gdb gnucash
this gives a gdb prompt
then I would type... run --g-fatal-warnings
it may stop before what you are interested in, just press c to continue
now do your procedure and if it stops, type bt
now add that as an attachment.


I assume you are running Ubuntu, I have a VM with that but will need to compile an up to date Gnucash.
Comment 6 Christopher Lam 2020-10-04 22:41:11 EDT
Thanks! You've probably figured out the error; here's backtrace

#0  0x00007ffff7b5e0d5 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007ffff7b5f3b9 in g_logv () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff7b5f583 in g_log () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff724c69a in gtk_widget_event () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#4  0x00007ffff726b5db in gtk_window_propagate_key_event () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#5  0x00007ffff726b626 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#6  0x00007ffff729f5ef in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#7  0x00007ffff6c89a56 in  () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#8  0x00007ffff6ca7dd1 in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#9  0x00007ffff6ca90d3 in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#10 0x00007ffff7249c23 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#11 0x00007ffff71051df in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#12 0x00007ffff71073db in gtk_main_do_event () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#13 0x00007ffff5deaf79 in  () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#14 0x00007ffff5e1e106 in  () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#15 0x00007ffff7b57fbd in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x00007ffff7b58240 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x00007ffff7b58533 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007ffff706b497 in gtk_dialog_run () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#19 0x00007ffff788d9f9 in gnc_doclink_get_uri_dialog (parent=0x555555a48300, title=0x7ffff795bf65 "Manage Document Link", uri=0x0)
    at /home/chris/sources/gnucash/maint/gnucash/gnome/dialog-doclink.c:318
#20 0x00007ffff78faea9 in gnc_plugin_page_invoice_cmd_link (action=0x55555694bdb0, plugin_page=0x55555691ad40)
    at /home/chris/sources/gnucash/maint/gnucash/gnome/gnc-plugin-page-invoice.c:1361
#21 0x00007ffff6c89802 in g_closure_invoke () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#22 0x00007ffff6c9d814 in  () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#23 0x00007ffff6ca8b9e in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#24 0x00007ffff6ca90d3 in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#25 0x00007ffff6f708e5 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#26 0x00007ffff6c89a56 in  () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#27 0x00007ffff6ca8b28 in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#28 0x00007ffff6ca90d3 in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#29 0x00007ffff724cab2 in gtk_widget_activate () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#30 0x00007ffff711aa36 in gtk_menu_shell_activate_item () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#31 0x00007ffff6c89a56 in  () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#32 0x00007ffff6ca8b28 in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
Comment 7 Bob 2020-10-05 08:31:20 EDT
I did not realise you were pressing the escape key, doing so I can see the error on my normal dev VM. This was caused by the GtkFileChooserButton receiving the escape key event and as it was not realized it would error. To fix this I added a callback to the dialog to intercept the escape key and close the dialog.
Comment 8 Bob 2020-10-11 06:36:19 EDT
These dialogs are based on a GtkWindow and as such do not natively respond to the escape key being pressed so to fix this a call back has been added for 'key_press_event' which checks for the escape key.

Pushed to maint so will be in the next nightly or version 4.3

Note You need to log in before you can comment on or make changes to this bug.