Commit dd6dc27362992c985e46d98663fc3bd5e8fc1a3c
1 parent
9fd81a88
Exists in
master
and in
5 other branches
Pesquisando erros aleatorios em win64
Showing
4 changed files
with
14 additions
and
9 deletions
Show diff stats
src/lib3270/ctlr.c
@@ -228,7 +228,7 @@ void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ovr) | @@ -228,7 +228,7 @@ void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ovr) | ||
228 | if(idx < 0 || idx >= (sizeof(sz)/sizeof(struct _sz))) | 228 | if(idx < 0 || idx >= (sizeof(sz)/sizeof(struct _sz))) |
229 | { | 229 | { |
230 | idx = 2; | 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 | mn = 4; | 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,13 +240,13 @@ void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ovr) | ||
240 | if (ovc != 0 || ovr != 0) | 240 | if (ovc != 0 || ovr != 0) |
241 | { | 241 | { |
242 | if (ovc <= 0 || ovr <= 0) | 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 | else if (ovc * ovr >= 0x4000) | 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 | else if (ovc > 0 && ovc < session->maxCOLS) | 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 | else if (ovr > 0 && ovr < session->maxROWS) | 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 | else | 250 | else |
251 | update_model_info(session,mn,session->ov_cols = ovc,session->ov_rows = ovr); | 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,7 +180,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model) | ||
180 | model_number = parse_model_number(hSession,model); | 180 | model_number = parse_model_number(hSession,model); |
181 | if (model_number < 0) | 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 | model_number = 0; | 184 | model_number = 0; |
185 | } | 185 | } |
186 | 186 |
src/lib3270/screen.c
@@ -660,7 +660,7 @@ void Warning(H3270 *session, const char *fmt, ...) | @@ -660,7 +660,7 @@ void Warning(H3270 *session, const char *fmt, ...) | ||
660 | } | 660 | } |
661 | 661 | ||
662 | /* Pop up an error dialog. */ | 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 | va_list args; | 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,11 +220,14 @@ void v3270_popup_message(GtkWidget *widget, LIB3270_NOTIFY type , const gchar *t | ||
220 | GtkMessageType msgtype = GTK_MESSAGE_WARNING; | 220 | GtkMessageType msgtype = GTK_MESSAGE_WARNING; |
221 | GtkButtonsType buttons = GTK_BUTTONS_OK; | 221 | GtkButtonsType buttons = GTK_BUTTONS_OK; |
222 | 222 | ||
223 | - trace("%s: widget=%p",__FUNCTION__,widget); | ||
224 | - | ||
225 | if(widget && GTK_IS_WIDGET(widget)) | 223 | if(widget && GTK_IS_WIDGET(widget)) |
226 | toplevel = gtk_widget_get_toplevel(GTK_WIDGET(widget)); | 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 | if(type == LIB3270_NOTIFY_CRITICAL) | 231 | if(type == LIB3270_NOTIFY_CRITICAL) |
229 | { | 232 | { |
230 | msgtype = GTK_MESSAGE_ERROR; | 233 | msgtype = GTK_MESSAGE_ERROR; |
@@ -253,6 +256,8 @@ void v3270_popup_message(GtkWidget *widget, LIB3270_NOTIFY type , const gchar *t | @@ -253,6 +256,8 @@ void v3270_popup_message(GtkWidget *widget, LIB3270_NOTIFY type , const gchar *t | ||
253 | gtk_widget_show_all(dialog); | 256 | gtk_widget_show_all(dialog); |
254 | gtk_dialog_run(GTK_DIALOG (dialog)); | 257 | gtk_dialog_run(GTK_DIALOG (dialog)); |
255 | gtk_widget_destroy(dialog); | 258 | gtk_widget_destroy(dialog); |
259 | + | ||
260 | + trace("%s ends",__FUNCTION__); | ||
256 | } | 261 | } |
257 | 262 | ||
258 | static void v3270_class_init(v3270Class *klass) | 263 | static void v3270_class_init(v3270Class *klass) |