Commit dd6dc27362992c985e46d98663fc3bd5e8fc1a3c

Authored by perry.werneck@gmail.com
1 parent 9fd81a88

Pesquisando erros aleatorios em win64

src/lib3270/ctlr.c
... ... @@ -228,7 +228,7 @@ void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ovr)
228 228 if(idx < 0 || idx >= (sizeof(sz)/sizeof(struct _sz)))
229 229 {
230 230 idx = 2;
231   - popup_an_error(NULL,"Unknown model: %d - Defaulting to 4 (%dx%d)", mn, sz[idx].cols,sz[idx].rows);
  231 + popup_an_error(session,"Unknown model: %d - Defaulting to 4 (%dx%d)", mn, sz[idx].cols,sz[idx].rows);
232 232 mn = 4;
233 233 }
234 234  
... ... @@ -240,13 +240,13 @@ void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ovr)
240 240 if (ovc != 0 || ovr != 0)
241 241 {
242 242 if (ovc <= 0 || ovr <= 0)
243   - popup_an_error(NULL,"Invalid %s %dx%d:\nNegative or zero",ResOversize, ovc, ovr);
  243 + popup_an_error(session,"Invalid %s %dx%d:\nNegative or zero",ResOversize, ovc, ovr);
244 244 else if (ovc * ovr >= 0x4000)
245   - popup_an_error(NULL,"Invalid %s %dx%d:\nToo big",ResOversize, ovc, ovr);
  245 + popup_an_error(session,"Invalid %s %dx%d:\nToo big",ResOversize, ovc, ovr);
246 246 else if (ovc > 0 && ovc < session->maxCOLS)
247   - popup_an_error(NULL,"Invalid %s cols (%d):\nLess than model %d cols (%d)",ResOversize, ovc, session->model_num, session->maxCOLS);
  247 + popup_an_error(session,"Invalid %s cols (%d):\nLess than model %d cols (%d)",ResOversize, ovc, session->model_num, session->maxCOLS);
248 248 else if (ovr > 0 && ovr < session->maxROWS)
249   - popup_an_error(NULL,"Invalid %s rows (%d):\nLess than model %d rows (%d)",ResOversize, ovr, session->model_num, session->maxROWS);
  249 + popup_an_error(session,"Invalid %s rows (%d):\nLess than model %d rows (%d)",ResOversize, ovr, session->model_num, session->maxROWS);
250 250 else
251 251 update_model_info(session,mn,session->ov_cols = ovc,session->ov_rows = ovr);
252 252 }
... ...
src/lib3270/init.c
... ... @@ -180,7 +180,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model)
180 180 model_number = parse_model_number(hSession,model);
181 181 if (model_number < 0)
182 182 {
183   - popup_an_error(NULL,"Invalid model number: %s", model);
  183 + popup_an_error(hSession,"Invalid model number: %s", model);
184 184 model_number = 0;
185 185 }
186 186  
... ...
src/lib3270/screen.c
... ... @@ -660,7 +660,7 @@ void Warning(H3270 *session, const char *fmt, ...)
660 660 }
661 661  
662 662 /* Pop up an error dialog. */
663   -extern void popup_an_error(H3270 *session, const char *fmt, ...)
  663 +void popup_an_error(H3270 *session, const char *fmt, ...)
664 664 {
665 665 va_list args;
666 666  
... ...
src/pw3270/v3270/widget.c
... ... @@ -220,11 +220,14 @@ void v3270_popup_message(GtkWidget *widget, LIB3270_NOTIFY type , const gchar *t
220 220 GtkMessageType msgtype = GTK_MESSAGE_WARNING;
221 221 GtkButtonsType buttons = GTK_BUTTONS_OK;
222 222  
223   - trace("%s: widget=%p",__FUNCTION__,widget);
224   -
225 223 if(widget && GTK_IS_WIDGET(widget))
226 224 toplevel = gtk_widget_get_toplevel(GTK_WIDGET(widget));
227 225  
  226 + if(!GTK_IS_WINDOW(toplevel))
  227 + toplevel = NULL;
  228 +
  229 + trace("%s: widget=%p toplevel=%p",__FUNCTION__,widget,toplevel);
  230 +
228 231 if(type == LIB3270_NOTIFY_CRITICAL)
229 232 {
230 233 msgtype = GTK_MESSAGE_ERROR;
... ... @@ -253,6 +256,8 @@ void v3270_popup_message(GtkWidget *widget, LIB3270_NOTIFY type , const gchar *t
253 256 gtk_widget_show_all(dialog);
254 257 gtk_dialog_run(GTK_DIALOG (dialog));
255 258 gtk_widget_destroy(dialog);
  259 +
  260 + trace("%s ends",__FUNCTION__);
256 261 }
257 262  
258 263 static void v3270_class_init(v3270Class *klass)
... ...