X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=linux%2Fgp2x.c;h=4c11d2b1dab8235ef41da6ebcd9332275d3d4e86;hb=44bfd52ff5bd5621a3ea967565dedf0a01ba9c53;hp=4f24ca9e4c2bbe3589ff01c24b157695e6ed5a4e;hpb=5a31ef07776f196cbf25748eee78da65b2b89928;p=libpicofe.git diff --git a/linux/gp2x.c b/linux/gp2x.c index 4f24ca9..4c11d2b 100644 --- a/linux/gp2x.c +++ b/linux/gp2x.c @@ -114,9 +114,11 @@ static gint key_release_event (GtkWidget *widget, GdkEventKey *event) static void size_allocate_event(GtkWidget *widget, GtkAllocation *allocation, gpointer user_data) { // printf("%dx%d\n", allocation->width, allocation->height); - scr_w = allocation->width - 2; - scr_h = allocation->height - 2; - scr_changed = 1; + if (scr_w != allocation->width - 2 || scr_h != allocation->height - 2) { + scr_w = allocation->width - 2; + scr_h = allocation->height - 2; + scr_changed = 1; + } } static void *gtk_threadf(void *targ) @@ -198,7 +200,7 @@ static void realloc_screen(void) void *old = g_screen_ptr; g_screen_width = scr_w; g_screen_height = scr_h; - g_screen_ptr = malloc(g_screen_width * g_screen_height * 2); + g_screen_ptr = calloc(g_screen_width * g_screen_height * 2, 1); free(old); scr_changed = 0; }