Commit e0363d1e12903eb60e3a8866f4ba78331c7ae3f0

Authored by Perry Werneck
1 parent 3950ef03
Exists in master and in 1 other branch develop

Pequenas correções no funcionamento do timer.

Showing 1 changed file with 17 additions and 9 deletions   Show diff stats
oia.c
... ... @@ -816,7 +816,8 @@ struct timer_info
816 816  
817 817 static void release_timer(struct timer_info *info)
818 818 {
819   -// trace("Timer %p stops",info);
  819 + trace("Timer %p stops",info);
  820 +
820 821 info->terminal->timer = NULL;
821 822  
822 823 if(info->terminal->surface)
... ... @@ -957,6 +958,7 @@ static gboolean update_timer(struct timer_info *info)
957 958 time_t now = time(0);
958 959 GdkRectangle * rect;
959 960  
  961 +// debug("%s %p",__FUNCTION__,info->terminal->surface);
960 962 if(!info->terminal->surface)
961 963 return TRUE;
962 964  
... ... @@ -986,8 +988,11 @@ static gboolean update_timer(struct timer_info *info)
986 988 buffer[5] = 0;
987 989  
988 990 cairo_set_scaled_font(cr,info->terminal->font.scaled);
989   - cairo_move_to(cr,rect->x,rect->y+info->terminal->font.height);
990   - cairo_show_text(cr, buffer);
  991 +// cairo_move_to(cr,rect->x,rect->y+info->terminal->font.height);
  992 +// cairo_show_text(cr, buffer);
  993 +
  994 + v3270_draw_text(cr, rect, &info->terminal->font, buffer);
  995 +
991 996 cairo_stroke(cr);
992 997  
993 998 info->last = now;
... ... @@ -1025,6 +1030,8 @@ void v3270_start_timer(GtkWidget *widget)
1025 1030 struct timer_info *info;
1026 1031 v3270 *terminal = GTK_V3270(widget);
1027 1032  
  1033 + trace("Timer %p starts",terminal);
  1034 +
1028 1035 if(terminal->timer)
1029 1036 {
1030 1037 g_source_ref(terminal->timer);
... ... @@ -1041,23 +1048,24 @@ void v3270_start_timer(GtkWidget *widget)
1041 1048 g_source_attach(terminal->timer, NULL);
1042 1049 g_source_unref(terminal->timer);
1043 1050  
1044   - trace("Timer %p starts",info);
  1051 +
1045 1052 }
1046 1053  
1047 1054 void v3270_stop_timer(GtkWidget *widget)
1048 1055 {
1049 1056 v3270 *terminal = GTK_V3270(widget);
1050 1057  
1051   - if(!terminal->timer)
1052   - return;
  1058 + trace("%s(%p)",__FUNCTION__,terminal->timer);
  1059 +
  1060 +// if(!terminal->timer)
  1061 +// return;
1053 1062  
1054 1063 // trace("Timer=%p",terminal->timer);
1055   - if(terminal->timer->ref_count < 2)
1056   - g_source_destroy(terminal->timer);
  1064 +// if(terminal->timer->ref_count < 2)
  1065 +// g_source_destroy(terminal->timer);
1057 1066  
1058 1067 if(terminal->timer)
1059 1068 g_source_unref(terminal->timer);
1060   -
1061 1069 }
1062 1070  
1063 1071 void v3270_update_ssl(H3270 *session, LIB3270_SSL_STATE state)
... ...