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
| @@ -43,6 +43,8 @@ | @@ -43,6 +43,8 @@ | ||
| 43 | #include <syslog.h> | 43 | #include <syslog.h> |
| 44 | #endif // HAVE_SYSLOG | 44 | #endif // HAVE_SYSLOG |
| 45 | 45 | ||
| 46 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" | ||
| 47 | + | ||
| 46 | /*--[ Widget definition ]----------------------------------------------------------------------------*/ | 48 | /*--[ Widget definition ]----------------------------------------------------------------------------*/ |
| 47 | 49 | ||
| 48 | G_BEGIN_DECLS | 50 | G_BEGIN_DECLS |
src/v3270/mouse.c
| @@ -228,11 +228,6 @@ static void update_mouse_pointer(GtkWidget *widget, int baddr) | @@ -228,11 +228,6 @@ static void update_mouse_pointer(GtkWidget *widget, int baddr) | ||
| 228 | void v3270_update_mouse_pointer(GtkWidget *widget) | 228 | void v3270_update_mouse_pointer(GtkWidget *widget) |
| 229 | { | 229 | { |
| 230 | gint x, y; | 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 | gtk_widget_get_pointer(widget,&x,&y); | 231 | gtk_widget_get_pointer(widget,&x,&y); |
| 237 | update_mouse_pointer(widget,v3270_get_offset_at_point(GTK_V3270(widget),x,y)); | 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,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 | cairo_t *cr; | 1096 | cairo_t *cr; |
| 1097 | GdkRectangle *r; | 1097 | GdkRectangle *r; |
| 1098 | 1098 | ||
| 1099 | - v3270 *terminal = GTK_V3270(lib3270_get_user_data(session)); | ||
| 1100 | - | ||
| 1101 | if(!(terminal->surface && terminal->drawing)) | 1099 | if(!(terminal->surface && terminal->drawing)) |
| 1102 | return; | 1100 | return; |
| 1103 | 1101 | ||
| 1102 | + #pragma GCC diagnostic push | ||
| 1103 | + #pragma GCC diagnostic ignored "-Wswitch" | ||
| 1104 | switch(id) | 1104 | switch(id) |
| 1105 | { | 1105 | { |
| 1106 | case LIB3270_FLAG_BOXSOLID: | 1106 | case LIB3270_FLAG_BOXSOLID: |
| @@ -1141,14 +1141,11 @@ void v3270_update_oia(H3270 *session, LIB3270_FLAG id, unsigned char on) | @@ -1141,14 +1141,11 @@ void v3270_update_oia(H3270 *session, LIB3270_FLAG id, unsigned char on) | ||
| 1141 | break; | 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 | int v3270_set_script(GtkWidget *widget, const gchar id) | 1149 | int v3270_set_script(GtkWidget *widget, const gchar id) |
| 1153 | { | 1150 | { |
| 1154 | g_return_val_if_fail(GTK_IS_V3270(widget),EINVAL); | 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,7 +330,7 @@ G_GNUC_INTERNAL void v3270_update_cursor_rect(v3270 *widget, GdkRectangle *re | ||
| 330 | 330 | ||
| 331 | G_GNUC_INTERNAL void v3270_update_message(v3270 *widget, LIB3270_MESSAGE id); | 331 | G_GNUC_INTERNAL void v3270_update_message(v3270 *widget, LIB3270_MESSAGE id); |
| 332 | G_GNUC_INTERNAL void v3270_update_cursor(H3270 *session, unsigned short row, unsigned short col, unsigned char c, unsigned short attr); | 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 | G_GNUC_INTERNAL void v3270_blink_ssl(v3270 *terminal); | 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,6 +957,28 @@ static void popup_handler(H3270 *session, LIB3270_NOTIFY type, const char *title | ||
| 957 | 957 | ||
| 958 | const gchar * v3270_default_font = "monospace"; | 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 | static void v3270_init(v3270 *widget) | 982 | static void v3270_init(v3270 *widget) |
| 961 | { | 983 | { |
| 962 | struct lib3270_session_callbacks *cbk; | 984 | struct lib3270_session_callbacks *cbk; |
| @@ -986,7 +1008,7 @@ static void popup_handler(H3270 *session, LIB3270_NOTIFY type, const char *title | @@ -986,7 +1008,7 @@ static void popup_handler(H3270 *session, LIB3270_NOTIFY type, const char *title | ||
| 986 | cbk->update_status = update_message; | 1008 | cbk->update_status = update_message; |
| 987 | cbk->update_cursor = v3270_update_cursor; | 1009 | cbk->update_cursor = v3270_update_cursor; |
| 988 | cbk->update_toggle = update_toggle; | 1010 | cbk->update_toggle = update_toggle; |
| 989 | - cbk->update_oia = v3270_update_oia; | 1011 | + cbk->update_oia = update_oia; |
| 990 | cbk->cursor = select_cursor; | 1012 | cbk->cursor = select_cursor; |
| 991 | cbk->update_connect = update_connect; | 1013 | cbk->update_connect = update_connect; |
| 992 | cbk->update_model = update_model; | 1014 | cbk->update_model = update_model; |