Commit 8c622e345a0bfa074e220513463d4b51160c12f9
1 parent
a4e04562
Exists in
master
and in
1 other branch
Fixing segfault on page-down accelerator.
Showing
4 changed files
with
13 additions
and
6 deletions
Show diff stats
src/terminal/keyboard/accelerator.c
... | ... | @@ -55,6 +55,7 @@ |
55 | 55 | { |
56 | 56 | V3270PFKeyAccelerator * customAccel = g_new0(V3270PFKeyAccelerator,1); |
57 | 57 | *customAccel = *((V3270PFKeyAccelerator *) accel); |
58 | + customAccel->parent.arg = (gconstpointer) customAccel; | |
58 | 59 | rc = (V3270Accelerator *) customAccel; |
59 | 60 | } |
60 | 61 | break; |
... | ... | @@ -105,6 +106,8 @@ |
105 | 106 | { |
106 | 107 | int rc = ((int (*)(GtkWidget *, gconstpointer)) acel->activate)(terminal, acel->arg); |
107 | 108 | |
109 | + debug("%s(%s)=%d (%s)",__FUNCTION__,v3270_accelerator_get_name(acel),rc,strerror(rc)); | |
110 | + | |
108 | 111 | if(rc) |
109 | 112 | gdk_display_beep(gtk_widget_get_display(terminal)); |
110 | 113 | ... | ... |
src/terminal/keyboard/init.c
... | ... | @@ -89,6 +89,14 @@ |
89 | 89 | |
90 | 90 | } |
91 | 91 | |
92 | + static int fire_pfkey_action(GtkWidget *widget, V3270PFKeyAccelerator *accel) | |
93 | + { | |
94 | + debug("%s accel=%p",__FUNCTION__,accel); | |
95 | + debug("%s Accelerator(%s)=%p pfkey=%d",__FUNCTION__,accel->name,accel,accel->keycode); | |
96 | + | |
97 | + return lib3270_pfkey(v3270_get_session(widget),(int) accel->keycode); | |
98 | + } | |
99 | + | |
92 | 100 | void v3270_init_accelerators(v3270 *widget) |
93 | 101 | { |
94 | 102 | size_t ix; |
... | ... | @@ -218,6 +226,8 @@ |
218 | 226 | accelerator->parent.arg = (gconstpointer) accelerator; |
219 | 227 | accelerator->parent.activate = G_CALLBACK(fire_pfkey_action); |
220 | 228 | |
229 | + debug("%s Accelerator(%s)=%p pfkey=%d",__FUNCTION__,accelerator->name,accelerator,accelerator->keycode); | |
230 | + | |
221 | 231 | widget->accelerators = g_slist_prepend(widget->accelerators,accelerator); |
222 | 232 | |
223 | 233 | } | ... | ... |
src/terminal/keyboard/keyfile.c
... | ... | @@ -89,11 +89,6 @@ |
89 | 89 | |
90 | 90 | } |
91 | 91 | |
92 | - int fire_pfkey_action(GtkWidget *widget, V3270PFKeyAccelerator *accel) | |
93 | - { | |
94 | - return lib3270_pfkey(v3270_get_session(widget),(int) accel->keycode); | |
95 | - } | |
96 | - | |
97 | 92 | void v3270_accelerator_map_set_entry(v3270 *terminal, const gchar *name, const gchar *keys) |
98 | 93 | { |
99 | 94 | V3270Accelerator * accel = NULL; | ... | ... |