From: notaz Date: Mon, 30 Jul 2012 12:49:21 +0000 (+0300) Subject: frontend: improve minimize handling X-Git-Tag: r15~7 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36dfb7876314f16d401e2016e55d126fb264d1df;p=pcsx_rearmed.git frontend: improve minimize handling --- diff --git a/frontend/main.c b/frontend/main.c index 59fa24a6..19e8319b 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -255,7 +255,16 @@ do_state_slot: plat_step_volume(emu_action == SACTION_VOLUME_UP); return; case SACTION_MINIMIZE: + if (GPU_close != NULL) + GPU_close(); + plat_minimize(); + + if (GPU_open != NULL) { + ret = GPU_open(&gpuDisp, "PCSX", NULL); + if (ret) + fprintf(stderr, "GPU_open returned %d\n", ret); + } return; #endif default: diff --git a/frontend/plat_omap.c b/frontend/plat_omap.c index 89a59a6b..b8ab19ba 100644 --- a/frontend/plat_omap.c +++ b/frontend/plat_omap.c @@ -147,10 +147,19 @@ void plat_video_menu_leave(void) void plat_minimize(void) { - omap_enable_layer(0); + int ret; + + ret = vout_fbdev_save(layer_fb); + if (ret != 0) { + printf("minimize: layer/fb handling failed\n"); + return; + } + xenv_minimize(); + in_set_config_int(0, IN_CFG_BLOCKING, 0); /* flush event queue */ - omap_enable_layer(1); + omap_enable_layer(0); /* restore layer mem */ + vout_fbdev_restore(layer_fb); } void *plat_prepare_screenshot(int *w, int *h, int *bpp)