frontend: improve minimize handling
authornotaz <notasas@gmail.com>
Mon, 30 Jul 2012 12:49:21 +0000 (15:49 +0300)
committernotaz <notasas@gmail.com>
Mon, 30 Jul 2012 22:31:34 +0000 (01:31 +0300)
frontend/main.c
frontend/plat_omap.c

index 59fa24a..19e8319 100644 (file)
@@ -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:
index 89a59a6..b8ab19b 100644 (file)
@@ -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)