Fixed resize bug

This commit is contained in:
Devine Lu Linvega 2024-01-16 16:55:03 -08:00
parent 01d8856d99
commit f135322b17
1 changed files with 7 additions and 4 deletions

View File

@ -136,9 +136,12 @@ emu_event(Uxn *u)
XEvent ev; XEvent ev;
XNextEvent(display, &ev); XNextEvent(display, &ev);
switch(ev.type) { switch(ev.type) {
case Expose: case Expose: {
XPutImage(display, window, DefaultGC(display, 0), ximage, 0, 0, PAD, PAD, uxn_screen.width * uxn_screen.scale, uxn_screen.height * uxn_screen.scale); int w = uxn_screen.width * uxn_screen.scale;
break; int h = uxn_screen.height * uxn_screen.scale;
XResizeWindow(display, window, w + PAD * 2, h + PAD * 2);
XPutImage(display, window, DefaultGC(display, 0), ximage, 0, 0, PAD, PAD, w, h);
} break;
case ClientMessage: case ClientMessage:
emu_end(u); emu_end(u);
break; break;
@ -266,7 +269,7 @@ main(int argc, char **argv)
return 0; return 0;
} }
if(argv[i][0] == '-' && argv[i][1] == 'v') { if(argv[i][0] == '-' && argv[i][1] == 'v') {
fprintf(stdout, "Uxn11 - Varvara Emulator, 15 Jan 2023.\n"); fprintf(stdout, "Uxn11 - Varvara Emulator, 16 Jan 2023.\n");
i++; i++;
} }
if(!system_boot(&u, (Uint8 *)calloc(0x10000 * RAM_PAGES, sizeof(Uint8)), argv[i++])) { if(!system_boot(&u, (Uint8 *)calloc(0x10000 * RAM_PAGES, sizeof(Uint8)), argv[i++])) {