Commit af7a64048a350941804d0a4027b6eaa9e85fa810
1 parent
526ed500
Exists in
master
and in
1 other branch
Moving OIA updates to IDLE queue.
Showing
5 changed files
with
30 additions
and
14 deletions
Show diff stats
src/trace/trace.c
src/v3270/mouse.c
| ... | ... | @@ -228,11 +228,6 @@ static void update_mouse_pointer(GtkWidget *widget, int baddr) |
| 228 | 228 | void v3270_update_mouse_pointer(GtkWidget *widget) |
| 229 | 229 | { |
| 230 | 230 | gint x, y; |
| 231 | - | |
| 232 | -#if GTK_CHECK_VERSION(3,4,0) | |
| 233 | - #warning Implement gdk_window_get_device_position | |
| 234 | -#endif // GTK(3,4,0) | |
| 235 | - | |
| 236 | 231 | gtk_widget_get_pointer(widget,&x,&y); |
| 237 | 232 | update_mouse_pointer(widget,v3270_get_offset_at_point(GTK_V3270(widget),x,y)); |
| 238 | 233 | } | ... | ... |
src/v3270/oia.c
| ... | ... | @@ -1091,16 +1091,16 @@ void v3270_blink_ssl(v3270 *terminal) |
| 1091 | 1091 | |
| 1092 | 1092 | } |
| 1093 | 1093 | |
| 1094 | -void v3270_update_oia(H3270 *session, LIB3270_FLAG id, unsigned char on) | |
| 1094 | +void v3270_update_oia(v3270 *terminal, LIB3270_FLAG id, unsigned char on) | |
| 1095 | 1095 | { |
| 1096 | 1096 | cairo_t *cr; |
| 1097 | 1097 | GdkRectangle *r; |
| 1098 | 1098 | |
| 1099 | - v3270 *terminal = GTK_V3270(lib3270_get_user_data(session)); | |
| 1100 | - | |
| 1101 | 1099 | if(!(terminal->surface && terminal->drawing)) |
| 1102 | 1100 | return; |
| 1103 | 1101 | |
| 1102 | + #pragma GCC diagnostic push | |
| 1103 | + #pragma GCC diagnostic ignored "-Wswitch" | |
| 1104 | 1104 | switch(id) |
| 1105 | 1105 | { |
| 1106 | 1106 | case LIB3270_FLAG_BOXSOLID: |
| ... | ... | @@ -1141,14 +1141,11 @@ void v3270_update_oia(H3270 *session, LIB3270_FLAG id, unsigned char on) |
| 1141 | 1141 | break; |
| 1142 | 1142 | */ |
| 1143 | 1143 | |
| 1144 | - default: | |
| 1145 | - return; | |
| 1146 | 1144 | } |
| 1145 | + #pragma GCC diagnostic pop | |
| 1147 | 1146 | |
| 1148 | - debug("%s",__FUNCTION__); | |
| 1149 | 1147 | } |
| 1150 | 1148 | |
| 1151 | - | |
| 1152 | 1149 | int v3270_set_script(GtkWidget *widget, const gchar id) |
| 1153 | 1150 | { |
| 1154 | 1151 | g_return_val_if_fail(GTK_IS_V3270(widget),EINVAL); | ... | ... |
src/v3270/private.h
| ... | ... | @@ -330,7 +330,7 @@ G_GNUC_INTERNAL void v3270_update_cursor_rect(v3270 *widget, GdkRectangle *re |
| 330 | 330 | |
| 331 | 331 | G_GNUC_INTERNAL void v3270_update_message(v3270 *widget, LIB3270_MESSAGE id); |
| 332 | 332 | G_GNUC_INTERNAL void v3270_update_cursor(H3270 *session, unsigned short row, unsigned short col, unsigned char c, unsigned short attr); |
| 333 | -G_GNUC_INTERNAL void v3270_update_oia(H3270 *session, LIB3270_FLAG id, unsigned char on); | |
| 333 | +G_GNUC_INTERNAL void v3270_update_oia(v3270 *terminal, LIB3270_FLAG id, unsigned char on); | |
| 334 | 334 | |
| 335 | 335 | G_GNUC_INTERNAL void v3270_blink_ssl(v3270 *terminal); |
| 336 | 336 | ... | ... |
src/v3270/widget.c
| ... | ... | @@ -957,6 +957,28 @@ static void popup_handler(H3270 *session, LIB3270_NOTIFY type, const char *title |
| 957 | 957 | |
| 958 | 958 | const gchar * v3270_default_font = "monospace"; |
| 959 | 959 | |
| 960 | + struct update_oia_data | |
| 961 | + { | |
| 962 | + H3270 *session; | |
| 963 | + LIB3270_FLAG id; | |
| 964 | + unsigned char on; | |
| 965 | + }; | |
| 966 | + | |
| 967 | + static gboolean bg_update_oia(struct update_oia_data *data) | |
| 968 | + { | |
| 969 | + v3270_update_oia(GTK_V3270(lib3270_get_user_data(data->session)), data->id, data->on); | |
| 970 | + return FALSE; | |
| 971 | + } | |
| 972 | + | |
| 973 | + static void update_oia(H3270 *session, LIB3270_FLAG id, unsigned char on) | |
| 974 | + { | |
| 975 | + struct update_oia_data *data = g_new0(struct update_oia_data,1); | |
| 976 | + data->session = session; | |
| 977 | + data->id = id; | |
| 978 | + data->on = on; | |
| 979 | + g_idle_add_full(G_PRIORITY_DEFAULT_IDLE,(GSourceFunc) bg_update_oia, data, g_free); | |
| 980 | + } | |
| 981 | + | |
| 960 | 982 | static void v3270_init(v3270 *widget) |
| 961 | 983 | { |
| 962 | 984 | struct lib3270_session_callbacks *cbk; |
| ... | ... | @@ -986,7 +1008,7 @@ static void popup_handler(H3270 *session, LIB3270_NOTIFY type, const char *title |
| 986 | 1008 | cbk->update_status = update_message; |
| 987 | 1009 | cbk->update_cursor = v3270_update_cursor; |
| 988 | 1010 | cbk->update_toggle = update_toggle; |
| 989 | - cbk->update_oia = v3270_update_oia; | |
| 1011 | + cbk->update_oia = update_oia; | |
| 990 | 1012 | cbk->cursor = select_cursor; |
| 991 | 1013 | cbk->update_connect = update_connect; |
| 992 | 1014 | cbk->update_model = update_model; | ... | ... |