From 36dfb7876314f16d401e2016e55d126fb264d1df Mon Sep 17 00:00:00 2001 From: notaz Date: Mon, 30 Jul 2012 15:49:21 +0300 Subject: [PATCH] frontend: improve minimize handling --- frontend/main.c | 9 +++++++++ frontend/plat_omap.c | 13 +++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) 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) -- 2.39.5