Commit 076377235f6c2ae5eddd3d2dcd19734cce0de174

Authored by Perry Werneck
1 parent 39a94943

Fixing "keep-selected" flag behavior.

Showing 2 changed files with 9 additions and 4 deletions   Show diff stats
src/lib3270/ctlr.c
@@ -2429,9 +2429,8 @@ int ctlr_any_data(H3270 *session) @@ -2429,9 +2429,8 @@ int ctlr_any_data(H3270 *session)
2429 return 0; 2429 return 0;
2430 } 2430 }
2431 2431
2432 -/*  
2433 - * Clear the text (non-status) portion of the display. Also resets the cursor  
2434 - * and buffer addresses and extended attributes. 2432 +/**
  2433 + * @brief Clear the text (non-status) portion of the display. Also resets the cursor and buffer addresses and extended attributes.
2435 */ 2434 */
2436 void ctlr_clear(H3270 *session, Boolean can_snap) 2435 void ctlr_clear(H3270 *session, Boolean can_snap)
2437 { 2436 {
@@ -2452,7 +2451,11 @@ void ctlr_clear(H3270 *session, Boolean can_snap) @@ -2452,7 +2451,11 @@ void ctlr_clear(H3270 *session, Boolean can_snap)
2452 (void) memset((char *)session->ea_buf, 0, session->rows*session->cols*sizeof(struct lib3270_ea)); 2451 (void) memset((char *)session->ea_buf, 0, session->rows*session->cols*sizeof(struct lib3270_ea));
2453 cursor_move(session,0); 2452 cursor_move(session,0);
2454 session->buffer_addr = 0; 2453 session->buffer_addr = 0;
2455 - lib3270_unselect(session); 2454 +
  2455 + if(!lib3270_get_toggle(session,LIB3270_TOGGLE_KEEP_SELECTED)) {
  2456 + lib3270_unselect(session);
  2457 + }
  2458 +
2456 set_formatted(session,0); 2459 set_formatted(session,0);
2457 session->default_fg = 0; 2460 session->default_fg = 0;
2458 session->default_bg = 0; 2461 session->default_bg = 0;
src/lib3270/selection.c
@@ -182,6 +182,8 @@ LIB3270_EXPORT int lib3270_unselect(H3270 *hSession) @@ -182,6 +182,8 @@ LIB3270_EXPORT int lib3270_unselect(H3270 *hSession)
182 182
183 CHECK_SESSION_HANDLE(hSession); 183 CHECK_SESSION_HANDLE(hSession);
184 184
  185 + trace("%s",__FUNCTION__);
  186 +
185 if(hSession->selected) 187 if(hSession->selected)
186 { 188 {
187 hSession->selected = 0; 189 hSession->selected = 0;