diff --git a/src/gtk/v3270/accessible.c b/src/gtk/v3270/accessible.c index 05640f1..1739ee1 100644 --- a/src/gtk/v3270/accessible.c +++ b/src/gtk/v3270/accessible.c @@ -450,7 +450,7 @@ static gint v3270_accessible_get_n_selections (AtkText *text) if(!widget) return 0; - trace("%s: n_selections=%d",__FUNCTION__,v3270_get_selection_bounds(widget, NULL, NULL) ? 1 : 0); +// trace("%s: n_selections=%d",__FUNCTION__,v3270_get_selection_bounds(widget, NULL, NULL) ? 1 : 0); return v3270_get_selection_bounds(widget, NULL, NULL) ? 1 : 0; } @@ -459,17 +459,17 @@ static gchar * v3270_accessible_get_selection(AtkText *atk_text, gint selection_ { GtkWidget *widget = gtk_accessible_get_widget(GTK_ACCESSIBLE (atk_text)); - trace("%s: selection_num=%d",__FUNCTION__,selection_num); +// trace("%s: selection_num=%d",__FUNCTION__,selection_num); if (widget == NULL ||selection_num != 0) return NULL; if(v3270_get_selection_bounds(widget, start_pos, end_pos)) { - trace("%s: TRUE",__FUNCTION__); +// trace("%s: TRUE",__FUNCTION__); return v3270_get_region(widget, *start_pos, *end_pos, FALSE); } - trace("%s: FALSE",__FUNCTION__); +// trace("%s: FALSE",__FUNCTION__); return NULL; } @@ -506,6 +506,28 @@ static gboolean v3270_accessible_set_selection(AtkText *text, gint selection_num return FALSE; } +/* +static AtkAttributeSet * v3270_accessible_get_run_attributes(AtkText *text, gint offset, gint * start_offset, gint * end_offset) +{ + GtkWidget * widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text)); + AtkAttributeSet * attributes = NULL; + + if(!widget) + return NULL; + + trace("%s is incomplete ***********************",__FUNCTION__); + + // http://developer.gnome.org/atk/stable/AtkText.html#AtkTextAttribute + + attributes = add_attribute (attributes, ATK_TEXT_ATTR_DIRECTION, + atk_text_attribute_get_value (ATK_TEXT_ATTR_DIRECTION, + gtk_widget_get_direction(widget))); + + + return attributes; +} +*/ + static void atk_text_interface_init(AtkTextIface *iface) { iface->get_text = v3270_accessible_get_text; diff --git a/src/gtk/v3270/mouse.c b/src/gtk/v3270/mouse.c index 66bf4a3..918560a 100644 --- a/src/gtk/v3270/mouse.c +++ b/src/gtk/v3270/mouse.c @@ -42,13 +42,16 @@ gint v3270_get_offset_at_point(v3270 *widget, gint x, gint y) GdkPoint point; int r,c; - point.x = ((x-widget->metrics.left)/widget->metrics.width); - point.y = ((y-widget->metrics.top)/widget->metrics.spacing); + if(x > 0 && y > 0) + { + point.x = ((x-widget->metrics.left)/widget->metrics.width); + point.y = ((y-widget->metrics.top)/widget->metrics.spacing); - lib3270_get_screen_size(widget->host,&r,&c); + lib3270_get_screen_size(widget->host,&r,&c); - if(point.x >= 0 && point.y >= 0 && point.x < c && point.y < r) - return (point.y * c) + point.x; + if(point.x >= 0 && point.y >= 0 && point.x < c && point.y < r) + return (point.y * c) + point.x; + } return -1; } @@ -164,76 +167,93 @@ gboolean v3270_button_release_event(GtkWidget *widget, GdkEventButton*event) } -gboolean v3270_motion_notify_event(GtkWidget *widget, GdkEventMotion *event) +static void update_mouse_pointer(GtkWidget *widget, int baddr) { - v3270 * terminal = GTK_V3270(widget); - int baddr = v3270_get_offset_at_point(terminal,event->x,event->y); - - if(baddr < 0) - return FALSE; + v3270 *terminal = GTK_V3270(widget); - if(terminal->selecting) - { - // Select area - lib3270_select_to(terminal->host,baddr); - } - else if(terminal->moving) + if(baddr >= 0 && terminal->pointer_id == LIB3270_CURSOR_EDITABLE) { - // Move selected area - terminal->selection_addr = lib3270_drag_selection(terminal->host,terminal->pointer,terminal->selection_addr,baddr); - } - else if(terminal->pointer_id == LIB3270_CURSOR_NORMAL) - { - unsigned char new_pointer = lib3270_get_selection_flags(terminal->host,baddr); - if(new_pointer != terminal->pointer) + int id = terminal->pointer; + + switch(lib3270_get_selection_flags(terminal->host,baddr) & 0x1f) { - GdkWindow *window = gtk_widget_get_window(widget); - trace("Pointer changes to %04x",new_pointer); + case 0x10: + id = V3270_CURSOR_MOVE_SELECTION; + break; + + case 0x12: + id = V3270_CURSOR_SELECTION_TOP; + break; + + case 0x16: + id = V3270_CURSOR_SELECTION_TOP_RIGHT; + break; + + case 0x14: + id = V3270_CURSOR_SELECTION_RIGHT; + break; - switch(new_pointer & 0x1F) - { - case 0x10: - gdk_window_set_cursor(window,v3270_cursor[V3270_CURSOR_MOVE_SELECTION]); - break; + case 0x11: + id = V3270_CURSOR_SELECTION_LEFT; + break; - case 0x12: - gdk_window_set_cursor(window,v3270_cursor[V3270_CURSOR_SELECTION_TOP]); - break; + case 0x19: + id = V3270_CURSOR_SELECTION_BOTTOM_LEFT; + break; - case 0x16: - gdk_window_set_cursor(window,v3270_cursor[V3270_CURSOR_SELECTION_TOP_RIGHT]); - break; + case 0x18: + id = V3270_CURSOR_SELECTION_BOTTOM; + break; - case 0x14: - gdk_window_set_cursor(window,v3270_cursor[V3270_CURSOR_SELECTION_RIGHT]); - break; + case 0x1c: + id = V3270_CURSOR_SELECTION_BOTTOM_RIGHT; + break; - case 0x11: - gdk_window_set_cursor(window,v3270_cursor[V3270_CURSOR_SELECTION_LEFT]); - break; + case 0x13: + id = V3270_CURSOR_SELECTION_TOP_LEFT; + break; - case 0x19: - gdk_window_set_cursor(window,v3270_cursor[V3270_CURSOR_SELECTION_BOTTOM_LEFT]); - break; + default: + id = lib3270_is_protected(terminal->host,baddr) ? V3270_CURSOR_PROTECTED : V3270_CURSOR_UNPROTECTED; - case 0x18: - gdk_window_set_cursor(window,v3270_cursor[V3270_CURSOR_SELECTION_BOTTOM]); - break; + } + + gdk_window_set_cursor(gtk_widget_get_window(widget),v3270_cursor[id]); + } - case 0x1c: - gdk_window_set_cursor(window,v3270_cursor[V3270_CURSOR_SELECTION_BOTTOM_RIGHT]); - break; +} - case 0x13: - gdk_window_set_cursor(window,v3270_cursor[V3270_CURSOR_SELECTION_TOP_LEFT]); - break; +void v3270_update_mouse_pointer(GtkWidget *widget) +{ + gint x, y; - default: - gdk_window_set_cursor(window,v3270_cursor[V3270_CURSOR_NORMAL]); +#if GTK_CHECK_VERSION(3,4,0) + #warning Implement gdk_window_get_device_position +#endif // GTK(3,4,0) - } + gtk_widget_get_pointer(widget,&x,&y); + update_mouse_pointer(widget,v3270_get_offset_at_point(GTK_V3270(widget),x,y)); +} - terminal->pointer = new_pointer; +gboolean v3270_motion_notify_event(GtkWidget *widget, GdkEventMotion *event) +{ + v3270 * terminal = GTK_V3270(widget); + int baddr = v3270_get_offset_at_point(terminal,event->x,event->y); + + if(baddr >= 0) + { + if(terminal->selecting) // Select region + { + lib3270_select_to(terminal->host,baddr); + } + if(terminal->moving) // Move selected area + { + terminal->selection_addr = lib3270_drag_selection(terminal->host,terminal->pointer,terminal->selection_addr,baddr); + } + else + { + terminal->pointer = lib3270_get_selection_flags(terminal->host,baddr); + update_mouse_pointer(widget,baddr); } } diff --git a/src/gtk/v3270/private.h b/src/gtk/v3270/private.h index 1dfc855..2a46500 100644 --- a/src/gtk/v3270/private.h +++ b/src/gtk/v3270/private.h @@ -85,21 +85,22 @@ G_BEGIN_DECLS /*--[ Globals ]--------------------------------------------------------------------------------------*/ - #define V3270_CURSOR_NORMAL LIB3270_CURSOR_NORMAL + #define V3270_CURSOR_UNPROTECTED LIB3270_CURSOR_EDITABLE #define V3270_CURSOR_WAITING LIB3270_CURSOR_WAITING #define V3270_CURSOR_LOCKED LIB3270_CURSOR_LOCKED - #define V3270_CURSOR_MOVE_SELECTION LIB3270_CURSOR_USER - #define V3270_CURSOR_SELECTION_TOP_LEFT LIB3270_CURSOR_USER+1 - #define V3270_CURSOR_SELECTION_TOP_RIGHT LIB3270_CURSOR_USER+2 - #define V3270_CURSOR_SELECTION_TOP LIB3270_CURSOR_USER+3 - #define V3270_CURSOR_SELECTION_BOTTOM_LEFT LIB3270_CURSOR_USER+4 - #define V3270_CURSOR_SELECTION_BOTTOM_RIGHT LIB3270_CURSOR_USER+5 - #define V3270_CURSOR_SELECTION_BOTTOM LIB3270_CURSOR_USER+6 - #define V3270_CURSOR_SELECTION_LEFT LIB3270_CURSOR_USER+7 - #define V3270_CURSOR_SELECTION_RIGHT LIB3270_CURSOR_USER+8 + #define V3270_CURSOR_PROTECTED LIB3270_CURSOR_USER + #define V3270_CURSOR_MOVE_SELECTION LIB3270_CURSOR_USER+1 + #define V3270_CURSOR_SELECTION_TOP_LEFT LIB3270_CURSOR_USER+2 + #define V3270_CURSOR_SELECTION_TOP_RIGHT LIB3270_CURSOR_USER+3 + #define V3270_CURSOR_SELECTION_TOP LIB3270_CURSOR_USER+4 + #define V3270_CURSOR_SELECTION_BOTTOM_LEFT LIB3270_CURSOR_USER+5 + #define V3270_CURSOR_SELECTION_BOTTOM_RIGHT LIB3270_CURSOR_USER+6 + #define V3270_CURSOR_SELECTION_BOTTOM LIB3270_CURSOR_USER+7 + #define V3270_CURSOR_SELECTION_LEFT LIB3270_CURSOR_USER+8 + #define V3270_CURSOR_SELECTION_RIGHT LIB3270_CURSOR_USER+9 - #define V3270_CURSOR_COUNT LIB3270_CURSOR_USER+9 + #define V3270_CURSOR_COUNT LIB3270_CURSOR_USER+10 struct v3270_metrics @@ -189,6 +190,7 @@ const GtkWidgetClass * v3270_get_parent_class(void); gboolean v3270_draw(GtkWidget * widget, cairo_t * cr); void v3270_draw_oia(cairo_t *cr, H3270 *host, int row, int cols, struct v3270_metrics *metrics, GdkColor *color, GdkRectangle *rect); +void v3270_update_mouse_pointer(GtkWidget *widget); #if ! GTK_CHECK_VERSION(3,0,0) gboolean v3270_expose(GtkWidget * widget, GdkEventExpose *event); diff --git a/src/gtk/v3270/widget.c b/src/gtk/v3270/widget.c index 94b2235..cce142b 100644 --- a/src/gtk/v3270/widget.c +++ b/src/gtk/v3270/widget.c @@ -271,34 +271,36 @@ static void v3270_class_init(v3270Class *klass) #ifdef WIN32 static const gchar * cr[V3270_CURSOR_COUNT] = { - "ibeam", - "wait", - "arrow", - "hand", - "sizenwse", // Top-left - "sizenesw", // Top-right - "sizens", // Top - "sizenesw", // Bottom-left - "sizenwse", // Bottom-right - "sizens", // Bottom - "sizewe", // Left - "sizewe", // Right + "ibeam", // V3270_CURSOR_UNPROTECTED + "wait", // V3270_CURSOR_WAITING + "arrow", // V3270_CURSOR_LOCKED + "arrow", // V3270_CURSOR_PROTECTED + "hand", // V3270_CURSOR_MOVE_SELECTION + "sizenwse", // V3270_CURSOR_SELECTION_TOP_LEFT + "sizenesw", // V3270_CURSOR_SELECTION_TOP_RIGHT + "sizens", // V3270_CURSOR_SELECTION_TOP + "sizenesw", // V3270_CURSOR_SELECTION_BOTTOM_LEFT + "sizenwse", // V3270_CURSOR_SELECTION_BOTTOM_RIGHT + "sizens", // V3270_CURSOR_SELECTION_BOTTOM + "sizewe", // V3270_CURSOR_SELECTION_LEFT + "sizewe", // V3270_CURSOR_SELECTION_RIGHT }; #else static const int cr[V3270_CURSOR_COUNT] = { - GDK_XTERM, - GDK_WATCH, - GDK_X_CURSOR, - GDK_HAND1, - GDK_TOP_LEFT_CORNER, // Top-left - GDK_TOP_RIGHT_CORNER, // Top-right - GDK_TOP_SIDE, // Top - GDK_BOTTOM_LEFT_CORNER, // Bottom-left - GDK_BOTTOM_RIGHT_CORNER, // Bottom-right - GDK_BOTTOM_SIDE, // Bottom - GDK_LEFT_SIDE, // Left - GDK_RIGHT_SIDE, // Right + GDK_XTERM, // V3270_CURSOR_UNPROTECTED + GDK_WATCH, // V3270_CURSOR_WAITING + GDK_X_CURSOR, // V3270_CURSOR_LOCKED + GDK_ARROW, // V3270_CURSOR_PROTECTED + GDK_HAND1, // V3270_CURSOR_MOVE_SELECTION + GDK_TOP_LEFT_CORNER, // V3270_CURSOR_SELECTION_TOP_LEFT + GDK_TOP_RIGHT_CORNER, // V3270_CURSOR_SELECTION_TOP_RIGHT + GDK_TOP_SIDE, // V3270_CURSOR_SELECTION_TOP + GDK_BOTTOM_LEFT_CORNER, // V3270_CURSOR_SELECTION_BOTTOM_LEFT + GDK_BOTTOM_RIGHT_CORNER, // V3270_CURSOR_SELECTION_BOTTOM_RIGHT + GDK_BOTTOM_SIDE, // V3270_CURSOR_SELECTION_BOTTOM + GDK_LEFT_SIDE, // V3270_CURSOR_SELECTION_LEFT + GDK_RIGHT_SIDE, // V3270_CURSOR_SELECTION_RIGHT }; #endif // WIN32 @@ -313,12 +315,6 @@ static void v3270_class_init(v3270Class *klass) #endif } } -/* - v3270_cursor[V3270_CURSOR_NORMAL] = gdk_cursor_new(GDK_XTERM); - v3270_cursor[V3270_CURSOR_WAITING] = gdk_cursor_new(GDK_WATCH); - v3270_cursor[V3270_CURSOR_LOCKED] = gdk_cursor_new(GDK_X_CURSOR); - v3270_cursor[] -*/ // Signals widget_class->activate_signal = @@ -573,8 +569,19 @@ static void select_cursor(H3270 *session, LIB3270_CURSOR id) if(gtk_widget_get_realized(widget) && gtk_widget_get_has_window(widget)) { GTK_V3270(widget)->pointer_id = id; - gdk_window_set_cursor(gtk_widget_get_window(widget),v3270_cursor[id]); + v3270_update_mouse_pointer(widget); + } +} + +static void ctlr_done(H3270 *session) +{ + GtkWidget *widget = GTK_WIDGET(session->widget); + + if(gtk_widget_get_realized(widget) && gtk_widget_get_has_window(widget)) + { + v3270_update_mouse_pointer(widget); } + } static void update_connect(H3270 *session, unsigned char connected) @@ -700,6 +707,8 @@ static void v3270_init(v3270 *widget) widget->host->update_connect = update_connect; widget->host->update_model = update_model; widget->host->changed = changed; + widget->host->ctlr_done = ctlr_done; + // Setup input method widget->input_method = gtk_im_multicontext_new(); diff --git a/src/include/lib3270.h b/src/include/lib3270.h index 3f55a3d..8b7c532 100644 --- a/src/include/lib3270.h +++ b/src/include/lib3270.h @@ -186,7 +186,7 @@ */ typedef enum _LIB3270_CURSOR { - LIB3270_CURSOR_NORMAL, /**< Ready for user actions */ + LIB3270_CURSOR_EDITABLE, /**< Ready for user actions */ LIB3270_CURSOR_WAITING, /**< Waiting for host */ LIB3270_CURSOR_LOCKED, /**< Locked, can't receive user actions */ @@ -698,6 +698,9 @@ LIB3270_EXPORT int lib3270_set_model(H3270 *session, int model); LIB3270_EXPORT int lib3270_get_model(H3270 *session); + LIB3270_EXPORT int lib3270_is_protected(H3270 *h, unsigned int baddr); + + #ifdef __cplusplus } #endif diff --git a/src/lib3270/api.h b/src/lib3270/api.h index e03a15d..96b35a6 100644 --- a/src/lib3270/api.h +++ b/src/lib3270/api.h @@ -271,7 +271,7 @@ /* Screen processing */ - #define CURSOR_MODE_NORMAL LIB3270_CURSOR_NORMAL + #define CURSOR_MODE_NORMAL LIB3270_CURSOR_EDITABLE #define CURSOR_MODE_WAITING LIB3270_CURSOR_WAITING #define CURSOR_MODE_LOCKED LIB3270_CURSOR_LOCKED diff --git a/src/lib3270/ctlr.c b/src/lib3270/ctlr.c index 1e7a737..9fd2077 100644 --- a/src/lib3270/ctlr.c +++ b/src/lib3270/ctlr.c @@ -380,7 +380,6 @@ int lib3270_field_length(H3270 *h, int baddr) */ unsigned char get_field_attribute(H3270 *h, int baddr) { - CHECK_SESSION_HANDLE(h); return h->ea_buf[find_field_attribute(h,baddr)].fa; } @@ -435,20 +434,19 @@ fa2ea(int baddr) * unprotected attribute byte, or 0 if no nonzero-width unprotected field * can be found. */ -int -next_unprotected(int baddr0) +int next_unprotected(H3270 *session, int baddr0) { register int baddr, nbaddr; nbaddr = baddr0; - do { + do + { baddr = nbaddr; INC_BA(nbaddr); - if (h3270.ea_buf[baddr].fa && - !FA_IS_PROTECTED(h3270.ea_buf[baddr].fa) && - !h3270.ea_buf[nbaddr].fa) + if(session->ea_buf[baddr].fa &&!FA_IS_PROTECTED(session->ea_buf[baddr].fa) &&!session->ea_buf[nbaddr].fa) return nbaddr; } while (nbaddr != baddr0); + return 0; } @@ -1287,7 +1285,7 @@ ctlr_write(unsigned char buf[], int buflen, Boolean erase) * Otherwise, advance to the first position of the * next unprotected field. */ - baddr = next_unprotected(h3270.buffer_addr); + baddr = next_unprotected(&h3270,h3270.buffer_addr); if (baddr < h3270.buffer_addr) baddr = 0; /* diff --git a/src/lib3270/ctlrc.h b/src/lib3270/ctlrc.h index 2a5b71c..df8df2a 100644 --- a/src/lib3270/ctlrc.h +++ b/src/lib3270/ctlrc.h @@ -53,7 +53,7 @@ LIB3270_INTERNAL struct ea *fa2ea(int baddr); LIB3270_INTERNAL Boolean get_bounded_field_attribute(register int baddr, register int bound, unsigned char *fa_out); LIB3270_INTERNAL void mdt_clear(int baddr); LIB3270_INTERNAL void mdt_set(int baddr); -LIB3270_INTERNAL int next_unprotected(int baddr0); +LIB3270_INTERNAL int next_unprotected(H3270 *session, int baddr0); LIB3270_INTERNAL enum pds process_ds(unsigned char *buf, int buflen); LIB3270_INTERNAL void ps_process(void); diff --git a/src/lib3270/kybd.c b/src/lib3270/kybd.c index 35d7ae3..2ada857 100644 --- a/src/lib3270/kybd.c +++ b/src/lib3270/kybd.c @@ -962,7 +962,7 @@ static Boolean key_Character(int code, Boolean with_ge, Boolean pasting, Boolean if (skipped != NULL) *skipped = True; if (FA_IS_SKIP(h3270.ea_buf[baddr].fa)) - baddr = next_unprotected(baddr); + baddr = next_unprotected(&h3270,baddr); else INC_BA(baddr); } @@ -1269,7 +1269,7 @@ retry: if (skipped != NULL) *skipped = True; if (FA_IS_SKIP(ea_buf[baddr].fa)) - baddr = next_unprotected(baddr); + baddr = next_unprotected(&h3270,baddr); else INC_BA(baddr); } @@ -1387,7 +1387,7 @@ LIB3270_KEY_ACTION( tab ) return 0; } #endif /*]*/ - cursor_move(&h3270,next_unprotected(h3270.cursor_addr)); + cursor_move(hSession,next_unprotected(hSession,hSession->cursor_addr)); return 0; } @@ -1550,7 +1550,7 @@ LIB3270_ACTION( firstfield ) cursor_move(hSession,0); return 0; } - cursor_move(hSession,next_unprotected(hSession->rows*hSession->cols-1)); + cursor_move(hSession,next_unprotected(hSession,hSession->rows*hSession->cols-1)); return 0; } @@ -2240,7 +2240,7 @@ LIB3270_CURSOR_ACTION( newline ) if (faddr != baddr && !FA_IS_PROTECTED(fa)) cursor_move(hSession,baddr); else - cursor_move(hSession,next_unprotected(baddr)); + cursor_move(hSession,next_unprotected(hSession,baddr)); return 0; } @@ -2263,7 +2263,7 @@ LIB3270_ACTION( dup ) if (key_Character(EBC_dup, False, False, NULL)) { screen_disp(hSession); - cursor_move(hSession,next_unprotected(hSession->cursor_addr)); + cursor_move(hSession,next_unprotected(hSession,hSession->cursor_addr)); } } @@ -2931,7 +2931,7 @@ remargin(int lmargin) faddr = find_field_attribute(&h3270,baddr); fa = h3270.ea_buf[faddr].fa; if (faddr == baddr || FA_IS_PROTECTED(fa)) { - baddr = next_unprotected(baddr); + baddr = next_unprotected(&h3270,baddr); if (baddr <= b0) return False; } @@ -3354,7 +3354,7 @@ kybd_prime(void) * The cursor is not in an unprotected field. Find the * next one. */ - baddr = next_unprotected(h3270.cursor_addr); + baddr = next_unprotected(&h3270,h3270.cursor_addr); /* If there isn't any, give up. */ if (!baddr) diff --git a/src/lib3270/paste.c b/src/lib3270/paste.c index e7b99ec..8c831da 100644 --- a/src/lib3270/paste.c +++ b/src/lib3270/paste.c @@ -122,7 +122,7 @@ fa = session->ea_buf[faddr].fa; if (faddr == baddr || FA_IS_PROTECTED(fa)) { - baddr = next_unprotected(baddr); + baddr = next_unprotected(session,baddr); if (baddr <= b0) return 0; } @@ -212,7 +212,7 @@ LIB3270_EXPORT int lib3270_set_string(H3270 *h, const unsigned char *str) if (faddr != baddr && !FA_IS_PROTECTED(fa)) cursor_move(h,baddr); else - cursor_move(h,next_unprotected(baddr)); + cursor_move(h,next_unprotected(h,baddr)); data.row = BA_TO_ROW(h->cursor_addr); } last = ' '; diff --git a/src/lib3270/screen.c b/src/lib3270/screen.c index ba0991b..8fc4000 100644 --- a/src/lib3270/screen.c +++ b/src/lib3270/screen.c @@ -768,3 +768,18 @@ LIB3270_EXPORT void lib3270_popup_dialog(H3270 *session, LIB3270_NOTIFY id , con popup_handler(session,id,title ? title : _( "3270 Error" ), message,fmt,args); va_end(args); } + +LIB3270_EXPORT int lib3270_is_protected(H3270 *h, unsigned int baddr) +{ + unsigned char fa; + + CHECK_SESSION_HANDLE(h); + + if(baddr > (h->rows * h->cols)) + return -1; + + fa = get_field_attribute(h,baddr); + + return FA_IS_PROTECTED(fa); +} + diff --git a/src/lib3270/selection.c b/src/lib3270/selection.c index e167894..3f915d1 100644 --- a/src/lib3270/selection.c +++ b/src/lib3270/selection.c @@ -606,6 +606,8 @@ LIB3270_EXPORT int lib3270_drag_selection(H3270 *h, unsigned char flag, int orig flag &= 0x1f; + trace("%s: flag=%04x",__FUNCTION__,flag); + if(!flag) return origin; else if(flag == SELECTION_ACTIVE) -- libgit2 0.21.2