Commit f66bcb1b83598958df8f9c3d01c1a15ec86a322f
1 parent
7e5037ca
Exists in
master
and in
1 other branch
Fixing segfaults on windows.
Showing
2 changed files
with
5 additions
and
24 deletions
Show diff stats
src/terminal/drawing/draw.c
| @@ -428,27 +428,6 @@ LIB3270_EXPORT void v3270_reload(GtkWidget *widget) | @@ -428,27 +428,6 @@ LIB3270_EXPORT void v3270_reload(GtkWidget *widget) | ||
| 428 | 428 | ||
| 429 | cairo_destroy(cr); | 429 | cairo_destroy(cr); |
| 430 | 430 | ||
| 431 | - /* | ||
| 432 | - v3270 * terminal = GTK_V3270(widget); | ||
| 433 | - cairo_t * cr; | ||
| 434 | - | ||
| 435 | - | ||
| 436 | - | ||
| 437 | - // Create new terminal image | ||
| 438 | - if(terminal->surface) | ||
| 439 | - cairo_surface_destroy(terminal->surface); | ||
| 440 | - | ||
| 441 | - terminal->surface = (cairo_surface_t *) gdk_window_create_similar_surface(gtk_widget_get_window(widget),CAIRO_CONTENT_COLOR,width,height); | ||
| 442 | - | ||
| 443 | - // Update the created image | ||
| 444 | - cr = cairo_create(terminal->surface); | ||
| 445 | - v3270_compute_font_size(terminal, cr, width, height); | ||
| 446 | - v3270_update_font_metrics(terminal, width, height); | ||
| 447 | - | ||
| 448 | - v3270_redraw(terminal, cr, width, height); | ||
| 449 | - | ||
| 450 | - cairo_destroy(cr); | ||
| 451 | - */ | ||
| 452 | } | 431 | } |
| 453 | 432 | ||
| 454 | void v3270_update_char(H3270 *session, int addr, unsigned char chr, unsigned short attr, unsigned char cursor) | 433 | void v3270_update_char(H3270 *session, int addr, unsigned char chr, unsigned short attr, unsigned char cursor) |
src/terminal/font/properties.c
| @@ -66,12 +66,14 @@ LIB3270_EXPORT void v3270_set_font_family(GtkWidget *widget, const gchar *name) | @@ -66,12 +66,14 @@ LIB3270_EXPORT void v3270_set_font_family(GtkWidget *widget, const gchar *name) | ||
| 66 | g_signal_emit(widget,v3270_widget_signal[V3270_SIGNAL_UPDATE_CONFIG], 0, "font-family", name); | 66 | g_signal_emit(widget,v3270_widget_signal[V3270_SIGNAL_UPDATE_CONFIG], 0, "font-family", name); |
| 67 | g_object_notify_by_pspec(G_OBJECT(widget), GTK_V3270_GET_CLASS(widget)->properties.font_family); | 67 | g_object_notify_by_pspec(G_OBJECT(widget), GTK_V3270_GET_CLASS(widget)->properties.font_family); |
| 68 | 68 | ||
| 69 | - v3270_reconfigure(terminal); | ||
| 70 | - gtk_widget_queue_draw(widget); | 69 | + if(gtk_widget_get_realized(widget) && gtk_widget_get_has_window(widget)) |
| 70 | + { | ||
| 71 | + v3270_reconfigure(terminal); | ||
| 72 | + gtk_widget_queue_draw(widget); | ||
| 73 | + } | ||
| 71 | 74 | ||
| 72 | } | 75 | } |
| 73 | 76 | ||
| 74 | - | ||
| 75 | } | 77 | } |
| 76 | 78 | ||
| 77 | LIB3270_EXPORT const gchar * v3270_get_font_family(GtkWidget *widget) | 79 | LIB3270_EXPORT const gchar * v3270_get_font_family(GtkWidget *widget) |